yaq/daemons/mqtt-homie-sensor


A daemon to expose homie devices as yaq sensors with one channel per property.

bugtracker
source

installation

The mqtt-homie-sensor daemon can be installed using the following package managers:

PyPI
conda-forge

traits

The mqtt-homie-sensor daemon is composed of the following traits:

is-daemon
is-sensor

configuration

device_id (string)
Homie device id.

enable (boolean) default: True
Disable this daemon. The kind entry-point will not attempt to start this daemon.
from is-daemon

log_level ({'name': 'level', 'symbols': ['debug', 'info', 'notice', 'warning', 'error', 'critical', 'alert', 'emergency'], 'type': 'enum'}) default: info
Set daemon log-level.
from is-daemon

log_to_file (boolean) default: False
Optionally force logging to a file.
from is-daemon

make (['null', 'string']) default: None
from is-daemon

model (['null', 'string']) default: None
from is-daemon

mqtt_host (string)
MQTT host, e.g. mqtt.chem.wisc.edu

mqtt_keepalive (int) default: 60
MQTT keepalive time in seconds. Must be integer.

mqtt_port (int) default: 1883
MQTT port.

port (int)
TCP port for daemon to occupy.
from is-daemon

serial (['null', 'string']) default: None
Serial number for the particular device represented by the daemon
from is-daemon

messages

The mqtt-homie-sensor daemon will expose the following public messages:

busy ➜ boolean
Returns true if daemon is currently busy.
from is-daemon

get_channel_names ➜ {'items': 'string', 'type': 'array'}
Get current channel names.
from is-sensor

get_channel_shapes ➜ {'type': 'map', 'values': {'items': 'int', 'type': 'array'}}
Get current channel shapes. If list is empty, channel is scalar.
from is-sensor

get_channel_units ➜ {'type': 'map', 'values': ['null', 'string']}
Get current channel units.
from is-sensor

get_config ➜ string
Full configuration for the individual daemon as defined in the TOML file. This includes defaults and shared settings not directly specified in the daemon-specific TOML table.
from is-daemon

get_config_filepath ➜ string
String representing the absolute filepath of the configuration file on the host machine.
from is-daemon

get_measured ➜ {'type': 'map', 'values': ['double', 'ndarray', 'int']}
Returns map of channel_name to measured_value. Always returns additional key measurement_id.
from is-sensor

get_measurement_id ➜ {'type': 'int'}
Get current measurement_id. Clients are encouraged to watch for this to be updated before calling get_measured to get entire measurement.
from is-sensor

get_state ➜ string
Get version of the running daemon
from is-daemon

id ➜ {'type': 'map', 'values': ['null', 'string']}
JSON object with information to identify the daemon, including name, kind, make, model, serial.
from is-daemon

shutdown ➜ null
Cleanly shutdown (or restart) daemon.
from is-daemon
parameters:

restart (boolean) default: False


built 2021-04-16 05:08:36                                      CC0: no copyright