So I have my cameras sending home assistant webhooks on motion events. I want these to turn on ambient lights when you enter a room under certain conditions. I can't find anywhere how to keep these lights on while someone I am still receiving these webhooks, essentially while someone is in the room. Right now I've tried making a repeat until whith a wait for in it and a webhook inside of that, but it is not blocked by the webhook in any way so it runs indefinitely. Any help is appreciated, thanks.
#Automation to turn lights off when I stop receiving webhooks
1 messages · Page 1 of 1 (latest)
you could restart a timer each time a webhook triggers and turn off the light with a separate automation that triggers on the timer reaching 0
you can create the timer as a helper iirc
so that essentially puts it in the global scope, right?
in programming terms
because yeah i was wondering if i'd have to go out of the scope of the automation
yes, i don't really know the programming side of ha well enough to know if it can somehow be localized to a set of automations. but i have done something similar, just with a pir sensor
one benefit is that the webhook-triggered automation just terminates quickly. it doesn't have to hang around waiting.
what does restore do on a timer?
i don't know. i just start the timer with 10 minutes each time the pir sensor fires
rather than trust the pir sensors "unoccupied" message
with my solution you don't need to move more than once every 10 minutes
instead of the lights going out if you sit still for a minute
How do you actually get the timer finish to trigger an automation?
its very confusing