
I recently set up my Odido TV box with Home Assistant to control it via a dashboard. Here’s how I did it using the Universal Remote Card, ADB, and some custom buttons. This guide assumes you have a bit of Home Assistant experience.
Prerequisites:
- Working Home Assistant
- Working HACS
- Installed
Universal Remote Card
integration through HACS - ADB installed and configured on your Odido box (ADB =(Android Debug Bridge) lets Home Assistant send low-level commands to Android-based devices)
Let’s start with the full reference config I have now:
type: custom:universal-remote-card
rows:
- - power
- info
- npostart
- youtube
- spotify
- - circlepad
- slider
- - null
- back
- home
- tv
- null
- - null
- rewind
- play_pause
- fast_forward
- null
- - n1
- n2
- n3
- null
- zap_up
- - n4
- n5
- n6
- null
- null
- - n7
- n8
- n9
- null
- zap_down
- - null
- n0
- null
- null
- null
platform: Android TV
custom_actions:
- type: button
name: zap_up
icon: mdi:arrow-up-bold-circle
tap_action:
action: perform-action
perform_action: androidtv.adb_command
target:
device_id: 6aea6b9b559fc91ceae361215b4f6854
data:
command: input keyevent 92
- type: button
name: zap_down
icon: mdi:arrow-down-bold-circle
tap_action:
action: perform-action
perform_action: androidtv.adb_command
target:
device_id: 6aea6b9b559fc91ceae361215b4f6854
data:
command: input keyevent 93
- type: slider
name: slider
range:
- 0
- 0.25
step: 0.01
value_attribute: volume_level
tap_action:
action: perform-action
perform_action: media_player.volume_set
target:
device_id: 46f1c32aa4e4d912286bb15f49aaa54a
data:
volume_level: "{{ value | float }}"
vertical: true
entity_id: media_player.bose_soundbar_700_3
icon: mdi:volume-high
label: "{{ (value * 100 ) | int }}%"
remote_id: remote.odidotv
media_player_id: media_player.android_tv_192_168_1_167
autofill_entity_id: true
styles: |2-
#circlepad {
width: 250px;
}
remote-button {
background: var(--lovelace-background, var(--primary-background-color, #6f767d));;
padding: 8px;
margin: 4px;
border-radius: 24px;
--size: 24px;
}
Points of interest here:
- Non-functional buttons at this time:
TV
– Doesn’t do anything- Info – Doesn’t do anything
- Missing buttons from actual remote:
- Radio – Don’t need this – don’t know how to get it to work either
- TV Guide – TODO
- REC button – I don’t pay for recording, so not using
- Source button – Don’t need it (yet)
- Apps button – TODO
The hardest part was getting the zap (channel up/down) buttons to work. To get this to work I needed to first get adb setup. Then it turns out there are no key commands for incrementing/decrementing the channel. After some experiments, the page up
and page down
keys control this, so mapped those with custom new buttons (zap_up
and zap_down
). The device ID can be found in the developer tools with view yaml after doing Actions
-> ADB command
-> Pick a target -> GO TO YAML MODE
. There’s probably a quicker way to do this.
The volume controls are custom. I have a bose soundbar 700 and I want to control its volume instead. Since the default volume range is way too wide, I constrained it to 0-25%.
The circlepad styling is some attempt to make it a bit smaller.
Note that the numpad doesn’t come with 0
out of the box, so I configured it explicitly with 10 buttons.