MrAsterisco / homebridge-hisense-tv

A Homebridge plugin to control RemoteNow-compatible HiSense TVs.
MIT License
21 stars 8 forks source link

Improve support TVs that are always on #18

Closed jamjop closed 2 months ago

jamjop commented 3 years ago

The plug-in does not report on/off state to HomeKit therefore I can’t use it for automations. I can really only use it if I know the TVs current power state.

jamjop commented 3 years ago

I see this has already been discussed

MrAsterisco commented 3 years ago

@jamjop hello and thanks for reporting this! So technically the plugin does report the TV state to HomeKit (it is checked periodically). However, if you have the Home app opened, the status update won't work (I still have to figure out why -- however, I have the same problems with other Homebridge plugins as well).

Would you mind elaborating on what's the issue for you? Maybe there's a solution for it.

matthijsf commented 2 years ago

I’m having the same issue on the U7G. The state is always reported as on, likely because of the way the TV handles the OS staying fully operational while the screen is off. If you need me to test something, please do let me know.

MrAsterisco commented 2 years ago

@matthijsf Thanks for bringing this up, however I wouldn't know how to fix this: if the TV is on and responds to call, then technically... it is on 😝

How is it reported in the RemoteNOW app?

jparchem commented 2 years ago

I saw a potential solution over on a Home Assistant discussion HERE. They were able to ascertain the power state by subscribing to the /remoteapp/mobile/broadcast/platform_service/data/picturesetting topic. If the power state changes, you'll receive a notification message containing a menu_info array that contains a list of settings. Toggling my TV (a model U8G) on and off showed that a particular item in the array, HDMI Dynamic Range (menu_id=23) had a menu_flag value of 1 for "OFF" and -1 for "ON".

menu_value_type int

So different models are probably going to have different behavior, but the basics of seeing what gets toggled during a change of power state should still hold true.

I'm not a TypeScript person, but I would be willing to collaborate with you on this in testing with the model I have. I'm also not terribly familiar with MQTT, and I'm wondering if the iPhone, iPad, or Mac is off during a change of power state, will it still get the corresponding messages when it comes back online. I think that would be simple enough for me to test.

MrAsterisco commented 2 years ago

That's an awesome insight, thank you for bringing this up @jparchem !

Unfortunately, I don't have the bandwidth to look into this right now: it is quite the change because it involves subscribing to an additional topic to understand if the TV is on or off, which (IIRC) isn't something that's supported right now.

In any case, this change will have to be applied to the Python script first and then implemented in the Homebridge plugin.

To give further context, these are the steps that I see:

It is going to be really hard for me to develop this change without having a TV to test, so if somebody else involved in this conversation has time to look into, I'm happy to support.

LeLunZ commented 4 months ago

@jparchem @matthijsf @jamjop if you are still interested: Changes are implemented in the latest beta version ;) Feel free to check it out!

LeLunZ commented 2 months ago

@jamjop this is now available in the latest version 3.0.0 I am closing this. So if any problem occurs, please create a new bug report.