YouTube-Remote-Control for HA
This Remote is not done yet
but the remote will work in conjunction with
some youtube box you have created
And is based on
https://github.com/madmicio/LG-WebOS-Remote-Control
All the credits for the design go to: madmicio
installation:
HACS:
- Go to HACS
- Click FrontEnd http://homeassistant:8123/hacs/frontend
- Click 3 dots in the top right corner and Select "Custom repositories"
- Scrol down and Add:
url: https://github.com/bkbartk/youtube-Remote
category: Lovelace - in the dashboard add a Card like the sample below
MANUAL
1. copy: "youtube-remote-control.js" to "~\config\www\community\youtube-Remote\youtube-remote-control.js"
using git or some other method
2. in Ha go to Configuration\Loveace Dashboard\ resources http://homeassistant:8123/config/lovelace/resources
3. click add resource and add: "\hacsfiles\youtube-Remote\youtube-remote-control.js" Javascript Module
4. in the dashboard add a Card like the sample below
Usage Sample:
type: custom:youtube-remote-control
entity: media_player.mediabox
volumeEntity: media_player.living_room_tv
volumeService: webostv
colors:
buttons: var(--deactive-background-button-color)
volume services are separate so you can connect then to your tv. if you don't have a supporting tv you should add dummy values.
in your configuation.yaml add something like this
shell_command:
youtube_key: "ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' <user>@<ip address> 'export DISPLAY=:0 && xdotool key --window \"$(xdotool search --class Chromium1 | head -1)\" {{key}}'"
youtube_off: "ssh -i /config/.ssh/id_rsa -o 'StrictHostKeyChecking=no' <user>@<ip address> 'sudo shutdown -h now'"
where of cours ipaddress and user should be replaces with the user and ip address of the youtube RPI.
And In case you have some kind of shelly Plug S switch or simular and you want a gracefull shutdown, add a script like this
toggle_youtube_gracefully:
alias: Toggle YouTube Gracefully
sequence:
- choose:
- conditions:
- condition: device
type: is_off
device_id: <DeviceId>
entity_id: switch.youtube
domain: switch
sequence:
- type: turn_on
device_id: <DeviceId>
entity_id: switch.youtube
domain: switch
default:
- service: shell_command.youtube_off
- delay:
hours: 0
minutes: 0
seconds: 30
milliseconds: 0
- type: turn_off
device_id: <DeviceId>
entity_id: switch.youtube
domain: switch
mode: single
icon: mdi:youtube