Hello, I have Domoticz set up with MQTT (Mosquitto) and I added simple switch. When I turn it on using /control?cmd=GPIO,5,1, I see it goes on in Domoticz. However when I turn it then off in Domoticz, I see the message in domoticz/out with correct idx and nvalue, but ESP seems to be ignoring that message doing nothing to the GPIO.
The switch is set as:
I tried setting up the Output - (Domoticz MQTT helper), just trying blind luck:
But that didn't help.
Is there a way to react on messages from Domoticz? Or do I have to use the HTTP action on ON/Off?
Reacting on MQTT message from Domoticz
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 103
- Joined: 16 Sep 2015, 20:32
Re: Reacting on MQTT message from Domoticz
For simple on/off that's the most easy thing to do.Is there a way to react on messages from Domoticz? Or do I have to use the HTTP action on ON/Off?
Re: Reacting on MQTT message from Domoticz
But do I have to? Or is there an other way?NietGiftig wrote: For simple on/off that's the most easy thing to do.
Re: Reacting on MQTT message from Domoticz
It's the length of the Domoticz MQTT message. In my own branch I'm using PlatformIO to build ESPEasy, so that I can have global #define's in the ini file.
With Arduino IDE, you need to hardcode longer MQTT buffer support into pubsubclient and Controller.ino.
With Arduino IDE, you need to hardcode longer MQTT buffer support into pubsubclient and Controller.ino.
Re: Reacting on MQTT message from Domoticz
Ahh, thanks. Good to know.ToniA wrote:It's the length of the Domoticz MQTT message.
I also found there's a chance of infinite loop, if two messages are published quickly after each other before Domoticz processes these:
- ESP: GPIO,5,1 (sends MQTT payload to Domoticz)
- ESP: GPIO,5,0 (sends MQTT payload to Domoticz)
- Domoticz responds in domoticz/out setting to ON, where ESP picks it up and turns it ON (step 2 turned it off) - so back to step 1.
- Domoticz responds in domoticz/out setting to OFF, where ESP picks it up and turns it OFF (previous step turned it on)
- ...
Who is online
Users browsing this forum: No registered users and 33 guests