Home Assistant - Channels - Turn on and set channel

Hello,

I thought I'd share my simple home assistant automation. This turns on an apple tv at 7am, launches the getchannels app, sets the channel to 101, then sets the volume of the AVR.

I hope this helps people googling around, like I was.

alias: Morning TV
description: ""
trigger:
  - platform: time
    at: "07:00:00"
condition: []
action:
  - service: media_player.turn_on
    target:
      device_id: 6a0df54ca05c7210b6ce26ef749eee73
    data: {}
  - service: media_player.play_media
    target:
      entity_id: media_player.kitchen
    data:
      media_content_id: com.getchannels.dvr
      media_content_type: app
    metadata:
      title: Channels
      thumbnail: null
      media_class: app
      children_media_class: null
      navigateIds:
        - {}
        - media_content_type: apps
          media_content_id: apps
  - delay:
      hours: 0
      minutes: 0
      seconds: 10
      milliseconds: 0
  - service: media_player.volume_set
    data:
      volume_level: 0.35
    target:
      entity_id: media_player.avr_kitchen
  - service: media_player.play_media
    target:
      entity_id: media_player.kitchen_channels
    data:
      media_content_id: "101"
      media_content_type: channel
mode: single

6 Likes

Nicely done!

I could never think of a good use case for automating Channels tasks with Home Assistant and this one is a good one.

Thank you for sharing! :smiley:

Thank you for the kind message mjitkop.

1 Like

Just a heads up, as of version 5.9.1 launched last weekend, you can use Deep Links to do the same things, except the app will be launched for you. This means you can remove the app launch and wait steps from the script.

service: media_player.play_media
target:
  entity_id: media_player.desk_apple_tv
data:
  media_content_type: url
  media_content_id: channels://open/collection/46

Docs:

3 Likes

Will this ever be possible on android TV?

2 Likes

Can we look at this again please @maddox ? I understand that development on this app is predominantly Apple TV for new features and not AndroidTV but as someone who has successfully got deep linking working on Spotify, Apple TV, Netflix and the potential of others, it would be a great addition to have it working on channels as it would help my home assistant automations.

Thank you in advance