With this Integration you can control a cec device (like a tv), that is not directly connected to your server with a raspberry, that acts as a cec "proxy"
- Raspberry Pi 2 (not tested)
- Raspberry Pi 3
- Raspberry Pi 4 (not tested)
- Raspberry Pi Zero
- probably many more
- Raspberry Pi OS
- every Debian based Distribution (not tested)
- Connect via SSH or open a Terminal
- Run:
$ cd /
$ sudo git clone https://github.com/JonathanTreffler/Home-Assistant-remote-cec.git
$ cd Home-Assistant-remote-cec
$ sudo chmod +x ./install.sh
$ sudo ./install.sh
- Connect the Raspberry Pi to your cec compatible device via HDMI
- Assign a static local IP Adress to your Raspberry (in most cases via the web interface of your router)
- Run:
sudo service HomeAssistantRemoteCEC start
The server will get started automatically after a reboot
You can test if the server is started by running:
sudo netstat -tulpn | grep 8080
You can see the logs by running:
sudo systemctl status HomeAssistantRemoteCEC
Add the following to your HomeAssistant configuration.yaml and customize it to fit your setup:
rest_command:
device_on:
url: 'http://IP:8080/poweron'
device_off:
url: 'http://IP:8080/shutdown'
- If nothing happens if you try to send a command:
- Make sure the server is running
- Make sure the server uses the right cecDeviceId (can be changed in the app.js file)(the cecDeviceId is in most cases 0)
- Try a different HDMI Cable, not all cables or adapters (needed for the Pi Zero) are compatible with CEC
- The server doesn't start because something else is running on port 8080:
- You can change the port of the web server in the app.js file (remember to also update the home assistant configuration)
Many brands call CEC differently, but they should all be compatible:
- T-Link (ITT)
- EasyLink (Philips)
- EZ-Sync (JVC)
- Simplink (LG)
- Digital Link HD (Loewe)
- NetCommand for HDMI (Mitsubishi)
- RIHD (Remote Interactivity over HDMI) (Onkyo)
- Viera Link (Panasonic)
- Kuro Link (Pioneer)
- Anynet+ (Samsung)
- Aquos Link (Sharp)
- BRAVIA Sync (Sony)
- Regza-Link (Toshiba)
- TechniLink (Technisat)
- CSTLink (Coolstream)
- FUN-Link (Funai Electric)
- Digi-Link (Grundig)
The raspberry communicates with a cec compatible device like a TV or DVD Player over HDMI.
All Devices in this CEC "network" can communicate even if they are not directly connected via HDMI (e.g Raspberry sends a signal to the TV via HDMI, wich forwards it to the DVD Player).
For more information just read the wikipedia article :)