Detecting TV being switched on/off

System: Raspberry Pi 3
OS: 4.4.27-5-osmc #1 SMP PREEMPT Tue Nov 22 02:23:12 UTC 2016 armv7l GNU/Linux
TV connection: HDMI

For many months I have noticed that when I switch on the TV the temperature of my OSMC Pi goes up by about 4 to 5degC. Even when I’m not playing any content. Only when I switch off the TV the temperature gradually lowers back to the idle temperature (in my case approx.: 45degC). To me this suggests that the CPU or the GPU is working harder when the TV is on.

This got me wondering whether it is possible to detect if the TV is switched on or off from a bash or python script?

It should be possible with tvservice.

1 Like