I’m becoming crazy with that. I have read all subjects I could find here but still no perfect solution for that !! I have some ESPEasy modules all around my flat. I have wired a relay on GPIO 5 of one of them to control my heater, and an other one to control a fan in bathroom !! I can put them on through HA without problems but not off !! When I do Off in web interface of HA, button of HA goes off but relay stays on on ESP !!
Here is code I use: (logic reversed between both due to devices controlled
Well I tried to trigger on and off relays using MQTT Snooper service from my cellphone but not much success Not sure if it’s because it would have a problem on ESP or if I’m doing it in wrong way to send the MQTT message…
It depends on how you have the device setup in ESP Easy. Looks like you don’t have the state topic correct to me. it should be “/espname/devicename/value name 1”. For example, the state topic for the below pic is “/ESP02/Relay_01/RL_01”
Thanks @Paulio for explanations to setup feedback but I don’t get it working (no big deal here !!). I have created the relay device in ESP (till now I had setup nothing as I thought GPIO for relays were working without additional setup:
Ok that looks correct now. Have you enabled MQTT Retain Msg: in the advanced setting, If this is not enabled and you restart home assistant while relay in ON state things will be out of sync and you need to manually send http://sdbipaddress/control?cmd=GPIO,5,0 to get in sync.
Also noticed you are using ESP Easy Mega. I have not tried that. I am using ESPEasy_R147_RC8 and everything working perfect for me so not sure if something different with Mega setup.
Ok cool, I been meaning to try Mega but other version does everything I need so haven’t looked yet. V1 supports 12 devices which is more then I can use with a wemos d1 mini so all good ;).
Cool did that solve your issue or you happy with your workaround?
@Markgo1988 I would prefer to avoid for now as it’s not working well I have an issue of on/off sequence when putting back online the ESP module with relay or rebooting the Home assistant !
Right now I’m cleaning my system by reinstalling completely HA and doing a clean setup (tweaked and played too much with existing system that became too much a mess
Has anyone had the issue with the relays attached to the nodemcu cycling on and then off whenever the nodemcu is booted? Oddly in only occurs with the relay configured as a switch in HASS.io. If it is not configured, the port does not cycle on a reboot. Doesn’t work well for a garage door opener relay. Any thoughts or experience is appreciated. Thanks.
Thanks for this. There is so much out there where the writer assumes you magically know the relationship between the topics specified in configuration.yaml and what is configured in ESPEasy!
The last part of the jigsaw for me was that ESPEasy defaulted the topic names to have no preceeding “/” but all the examples I see have that in the yaml file. Spotted that, removed it and it works!
It’s worth noting that, under Developer, you will have an MQTT heading. If you select that and listen on topic #, you will see all messages being published. That helped me a lot!