Hi,
I have a Samsung Smart TV in my bedroom which has an energy saving function that turns off the TV after 4 hours. I have to do my best to stay awake for more than an hour, so I’m trying to make an automation to turn off my TV after an hour.
I have a timer helper set to one hour, which starts the moment the TV is turned on and it turns it off when the timer runs out. So the basics are covered, but I’d like to make it more flexible by being able to reset the timer on a button press of the remote. I’ve got it partly covered by this automation:
alias: Timer Reset
description: ""
trigger:
- platform: state
entity_id:
- media_player.samsung_q68ba_43_tv
attribute: volume_level
- platform: state
entity_id:
- media_player.samsung_q68ba_43_tv
attribute: source_list
condition: []
action:
- service: timer.start
target:
entity_id: timer.slaapkamer_tv_timer
data: {}
mode: single
The other buttons I might press are the enter, or channel change buttons, but I cannot for the life of me figure out how to get that into a trigger.
In developer tools I can change the channels by calling this service:
service: media_player.play_media
data:
media_content_type: channel
media_content_id: "1"
target:
entity_id: media_player.samsung_q68ba_43_tv
Any idea how to use that a trigger, changing the TV to any channel and reset my timer?