this post was submitted on 14 Nov 2023
13 points (100.0% liked)

homeassistant

12080 readers
23 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io

founded 1 year ago
MODERATORS
 

I have an automation that turns my driveway lights on when motion is detected. It normally works fairly well but it was windy last night and that caused the automation to trip endlessly as my trees and bushes were whipping around. Lights would come on, shut off 10 minutes later, then turn right back on again. It basically did this all night until I disabled the automation.

I'll do some fine tuning of the motion sensors which will help and I'm considering adding a condition to the automation where it won't trip if the wind speed is above a certain level but how can I add some kind of cool down timer to the automation to prevent it from endlessly engaging?

top 9 comments
sorted by: hot top controversial new old
[–] Bishma@discuss.tchncs.de 8 points 1 year ago* (last edited 1 year ago) (1 children)

There may be a more straight forward way to do it now, but the traditional way is to add a condition to the automation based on the automation's (or maybe the light or motion detector) last_triggered property. You need, AFAIK, to use a template for this.

A condition with something like this should make it so it can't fire more than once every hour (60 seconds times 60 minutes): {{ (as_timestamp(now()) - as_timestamp(state_attr('automation.driveway','last_triggered'))) > 60 * 60 }}

[–] Buelldozer@lemmy.today 2 points 1 year ago

Nice idea! It appears that this can now be done directly in the automation too.

Of course that leads to a problem where it will only trigger once an hour no matter what, which may cause a different frustration.

I'm starting to think that the best answer may be to re-position the motion sensor so that it cannot see my landscaping whipping around in the wind.

[–] DarkFox@pawb.social 5 points 1 year ago (1 children)

You could use mode: single, and then add a 10 minute delay onto the end of the actions.

[–] Buelldozer@lemmy.today 1 points 1 year ago

That's a good suggestion, I'll have to think on that one.

[–] champagne_laugh@lemmy.world 4 points 1 year ago (1 children)

I'm using the timer helper for this sort of thing. You can have a condition in your automation for not triggering if the cool down timer is active.

[–] Buelldozer@lemmy.today 0 points 1 year ago

I didn't know that the timer helper existed, I'll check that out!

[–] thisNotMyName@lemmy.world 3 points 1 year ago

A quick and dirty solution would be using a date input helper, that get's updated with every run and is used in a condition. But there is probably a smarter way

[–] Lifebandit666@feddit.uk 2 points 1 year ago (1 children)

Add a door sensor to your setup? Have it trip, the lights then wait for the door to open and close before it trips again.

I mean let's face it, if someone keeps coming into your garden and doesn't knock on your doorz at nightz you don't want them to be able to see where they're going.

Just a thought.

[–] Buelldozer@lemmy.today 2 points 1 year ago

That's a fair idea and I'll consider it!