Switch commands to ESPEasy via MQTT
Posted: Thursday 21 October 2021 16:13
Hi all,
I am using Domoticz 2021.1 on raspberry pi 3B+ for controlling a heat pump and floor heating among other things. I have several distributed ESP32 with ESPEasy installed, and failing to figure out how to control switches in ESPEasy via MQTT, I ended up using http commands to gpio ports. They have been relatively reliable, but have recently been very unstable. Timers not working, and manual switching ends up with Domoticz switching them back.
Since I already use Mosquitto installed locally as an MQTT broker, I want to try the MQTT way to control switches in ESPEasy.
However, I still can't find out how I do that the easiest way. ESPEasy has a Domoticz MQTT controller (helper) and can subscribe to domoticz/out and publish to domoticz/in. With a virtual on/off switch in Domoticz, how do I actually publish the on/off events to MQTT? Do I need a dzvents script or shell script and send commands with mosquitto_pub, or is there a more "embedded" way?
I am using Domoticz 2021.1 on raspberry pi 3B+ for controlling a heat pump and floor heating among other things. I have several distributed ESP32 with ESPEasy installed, and failing to figure out how to control switches in ESPEasy via MQTT, I ended up using http commands to gpio ports. They have been relatively reliable, but have recently been very unstable. Timers not working, and manual switching ends up with Domoticz switching them back.
Since I already use Mosquitto installed locally as an MQTT broker, I want to try the MQTT way to control switches in ESPEasy.
However, I still can't find out how I do that the easiest way. ESPEasy has a Domoticz MQTT controller (helper) and can subscribe to domoticz/out and publish to domoticz/in. With a virtual on/off switch in Domoticz, how do I actually publish the on/off events to MQTT? Do I need a dzvents script or shell script and send commands with mosquitto_pub, or is there a more "embedded" way?