Update condition by adding check (#8516)

Adding condition check > 0 to prevent action trigger the next day at 19:00 ("states.sensor.rova_garbage_gft.state" is going negative so value is smaller then 43200).
This commit is contained in:
Sybas 2019-02-12 20:32:48 +01:00 committed by Fabian Affolter
parent f7ccde5337
commit 3546e989e9

View File

@ -91,6 +91,8 @@ automation:
condition:
- condition: template
value_template: "{% if (as_timestamp(states.sensor.rova_garbage_gft.state) - as_timestamp(now())) < 43200 %}true{% endif %}"
- condition: template
value_template: "{% if (as_timestamp(states.sensor.rova_garbage_gft.state) - as_timestamp(now())) > 0 %}true{% endif %}"
action:
- service: NOTIFICATION_SERVICE
data: