OneWire
The OneWire module provides access to Dallas/Maxim OneWire devices using the
w1
kernel module.
Attention
You need to have wire-1
installed and configured for this module to work.
This process will vary based on the board and operatering system you are using.
Permissions
A udev
rule file is provided to simplify access permissions for wire-1
devices.
First add the wire
group if it does not exist and add the user running
MQTTany to the wire
group:
sudo addgroup --system wire
sudo usermod -aG wire mqttany
Then install the udev
rule and reboot:
sudo cp udev/98-w1.rules /etc/udev/rules.d/
sudo reboot now
Devices
See the device pages below for details on each one and to see any additional options available for them.
Paths
Device IDs are used as the nodes in this module, giving paths like
{device-id}/{property-id}
. The device pages give more detail on the properties
they provide.
Path |
Description |
---|---|
|
The polling interval will be published here
with |
|
Sending any message (even blank) here will poll all configured devices to publish their current states. |
|
Device address will be published here with
|
Configuration
Optional settings are commented out, default values are shown.
onewire:
#bus: 'w1'
#polling interval: 0
#bus scan: false
device-id:
address: ''
#name: '{device_id}'
batch-id:
address: ['', '']
#name: '{device_id}'
#name: [ ] # can also provide a matching list of names
#first index: 0
Module Settings
Option |
Description |
---|---|
|
OneWire bus interface, currently only Optional, default |
|
Interval in seconds to publish all pin states. Optional, default |
|
Set to Optional, default |
Single Device Definition
Device configuration section names must be unique throughout the config file as they
are used as node IDs. Node IDs can only contain lowercase letters a-z
, numbers
0-9
, and hyphens -
. The following settings are for single device definitions:
Option |
Description |
---|---|
|
The device’s address, can be 7 or 8 bytes, can use
MUST BE IN SINGLE QUOTES |
|
Friendly name for the device. Substitutions:
Optional, default |
Multiple Device Definition
It is also possible to define settings for several devices at the same time. Settings from single device definitions apply here also, except for those shown below.
Option |
Description |
---|---|
|
Instead of a single address you can specify a list of addresses. |
|
For multiple device definitions, name can be a single name or a list of names the same length as the list of addresses. An additional substitution If a single name is given and the substitution Optional, default |
|
Will be added to device’s index in the list of
addresses when subsituting Optional, default |