Monitoring TV status?

Ok, I’ve re-read your post. First time i read it I just caught the ‘elderly parents, release tv tuner’ part.

Another idea is a photo resistor with your arduino. When the red-light (standby) comes on the Tv, then stop the Kodi player.

I have implemented a similar solution to detect when my my central heating burner is on :wink:

This may seem to be a silly answer, but does the remote you are using support Macros? If so, just program a macro to send a play stop message to the Vero when the TV power button is pressed :wink:

EDIT:
I tested this with my 4K, and when I turn my TV off, ready changes to 0 and disp_cap is empty, so it looks like a unique problem with your TV. What happens if you pull the power completely to your TV? Have you tried a different HDMI cable?

Na, I don’t want to stick anything to the front of my TV (it doesn’t even have a status light, BTW). Monitoring USB voltage would be fine, but I really resist against butting extra hardware there where everything could be available in software. I know how to solve it in hardware and there isn’t really anything easier than a USB cable and an Arduino, so let’s keep this about finding a sensible solution in software, ok?

No, no macros. I mainly want to use the TV remote via CEC, since right now, that is the only possibility to have just one remote. I am really missing a power button on that OSMC remote. I thought about attaching that IR reveiver to the Vero, but again, then I could better to the Arduino hack.

ready goes to 0 as soon as I pull power form the TV, but not when it is in standby.

Is there any way to get into Kodis CEC connection? Because as I wrote above, the TV reports its status just fine.

I don’t know how the Vero detects TV on/off state, but I’m guessing that it’s looking for voltage on a HDMI pin. If that is the case, then when your TV is in standby, it’s still holding the voltage on that pin, so the Vero can’t tell it’s off. Have you actually measured the voltage on the USB when the TV is in standby? If it’s not deactivating the HDMI, it may not be deactivate the USB either.

Have you tried cec-client -m to monitor CEC traffic (warning, using cec-client can cause loss of CEC to Kodi. The -m option should be safe, but using other options and you may need to reboot the Vero to get CEC back)

Yes, the voltage of the USB port is switched off, justed tested it.
Have to move the testing of the -m switch to tomorrow.

Ok.

I forgot to mention that you could also use jsonrpc to query what’s currently playing. For example, if it’s late at night, and it’s a certain tv channel playing then you can stop that player and release the tv tuner. If it’s anything else (e.g. A movie or a video, etc), then leave it alone. It’s a kindof software watchdog for your tv.

Little update: -m still kills the cec functionality in Kodi. And, again, before I go for a “once a day” solution, I’ll add hardware. My recording may fail because of a blocked tuner before the watchdog, or my actual movie (not that I really watch that on TV, but still) may stop.

Given that the workaround above was posted 2 years ago, I am not very optimistic that Kodi will fix this any time soon … :frowning:

I agree the sw solution might not be perfect :wink:

For hardware you could use a nodeMCU powered by Vero4k USB port. The nodeMCU with arduino code could send http request to osmc to stop Kodi player (jsonrpc) when the tv USB is powered off. I guess a relay connected to the Tv USB would switch on/off with/without 5v on the USB - this can be sensed on a digital pin of the nodeMCU.

The problem with this approach is that the Kodi player will be stopped/turned off if the tv is off. I want the radio on during the day (when the TV is off) so that wouldn’t work for me)

The suggested Arduino Pro Mini acting as a USB keyboard seems easier. It would only once issue a stop command when the voltages changes from on to off, so you could still run your radio during the day.

With your ESP8266 approach, you could even query first what is playing. Or I guess you could use the keymap editor plugin to define a key that only acts as stop in the tv context.

I’ll produce a new kernel with HPD state changes soon and let you know when it is ready for testing.

Awesome, thanks!

Hi

Sorry this took so long.

I’ve produced a new kernel which may report differently when your TV is now off. Try checking hpd_state now with this kernel.

wget "https://www.dropbox.com/s/lq6efw1vpmjxokg/vero3-kernel-video-and-mux-improvements.deb?dl=1" -O kernel.deb
sudo dpkg -i kernel.deb
sudo reboot

If this works for you, and there are no adverse affects for other users, I’ll get this included in a future update.

Cheers

Sam

Thanks, but unfortunately, it is still 1, regardless of the TVs status.

Hi

Thanks for reporting back.

Unfortunately this means the TV isn’t deasserting properly. I’m not sure if there’s a way to reliably detect the status then.

Sam

There would be the way of actively querying CEC. As I wrote before, the status is reported back fine. I just cannot do it without killing Kodis CEC connection. Perhaps it would be possible to do this from a plugin?

I could also try to contact Hisense support. It seems that they sometimes do listen to such community input. I would need some technical info then. HPD doesn’t tell my anything, not my field.

The problem is indeed that the CEC device cannot be opened by multiple clients at this time.