I’ve been wanting to get more out of my CCGTV with Home Assistant, so I’ve been playing around with various experiences. I wanted to share some of my ideas that have really been useful for me.
I put together a simple remote with the grid layout to control the device. I originally went with ADB commands, but eventually got tired of the latency and bought a Broadlink RM MINI 4 that is connected up to my LG WebOS TV. From there I used the Broadlink integration in HA to get a more responsive experience.
I also installed https://github.com/leikoilja/ha-google-home and https://github.com/kalkih/mini-media-player. I needed the Google Home integration because for whatever reason (I should try to understand), it was the only way to get some support for media images from apps like HBO Max. The Mini Media player also let me add buttons that I use to quickly jump into preferred shows or TV channels (on YTTV). These buttons are basic ADB commands that are similar to what’s below.
Finally, I installed https://github.com/gadgetchnnel/lovelace-text-input-row to create a card that passes a URL to a script to load the video in the CCGTV app. I also added an automation that lets me share from media apps on my phone to HA which extracts the media url and also passes it to the script. I know I can use the chromecast button to cast most media to the device, but many apps just cast the url and don’t properly open the app on CCGTV. I’m working on supporting more media URLs, but for now it works for HBO Max, Netflix, and Disney Plus.
Here’s the script I’m using.
alias: Share to Living Room TV (CCGTV)
sequence:
- choose:
- conditions:
- condition: template
value_template: >-
{{ states('input_text.living_room_ccgtv_share_url') is
match('http.*play.hbomax.com', ignorecase=False) }}
sequence:
- service: androidtv.adb_command
data:
entity_id: media_player.ccgtv_living_room
command: >-
am start -a android.intent.action.VIEW -d {{
states('input_text.living_room_ccgtv_share_url') }}
- conditions:
- condition: template
value_template: >-
{{ states('input_text.living_room_ccgtv_share_url') is
match('http.*disneyplus.com', ignorecase=False) }}
sequence:
- service: androidtv.adb_command
data:
entity_id: media_player.ccgtv_living_room
command: >-
am start -a android.intent.action.VIEW -d {{
states('input_text.living_room_ccgtv_share_url') }}
- conditions:
- condition: template
value_template: >-
{{ states('input_text.living_room_ccgtv_share_url') is
match('http.*netflix.com', ignorecase=False) }}
sequence:
- service: androidtv.adb_command
data:
entity_id: media_player.ccgtv_living_room
command: >-
am start -n com.netflix.ninja/.MainActivity -a
android.intent.action.VIEW -d netflix://title/{{
states('input_text.living_room_ccgtv_share_url')|regex_findall_index(find='netflix.com(?:.*?)([0-9]+)',
index=0, ignorecase=False) }} -f 0x10000020 -e
"amzn_deeplink_data" "{{
states('input_text.living_room_ccgtv_share_url')|regex_findall_index(find='netflix.com(?:.*?)([0-9]+)',
index=0, ignorecase=False) }}"
default: []
mode: single
icon: mdi:television
Also, here’s the automation to handle mobile app sharing (Android only):
alias: Living Room TV - CCGTV Load URL
description: ''
trigger:
- platform: event
event_type: mobile_app.share
condition: []
action:
- service: input_text.set_value
data:
value: >
{{ trigger.event.data.text|regex_findall_index(find='(http.*)',
ignorecase=TRUE) }}
target:
entity_id: input_text.living_room_ccgtv_share_url
- service: notify.persistent_notification
data:
message: |
{{ states('input_text.living_room_ccgtv_share_url') }}
- service: script.share_to_living_room_tv_ccgtv
mode: single
I’m open to more ideas on how to automate my entertainment.