Need help with code to work on an ESP8266 to control 4 relays that can be taugled by 4 switches.
I have used MQTT to switch 4 relays connected to ESP8266.
Need help to taugle the relay state with 4 switches connected to 4 GPIO ports of the ESP.
I have worked on ESP and WeMo emulator to connect with Alexa in my previous project.
I used a IF loop her to taugle it on the ESP.
Regards,
Abhay
I have used ESPEasy (letscontrolit.com) flash firmware to do what you are trying to achieve.
I purchased NodeMCUs for my switch ESP and then got some of these for the Relay ESPs Link Sprite LinkNode R4 / R8
Ive never had an issues with them, and it simplifies triggering 5/12v relays. They were available on Amazon UK, but Amazon pulled the plug on their store for some reason, however you can buy direct from them, expect longer delivery times.
I can’t speak to ESPEasy, but another option is Tasmota’s firmware, which I really like. MQTT and a handy Web interface where you can control and even define the module type easily (it supports the 4 channel models)… even OTA updates that I’ve tested successfully twice now.