-
Notifications
You must be signed in to change notification settings - Fork 159
MQTT Configuration
This section, unsurprisingly, handles all of the configuration for the software's connection to the MQTT server.
Host name or IP of the server to connect to.
Port on which to connect to the server on.
Username to use.
Password to use.
Client ID to use. If not provided, this is configured automatically by the software to be pi-mqtt-gpio-
plus the hashed value of the configured topic_prefix
configuration option. This default ensures that each instance of the software connected to the MQTT server receives the same client ID and session when they occupy the same set of topics as defined by topic_prefix
. This deliberately forces only one instance of the software to run on a given topic_prefix
at a given time in order to avoid confusing accidents.
If for some reason you'd like to run multiple instances of the software on a given topic_prefix
then you may set the client_id
here manually. However, this behaviour is not supported and may well cause weird behaviour.
Prefix to prepend to every topic used by the software. You must use this to differentiate multiple instances of the software connecting to the same MQTT server.
For example, you may have one Raspberry Pi that controls your living room lights using the prefix home/livingroom/lights
and another one detecting when your doorbell has been pressed on home/doorbell
. All topics used by this software will be prefixed by these values, so you'd publish to home/livingroom/lights/output/tv_lamp/set
to switch the TV lamp on and off, and you'd subscribe to home/doorbell/input/doorbell
to receive messages when your doorbell has been pushed.
Which version of the MQTT protocol to use as specified in the paho-mqtt documentation, but the values are one of the following:
3.1
3.1.1
The software will publish its status on this topic (prefixed by topic_prefix
) with payloads of running
, stopped
and dead
, which can be overridden with status_payload_running
, status_payload_stopped
and status_payload_dead
respectively.
Payload for status messages sent when the software starts running.
Payload for status messages sent when the software is stopped and disconnects from the MQTT server cleanly.
Payload for status messages sent (by Last Will and Testament setting) when the software disconnects from the MQTT server without shutting down properly.
Boolean value to enable Home Assistant Discovery, which is off by default.
Topic prefix to send Home Assistant Discovery payloads to. Defaults to homeassistant
.
What name to announce to Home Assistant when publishing discovery payloads. Defaults to MQTT GPIO
.
This is a dict subsection that contains all TLS encryption settings, when using an encrypted connection to the MQTT server.
See the MQTT TLS page for details of these settings.