Skip to content
This repository has been archived by the owner on May 5, 2024. It is now read-only.
/ youtube-Remote Public archive

This one you can install on HA when you have a RPI running youtube tv interface.

Notifications You must be signed in to change notification settings

bkbartk/youtube-Remote

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 

Repository files navigation

YouTube-Remote-Control

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:

  1. Go to HACS
  2. Click FrontEnd http://homeassistant:8123/hacs/frontend
  3. Click 3 dots in the top right corner and Select "Custom repositories"
  4. Scrol down and Add:
    url: https://github.com/bkbartk/youtube-Remote
    category: Lovelace
  5. 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

About

This one you can install on HA when you have a RPI running youtube tv interface.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published