Hello everyone,
I bought a multicolor zigbee lamp and I’ve already set it to display a specific color for each alert:
- Blue when the basement door is opened for more than 3 minutes. keep the color until the basement door is closed.
- Red if a camera sees something moving in my yard. keep the color for 10 minutes.
- Yellow if someone rings at my front door. keep the color until the front door is opened.
- …
Each of these alerts works fine with simple automations. But I get some logical problems when multiple alerts overlap each other. example :
step 1: the basement door is opened for 3 minutes -> the lamp is set to blue
step 2: 1 minute after, someone rings at my door -> the lamp is set to yellow
step 3: I open my front door to greet the guest -> the lamp is deactivated. But I would like the lamp to come back to blue as the basement door hasn’t yet been closed.
to solve this, I was thinking of maintaining a list of active alerts:
- each new alert would add a new item to the alerts list
- each alert cancelation would remove the corresponding item in the alert list
- a new script would set the correct color depending on the items in the alert list. This script would be called every time an alert/cancellation is done.
But that’s theory. How can I achieve it in Home Assistant ? Can it be done with a mix of automation/scripts ? Or do I have to make something in python ? Or is something similar already existing ?
Thanks in advance,