Shutdown retropie via CEC when TV goes into standby
-
Hi,
I have set up my RaspberryPi3 with Retropie 4.8 and it's hooked up to an LG TV via HDMI.
Basic CEC communication with the TV worked out of the box such as bowering on the TV when Raspi powers up and swithcing to the correct input.
The LG TV has USB ports that power up when the TV goes from standby to on and they stay on a while when the TV goes to standby and eventually turn off.
What I figured would be nice would be to receive the signal that the TV is going into standby via HDMI-CEC and execute a shutdown command so the system is in a good state when the USB port shuts down after a while.
Is there an easy way available in RetroPie/Emulationstation to mak this work? I could only find information about controlling the TV via CEC but not so much the other way round.
I thought about using cec-client and run a script that "polls" the TV state every 30 seconds and when it finds the TV in standby issue a shutdown command. I feel like there might be a better way to achieve this... Any ideas/pointers?
Cheers!
Lars
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.