I am getting desperate! I cannot get to grips with creating a countdown template and to retain my sanity I really need some help. Scenario: I have a sensor in my fridge that reports it’s temperature to my HA. If the temp gets above 12°c an automation sends a notification to my iPhone. No problems with that! However I don’t want to receive messages between 23:00 and 08:00, however I would like any incidents where the temp is more than above 12°c to be reported at 08:00 in the morning. So I created three helpers, one to record the temperature at the time it is reported and another helper to record the time of the incident and the third one to countdown the delay until 08:00 in the morning and allow the notification to be sent. HELP PLEASE!
alias: Test for Fridge notification
description: ""
triggers:
- type: temperature
device_id: f4c19433741d0d6e93610336a0bc0752
entity_id: ab6f3e3c084577c84dc5fd79cfd0e4ec
domain: sensor
trigger: device
above: 12
for:
hours: 0
minutes: 15
seconds: 0
conditions: []
actions:
- choose:
- conditions:
- condition: time
after: "08:00:00"
before: "23:00:00"
sequence:
- action: notify.mobile_app_peter_iphone_11
metadata: {}
data:
message: >-
Temperaturen i fridge is: {{
states('sensor.esphome_web_e06909_kylen') }} °c
title: WARNING FRIDGE KITCHEN
data:
push:
sound:
name: News_Flash.caf
critical: 1
volume: 0.75
- conditions:
- condition: time
after: "23:00:00"
before: "08:00:00"
sequence:
- action: input_number.set_value
metadata: {}
data:
value:
{{states('sensor.esphome_web_e06909_kylen') }}
target:
entity_id: input_number.kylskapet_koket_temp
- action: input_datetime.set_datetime
metadata: {}
data:
datetime: as_timestamp(now())
target:
entity_id: input_datetime.koket_kylskap_event_happened
## This next section should be controlled by a countdown timer or equivilent...##
## and should definethe time between the event happening and 08:00 hrs ##
- delay:
hours: 6
minutes: 0
seconds: 0
milliseconds: 0
## End of that section ##
- action: notify.mobile_app_peter_iphone_11
metadata: {}
data:
message: >-
Thr temperatur of the fridge at {{
states('input_datetime.koket_kylskap_event_happened') }} was {{
states('input_number.kylskapet_koket_temp') }} °C
title: WARNING FRIDGE KITCHEN
data:
push:
sound:
name: News_Flash.caf
critical: 1
volume: 0.75
mode: single
Hope someone will help me out.