When building a dashboard using a Raspberry Pi, I wanted a way to schedule the tv to turn on/off automatically. Below are the steps using Consumer Electronics Control (CEC).
- sudo apt-get install cec-utils
Once everything is installed you should be able to control the tv using the command below:
Turn tv on: echo on 0 | cec-client -s -d 1
Turn tv off: echo standby 0 | cec-client -s -d 1
Tv status: echo pow 0 | cec-client -s -d 1
- Make sure your tv supports cec and that it is enabled. Tv manufactures call CEC by different names so you may have to do some research depending on your brand.
- Make sure you are using a new hdmi cable that is at least HDMI 1.2a
Different names for HDMI CEC
- Samsung – Anynet+
- Sony – BRAVIA Link or BRAVIA Sync
- Sharp – Aquos Link
- Hitachi – HDMI-CEC
- AOC – E-link
- Pioneer – Kuro Link
- Toshiba – Regza Link or CE-Link
- Onkyo – RIHD (Remote Interactive over HDMI)
- LG – SimpLink
- Panasonic – VIERA Link or HDAVI Control or EZ-Sync
- Philips – EasyLink
- Mitsubishi – NetCommand for HDMI
- Runco International – RuncoLink
Also published on Medium.