oooooooooooooo
I just tried out the mqtt switch…love it! I only tried it with code debug messages, but ill give it a try tomorrow with the live components.
oooooooooooooo
I just tried out the mqtt switch…love it! I only tried it with code debug messages, but ill give it a try tomorrow with the live components.
yes.
unless the state gets changed by another method. For example by another device publishing a different command to the command topic. Then the switch won’t follow the actual state. For that you need to include a “state_topic”.
See here for info:
I see. I’ll have to look into it because the same relays are toggles by su automation (python script) that already existed on the rpi3, before ha, that toggled the relays at sunset and sundown, although I’m thinking of replacing that one with one from ha as well. But there is also the rpi3 touch screen that has a gui window with buttons on it for that purpose, which again could get replaced with an ha dashboard. And then I did also plan on working on a mobile app to toggle those same relays from the app, but that can Alo be replaced by ha.
OK, I guess I’m done!
If the toggles aren’t simply a switch to indicate a desire for a specific behavior, but is actually controlling a device… then you’ll want to have that device communicate with MQTT to indicate its own state and then you’d want to add a “state_topic” to the MQTT Switch configuration above. As it is now, it’s assumed to be purely logical and, therefore, anything using MQTT to ask for it to be in a certain state also indicates that it is in fact IN that state.