I know this is possible but I’m missing something and can’t get it right so any help would be appreciated.
I have 4 door and window sensors set up as binary sensors on an ESP32. I want to turn a local LED, configured as a light, on when one or more of the door or windows are open - and turn it off when they are all closed.
Has anyone got a code snippet they can share please before I tear out what’s left of my hair?
Thanks, I have that.I also realise that I didn’t express myself well in my frustration!
My query was more about the approach. Is it better to use on_loop and check every cycle, or to monitor for status changes and then set the LED on or off? Is one better than the other and, if so, why?