Hi all. I’m using a timer to turn off the TV after 1 hour has passed (only before 18:00) so that my kid is not watching TV all day… My automation already works fine…
I’m now trying to write another automation that gives a warning 1 minute before the TV is switched off but I’m struggling with the correct templating for the automation trigger condition - the code below does NOT trigger at any time (the action part works well in other automations, it’s only the correct trigger I’m after).
Does anyone have any ideas?
The timer is called timer.tvwatch
alias: Announcement TV Timer nur mehr 1 min
description: ''
trigger:
- platform: template
value_template: "{{ states('timer.tvwatch') == '00:01:00'}}"
condition: null
action:
- data:
entity_id: all
service: sonos.snapshot
- service: media_player.volume_set
data:
volume_level: 0.27
target:
device_id: 1d1dcad03428d796f08ded67d4f5fe47
- service: tts.google_translate_say
data:
entity_id: media_player.sonos
message: >-
Der Fernseher war jetzt schon sehr lange eingeschaltet. In 1 Minute wird
automatisch ausgeschaltet.
- wait_template: ''
timeout: '00:00:10'
continue_on_timeout: true
- data:
entity_id: media_player.sonos
service: sonos.restore
mode: single