This is an addon for qToggleServer.
It pushes events to an MQTT broker.
Install using pip:
pip install qtoggleserver-mqtt
This is add-on provides an event handler that will connect to the MQTT broker and will push desired events in a specified format.
The message payload is constructed from a template, as indicated by Template Notifications. By default, no templates are specified and the payload will be the template context serialized as JSON.
- type:
string
- default: required
- example:
"test.mosquitto.org"
- type:
integer
- default:
1883
Controls TLS support.
- type:
boolean
- default:
false
Whether to verify the server-supplied certificate. Disabling this will effectively disable server authentication, ensuring only data transmission encryption.
- type:
boolean
- default:
true
Full path to CA file, for self-signed certificates.
- type:
string
- default:
null
Full path to client certificate file, for client authentication.
- type:
string
- default:
null
Full path to client certificate key file, for client authentication.
- type:
string
- default:
null
Indicates a username to supply for authentication. The value is in fact a template that can be customized following the
rules described in Template Notifications. The
available context is limited however to device_attrs
.
- type:
string
- default:
null
Indicates a password to supply for authentication. The value is in fact a template that can be customized following the
rules described in Template Notifications. The
available context is limited however to device_attrs
.
- type:
string
- default:
null
Indicates the MQTT client id to use. The value is in fact a template that can be customized following the rules
described in Template Notifications. The
available context is limited however to device_attrs
.
- type:
string
- default:
{{device_attrs.name}}
Represents the interval, in seconds, between two (re)connection attempts to the MQTT server.
- type:
integer
- default:
5
Indicates the MQTT topic to which to publish the message. The value is in fact a template that can be customized following the rules described in Template Notifications. The available context can be used to construct topics specific to each device, port, event type, etc.
- type:
string
- default:
{{device_attrs.name}}
Used only when template
and templates
are unset, when the payload consists of a JSON-dumped context. Indicates which
context fields to include in the payload. If null
, will include all fields.
- type:
string[]
- default:
null
Sets the QoS MQTT level:
-
0
- at most once -
1
- at least once -
2
- exactly once -
type:
integer
-
default:
0
Indicates whether the logs generated by the MQTT client will be added to the qToggleServer logging system or not.
- type:
boolean
- default:
false
See Event Handlers for details on filtering events.
- type:
dictionary
- default:
null
See Template Notifications for details on
specifying templates. Keep in mind that default templates for this driver are null
.
- type:
string
- default:
null
See Template Notifications for details on
specifying templates. Keep in mind that default templates for this driver are null
.
- type:
dictionary
- default:
null