Yoeri
(Yoeri Wysselinck)
July 10, 2018, 12:34am
1
Hi, I can’t seem to get HDMI-CEC working on HA. I’ve got this in my config:
Blockquote
switch:
platform: command_line
switches:
tv_rpi:
command_on: ssh [email protected] “echo ‘on 0’ | cec-client -s”
command_off: ssh [email protected] “echo ‘standby 0’ | cec-client -s”
command_state: ssh [email protected] “echo ‘pow 0’ | cec-client -s |grep ‘power status:’”
value_template: ‘{{ value == “power status: on” }}’
I can see the switch in my frontend but it doesn’t do anything. However, if I give the commands directly in in terminal, it does work.
My HA is installed in venv if that makes any difference.
Anyone any idea on what’s wrong ? Thx
Hellcube
(Artur Rodak)
January 22, 2019, 9:36pm
2
Use the full path to cec client
Check where is your cec-client
$ whereis cec-client
My example:
tv:
command_on: /bin/echo “on 0” | /usr/osmc/bin/cec-client -s
command_off: /bin/echo “standby 0” | /usr/osmc/bin/cec-client -s
friendly_name: My awsome TV
command_state: >-
/bin/echo pow 0 | /usr/osmc/bin/cec-client -s -d 1 | grep -Po ‘power status: \K(.+)’
value_template: >-
{{ value != ‘standby’ }}
I have HAAS installed on my OSMC raspberry pi. Everything works fine but i can’t understand how to run commands outside the virtual environment.
For example to turn my tv on:
echo on 0 | cec-client -s
I get:
bash: cec-client: command not found
A script for rebooting the pi also does not work.
under the root user (osmc) the commands all work as expected.
modder58
(Modder58)
May 4, 2021, 10:13am
3
I have the same problem. How did you fix it?
I think there must be some serious problems with how CEC is working in the current versions of Home Assistant OS. I’ve seen multiple comments about how it doesn’t work anymore.