I have an Raspberry pi running Hassio and MQTT on the Pi
I did Build an arduino to publish data to Hassio that is working fine, but for some reason i cannot publish a payload on and off to the arduino i did try the local mqtt publish service on the Developer tab and that works fine but the normal toggle switch that i have made is not working at all i also have mqtt lens running and i cant see the msg coming into the mqtt broker so i know the problem is not the arduino, is the way i send the toggle on and off not correct?
I have Sensor config in my configuration.yaml file that connects to the broker and that is also reading data like it should
i dont know if it has something todo with the one mqtt publish button that i created it works in my script.yaml file it triggers a payload and then triggers it back but that is a custom script button that i created to do that for a flip on flip off instant switch that i tested and that also works
I restarted Home Assistant and ‘Test Switch’ appeared in the Lovelace UI. I turned the switch on then off.
Using MQTT Explorer, I confirmed it published zone1on and zone1off to the topic zone1.
So the MQTT Switch configuration is functional.
That’s why I asked you to test if Home Assistant was connected to the MQTT Broker. You reported it is connected, yet your MQTT Switch fails to publish to its topic.
The results don’t add up:
You can publish from Home Assistant’s MQTT page.
The MQTT Switch’s configuration is functional.
The MQTT Switch fails to publish to its command_topic.