Does anyone know where I could find a guide/tutorial dealing with mqtt topics and where/how to use the correct topic? I’ve just switched to zigbee2mqtt and zwavejsmqtt but am struggling to do some automations in node-red and it keeps coming back to not having the correct topic. Thanks in advance.
I had a hard time when first implementing mqtt. My problem was that I was expecting something complicated, when in reality it’s really simplistic.
Don’t worry about retain or qos right now. The topic is simply a path to a value
, or in mqtt, payload
. You have publishing (sending info,mqtt out) and listeners (listening for info, mqtt in). The topic is the path to that info.
Usually the first part of the path(topic), people will use either the area or the device type itself.
thermostat/ecobee/bedroom
or
bedroom/thermostat/ecobee
Most importantly it can be anything, it’s simply an address. So your device sends info to whatever path(topic) is defined in it’s settings. On the other end, now to use that info, you would listen(mqtt in) to the same topic