Rasser
(Rasmus Holt)
October 2, 2023, 8:26pm
1
Hi Forum,
Possibly a simple question, but I want an automation where the condition should be that if a sensor has been on during the last X minutes it should be true, else false. How do I write a condition for that?
I don’t think that a “For” will be the solution since it has to see over a whole period whether it has been switched on at some point.
Cheer, Rasmus
The for
criteria means “Has the entity’s state been ‘on’ continuously over the last X minutes”.
If you want your condition to be “Has the entity’s state been ‘on’ at any time in the last X minutes” that will require other approaches.
Is the automation triggered by the same sensor you want the condition based on?
Is there more than one trigger for the automation?
I saw a few similar questions posted here, but the answer seem to direct to the for: directive. Here is what I’m trying to achieve. I have an automation based on my Unifi G4 Pro doorbell. If the doorbell detects a person, it sends a picture to my phone, sends a picture to the tv and plays an alert on the Google home. This works well, but it also alerts if I walk out the front door. I’d like to prevent that. What I was thinking was if the front door had been unlocked within the last X seconds, th…
Basically, I would like to be able to check if my door has been open any time in the last ‘x’ minutes/hours despite if it is now closed via the UI.