Hi Guys,
I’m stuck using the command line switch. command_on and command_off is working fine. Command_state doesn’t work. (works fine in the terminal btw)
I think it might have something to do with permissions of the homeassistant user? I’ve searched the forum and tried this:
sudo su -s /bin/bash homeassistant
when I run: echo “pow 0” | cec-client -s -d 1 | grep “power status: on” > nul && (echo “true”) || (echo “false”) I get:
bash: nul: Permission denied
false
and now I’m stuck… and looking for someone to get me back on track
switch:
platform: command_line
switches:
tv_woonkamer:
command_on: 'echo "on 0" | cec-client -s -d 1'
command_off: 'echo "standby 0" | cec-client -s -d 1'
command_state: 'echo "pow 0" | cec-client -s -d 1 | grep "power status: on" > nul && (echo "true") || (echo "false")'
value_template: '{{ value }}'
friendly_name: TV Woonkamer