Hello,
Is it possible to know with a command line if the TV (connected with HDMI) is ON or OFF? I want to use for bash script.
Kind regards.
Hello,
Is it possible to know with a command line if the TV (connected with HDMI) is ON or OFF? I want to use for bash script.
Kind regards.
Try xrandr command.
cec-client might also give you what you want
echo h | cec-client -s -d 1
for a list of available options
cec-client [ad] {addr} checks whether the specified device is active.
Try xrandr command.
xrandr won't work with Amlogic.
xrandr won't work with Amlogic.
Ups, missed this very important info
I tried for a long time to use CEC to get info from the TV to my Pi (to change inputs and toggle on/off). From what I've read and from what I've seen others with far more knowledge write, the protocol doesn't support it.
So I use a this USB to RS232 dongle, pyserial and a python script to test if my TV is on or off.
Edit: Some TVs also can be controlled via their Ethernet connections. Check your manual/online.
Thanks afl1!
It works, but how could I add in a script?
I want to execute some command if the output is "power status: on" and other if the output is "power status: unknown".
Best regards.