Now the heart of this question is, as anyone who works with code is duplication is evil.
Assuming I have 3-5 “rooms” with sensors and lights, how to simply substitute the trigger and action?
There must be something, either a script or somehow to reduce duplication, even at the dumbest level an array or dictionary would substitute.
If I’m barking up the wrong tree entirely, then please let me know. This stuff is mainly a mixture of Hue and ESPHome (both for the lights and sensors, though I find the Hue sensors a bit slow and might look to replace them where possible).
Here’s what I’ve been trying out lately. It’s not thoroughly tested, but I think it should work. I will admit, I didn’t come up with this, I’d copied it from somewhere else, but I can’t find the source…
Thank you! That’s kind of what I had in mind, though I couldn’t quite grok the syntax.
I’ll definitely give this a go tonight.
Assuming this works, it elegantly highlights what differs room to room, providing an easy visualisation and change.