Skip to content

Sensor Configuration

Ellis Percival edited this page Jan 20, 2021 · 2 revisions

Configuration of sensors is done by configuring a sensor module, then configuring some individual sensor inputs.

sensor_modules

List of dictionary values which will contain the following options. Further options may be added by the sensor module itself.

TODO: Add the options for all of the individual modules

name

Name of this module configuration. This is an arbitrary string that is used by the sensor_inputs configurations to specify which sensor module is being used.

module

Name of the class of sensor module used (lm75, dht22 etc.) for this configuration.

cleanup

Whether to run the 'cleanup' functions for this module when the software exits. Defaults to true.

sensor_inputs

List of dictionary values which will contain the following options. Further options may be added by the sensor module itself.

TODO: Add the options for all of the individual modules

name

Name of this sensor. This will be used as part of the MQTT topic when the sensor value is read and an MQTT message is sent with its value. For example: <topic_prefix>/sensor/<name>.

module

Name of the module configuration to use for this input. This is the name used in the sensor_modules section documented above.

retain

Boolean value that specifies whether to use the retain flag when publishing MQTT messages for sensor value updates.

interval

Number of seconds to wait between polling the sensor for its current value. Default is 60.

digits

Number of digits to round the sensor value to. Defaults to 2.

unit_of_measurement

Not used at present.

TODO: Remove this?