NOWTV Channel Launcher

There was a big thread of google TV deep links elsewhere in the fourms and there where a few people asking about NOWTV. After fiddling a bit and doing some remote debugging with my phone i finally managed to work out NOW’s deeplink format. And made a script to launch the channels on google tv devices.

Currently it only supports the sports channels(as that is the only package i have access to) but its pretty easy to extend, the best way i have found to get the channel numbers(3835 for f1) is to go to live tv page in a web browser on a computer and look for the last bit of the url. For example here is the Sky Sports F1 URL https://www.nowtv.com/watch/playback/live/3835.

Then you just add a item to the dictionary in the variables step and the name you used in the dictionary to the channel_name field filter

The Script
sequence:
  - variables:
      channel: |
        {% set sky_channels = {
            "f1":3835, 
            "mix":4090,
            "main":4002,
            "prem":4010,
            "football":3939,
            "cricket":4081,
            "golf":4026,
            "tennis":1284,
            "plus":3940}
          %}
        {{sky_channels[channel_name]}}
  - if:
      - condition: template
        value_template: "{{ not states(media_player_i)|bool }}"
    then:
      - action: media_player.turn_on
        metadata: {}
        data: {}
        target:
          entity_id: "{{media_player_i}}"
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
          milliseconds: 0
  - action: media_player.play_media
    data:
      media_content_type: url
      media_content_id: >-
        https://www.nowtv.com/deeplink?deeplinkData={"serviceKey":"{{channel}}","type":"LINEAR_CHANNEL","action":"PLAY"}
    target:
      entity_id: "{{ media_player_i }}"
fields:
  channel_name:
    selector:
      select:
        options:
          - f1
          - prem
          - mix
          - main
          - football
          - cricket
          - golf
          - tennis
          - plus
    name: channel_name
    required: true
  media_player_i:
    selector:
      entity:
        filter:
          - integration: androidtv_remote
            domain: media_player
    name: media player
    required: true
alias: Open Now TV Channel
description: ""

This is really helpful thanks! I don’t have windows or a Mac so I can’t get the other channel numbers for entertainment or movies. However I just had a great idea to use this same template and use if for other deeplinks that work on android TV such as Spotify.

You could stack up a few playlists. Plex would be another good option cos it also has live TV channels. I currently use a grid card with my channels DVR to switch easily by just clicking the channel icon of my favourites.

The problem I have is that the automation is a lot of repetitive code where as this uses variables and is slot cleaner. If I could figure a way to use variables with a grid card and icons I would be chuffed.