MQTT Relay with NodeMCU and using the physical light switch

Hi!

I’m trying to control my lights in my apartment with a an NodeMCU and homeassistant. I would also like to still use the old physical light switches which are installed in my apartment.

Does anybody have a sketch to upload? I’m stil a newie into MQTT so it would be great if I could get some help with it.

Here’s an example of how I exactly imagine it (But I don’t want to flash a new firmware I woudl like to still use the Arduino IDE and keep the NodeMCU firmware). I would also like to use 2 relays.


Thank you very much !
Kind regards
Chris

Not sure I understand where you are coming from :-

  1. Does anybody have a sketch to upload? there are lots on the internet :stuck_out_tongue:
  2. Here’s an example of how I exactly imagine it (But I don’t want to flash a new firmware I woudl like to still use the Arduino IDE and keep the NodeMCU firmware) <- conradicts 1)

When you look at the vast amount of different hardware out there at the moment for us to tinker with, you don’t have to stray too far off the beaten track to become a pioneer.

The board you have pictured, does it already contain the nodemcu or is it just a relay board that needs to connect with the nodemcu ?

I achieved the same outcome you’re after ( although controlling one light not two ) using a sonoff basic and ESPEasy firmware.
The switch that used to control the light directly was routed to a GPIO on the sonoff and became an input to it. Some simple rules in ESPEasy and I was away !

1 Like

hi, I am searching the same thing