Detect TV off?
#1
Hi,
I have 2x RPI's at present. 1 is a NAS PI running all my media harddrives. 2 is XBMC PI running XBMC and HDMI'd to my TV.
Both Pi's need to be running all the time.

This is because I want the NAS pi to tell the XBMC pi to update library everyday at a certain time etc etc
& I don't like waiting for it to boot up when TV turned on.

I can easily listen to JSON notifications on the NAS pi to detect what the XBMC pi is doing and can also make calls to it using JSON
(so I can force update then wait for update complete notification - the turn off harddrives)

However, I want to detect when the TV is turned off, so I can power down harddrives immediateley.
They are in my room and if I turn off the TV - usually means sleep time.

I can not figure out how to catch the TV off command.
If I set LIBCEC to shutdown, I get a notifcation at the other pi. But the XBMC pi shutdowns and needs power down/on to get XBMC back.
In RASPBMC there is no standby - so this LIBCEC command does nothing and can not be caught.

Appears LIBCEC does not send out any JSON notifications or anything... Even if I could change what LIBCEC does when TV off to "Exit XBMC" or "Restart XBMC"
I could catch this then...

Any ideas how to tell if my TV has been turned off? Even if it has to be a service on the XBMC Pi that then sends a notifciation to the 2nd Pi.
Reply
#2
I'd imagine you could monitor the hdmi port on the Xbmc pi save and call the nas when it goes down. If not the hdmi port, find some other or on your tv that loses power when the tv is off and connect a gpio pin to it and monitor that.

If that's too complex, check hackerspaces.org and find the closest one to you. They'll be foaming at the mouth to help
Reply
#3
I may just put a request into the Pulse Eight guys.
So, there LIBCEC sends a JSON notifcation on events.

Or, even add a few more options to the "Do this when TV off" function.
Eg: Send a sleep-on-lan command
Reply

Logout Mark Read Team Forum Stats Members Help
Detect TV off?0