Hey there,
I am just getting started with Home Assistant and tried out things a little bit.
I am Using Mosquitto as my mqtt broker
Added a switch to home assistant and my ESP8266 is working flawlessly.
But now I just dont know what to publish from my ESP to Home assistant that the status of the switch changes on the interface aswell.
Would appreciate any help or a link if that question has been answered already (Didnt find anything using the search)
Got one Esp set up to publish and another one subscribed to that topic
But neihter if i publish to the command_topic, nor when i publish to the state_topic the switch status changes
The Esp subscribed to the topic is indeed showing me, that the messages are published
I am using the PubSubClient library to publish and subscribe to topics on my esps
It shouldn’t matter what you actually publish to the state topic as long as the topic and payload published are the exactly the same as what HA is expecting. They are case sensitive.
on/off, ON/OFF, On/Off, 1/0 should all work as long as you put those in the config in HA