… or it does have status off
after the automation has run.
The device is still on, showing a freezed image on the TV set like it´s been
paused
.I was expecting Apple TV to be turned off, completely.
BTW: The Apple TV is the only input for my TV. All TV channels are streamed though the ATV.
This is what I want:
- Recognize when Apple TV is playing between 08:00 - 18:00 week days.
- Notify (my kids) that this is not allowed (via
tts.google_say)
- Set the volume on SONOS Beam (mounted below the TV set)
- Play the
tts.google.say
message stating “Watcing TV is not allowed now” - Turn off TV set - this is normally triggered when hybernating the Apple TV from the remote.
Here is the entire automation:
- alias: 'Not allowed to watch TV now'
trigger:
platform: state
entity_id: media_player.atv_stua_1_etg
to: 'playing'
condition:
condition: and
conditions:
- condition: time
after: '08:00:00'
before: '18:00:00'
weekday:
- mon
- tue
- wed
- thu
- fri
- condition: template
value_template: "{{ states.media_player.atv_stua_1_etg.state == 'playing' }}"
action:
- service: media_player.turn_on
entity_id: media_player.atv_stua_1_etg
- service: media_player.volume_set
data:
entity_id: media_player.sonos_beam_stue_1etg
volume_level: 0.4
- service: tts.google_say
entity_id: media_player.sonos_beam_stue_1etg
data_template:
message: 'Det er ikke lov å se på TV nå.'
cache: false
- service: media_player.turn_off
entity_id: media_player.atv_stua_1_etg