From version 0.50 MQTT Switch: add availability_topic for online/offline status, but i can not make it work.
I use this configuration for ESP8266 base switch:
make sure your device is sub/pub to the correct topics. Have you checked the logs or subbed to the topic via command line to see if the messages are being sent?
I’m having problem setting up my MQTT Switch. I can see it in HA front end, but it does not execute. I think the problem is with the correct command_topic. Where can I find the correct path?
I had problem with availability too. But I found bug on my side in ESP32 code.
OFFLINE[]=“offlne”
BUGGY: publish(…, OFFLINE, sizeof(OFFLINE), … ) // willl send payload with \0 at the end
OK: publish(…, OFFLINE, sizeof(OFFLINE) -1, … ) // without the \0
I hope it will help somebody, who also will find this topic