From f9094e57d4c661ab7e79930ba7d165ac4ae135df Mon Sep 17 00:00:00 2001 From: ccostan Date: Sun, 7 Jun 2020 14:07:19 -0400 Subject: [PATCH] Added in a condition to make sure Rainy Day Automation doesn't trigger more than ~3 hours at a time. #95 --- config/automation/dark_rainy_day.yaml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/automation/dark_rainy_day.yaml b/config/automation/dark_rainy_day.yaml index 657cb5d2..4ee45af9 100755 --- a/config/automation/dark_rainy_day.yaml +++ b/config/automation/dark_rainy_day.yaml @@ -45,6 +45,13 @@ - condition: state entity_id: group.family state: 'home' + - condition: template # Only run once every ~3 hours tops. + value_template: > + {%- if states.automation.dark_house_little_extra_light.attributes.last_triggered -%} + {{ (as_timestamp(now()) - as_timestamp(states.automation.dark_house_little_extra_light.attributes.last_triggered)) > 10000 }} + {%- else -%} + true + {%- endif -%} action: - service: light.turn_on