Hi,
I’m new to HA and newer on template which are extremly power full!
I’ve figured out how to get notify with this code :
alias: Avertissement Dégivrage
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.temp
below: 0
for:
hours: 2
minutes: 0
seconds: 0
condition:
- condition: template
value_template: "value_template: '{{ now().hour == 23 or now().hour < 7 }}'"
enabled: true
action:
- wait_for_trigger:
- platform: time
at: "07:00:00"
continue_on_timeout: false
- service: notify.mobile_app_pixel_6a
data:
message: "Température extérieure basse, dégivre la voiture ! "
mode: single
max_exceeded: silent
The only problem is if the temperature goes below 0 before 23h, I won’t get notified.
Is there a way to add a “for” argument to a template?
- condition: template
value_template: “value_template: ‘{{ states(‘sensor.temp’) < 0 | duration > 2 hours }}’”
I’d love to go to this code adapted to add a notion of delay :
alias: Dégivrage v2
description: ""
trigger:
- platform: state
entity_id:
- sensor.temp
condition:
- condition: template
value_template: "value_template: '{{ now().hour == 23 or now().hour < 7 }}'"
enabled: true
- condition: template
value_template: "value_template: '{{ states('sensor.temp') < 0 }}'"
action:
- wait_for_trigger:
- platform: time
at: "07:00:00"
- service: notify.mobile_app_pixel_6a
data:
message: "Température extérieure basse, dégivre la voiture ! "
mode: single
max_exceeded: silent