Hi, is a a way to monitor the status of the TV via CEC? My kind of elderly parents keep forgetting to stop the TV stream from tvheadend when they switch off their TV. This increases power consumption, but especially, they keep blocking a tuner on the TV server.
Right now, I am monitoring the TV status through the power on USB port of the TV. it is connected to a RPi GPIO via an optocoupler. When the TV switches off, I send a stop command to Kodi with a python script.
In the next upgrade, I want to use to the Vero 4, so I don’t have GPIOs available anymore. An external hardware solution would be an Arduino Pro Mini, which can send the stop key to the Vero via USB. But in general, this should not neeed any external hardware, only CEC.
What would be the most elegant way to deal with this? Do I have to poll the TV with the cec-client, or is there a logfile I can monitor or even a hook?
Thanks. On my RPi3 I do have this option (but my projector doesn’t react on it.) On my Vero 4k, There is only Ignore/Switch off/Standby, but no Stop. Stop is only featured in the selection for what to do when the source is changed.
I have to add that I have trouble with CEC anyway. It is a Medion P18088 that I got for really cheap. Despite the fact that I activated HDMI-CEC in the options, the Vero does not show up in the device list and I cannot use the TV remote for controls. ‘echo “standby 0” | cec-client -s -d 1’ does not result in anything.
The Vero CEC worked on my projector.
Since the background illumination is really bad, I am seriously thinking about sending the TV back.
Vero is up to date, but changing the HDMI cable from the one shipped with the Vero made controlling the TV via the remote working. However, the menu options did not change, not even after a reboot.
The option to send the TV to standby when the screensaver is activated also has no effect.
Unfortunately, I found that the picture quality is terrible (foggy scenes look like watched trough a veil, due to terrible background illumination and a few other issues), so I am going to return the TV. If the options in the CEC menu are somehow defined by the TV, I’ll be back in two weeks if it doesn’t work with the next one
Though a working “Stop playing on TV off” would be sufficient for my current needs, I would still be interested in programmatic way.
Ok, reporting back with a new TV (Hisense). Everything regarding CEC works now, I can switch it on and off via commandline CEC client and all that sort of jazz. I am in general much happier with it.
The option for actions to be performed when the TV is switched off are unchanged, though.I cannot make it send a stop command, which is a real bugger because if the TV stays on on the Vero, it blocks a tuner und the tvheadend server.
No, this is not about the TV remote.
Right now, the CEC options in Kodi seem to offer me to suspend or shut down the Vero when the TV is switched off (highlighted menu option in the screenshot above). Neither seems to make much sense vor the Vero, because as far as I understood, the S905 does not have a real shutdown state.
Instead, I just want to stop the current playback when the TV is switched off. (Else, the TV program will keep running on the Vero and block a tuner.) /sys/class/amhdmitx/amhdmitx0/hpd_state is always 1, regardless if the TV is switched off or on, even when I do it via echo "standby 0" | cec-client -s -d 1
Just to give you some background about this. Vero could be put in to suspend mode, and we could use the scp_task firmware to listen for wakeup events via CEC and even IR, but this wouldn’t be possible for USB events (RF remote), so we don’t bother implementing this at this time.
Are you turning the TV off or standbying it?
I just double checked to be sure, and hpd is now always unmuxed on power loss or unplug because some people had ‘No Signal’ issues on Vero 2 with some TVs.
Sorry, should have been more accurate. I am mainly talking about sending the TV to standby, i.e., pressing the red button on the remote. When I do that, I do not want a TV program to keep running, since it would unnecessarily block a tuner un the TV server that could be used e.g. for recording.
I know HOW to stop the player. I have implemented that myself in the USB monitoring script via GPIO mentioned in the first post, and I could take it from the ping workaround mentioned above. What I need to know is WHEN to stop the playback. Randomly letting my TV run until late at night and then switching off with a cronjob while watching a movie is by no means an appropriate solution.
Before I give in to that, I’ll rather solder a USB cable to an Arduino Pro Mini, which could issue an ‘s’ keypress when the voltage on the USB port goes away. But all of that is quite a ridiculous solution given that the Vero COULD know perfectly well if the TV is running or not.