Closed TwoWheelDev closed 1 year ago
It sounds like a good idea to listen to more topics as different TV models tend to behave differently.
Mine does not send the an update to /remoteapp/mobile/broadcast/ui_service/state
but sends to /remoteapp/mobile/broadcast/platform_service/actions/tvsleep
immediately during turn-off.
I have added a PR for this issue. Currently this only affects the media_player component.
I looked at the switch, to try and implement similar but not sure how the switch handles state updates. Out of interest, what is the use of the switch? It seems this duplicates the functionality of the media_player?
I've noticed that it takes a number of minutes for the integration to detect the off state.
Looking at media player, I can see that it does subscribe to
/remoteapp/mobile/broadcast/platform_service/actions/tvsleep
and is processed by_message_received_turnoff
at https://github.com/sehaas/ha_hisense_tv/blob/main/custom_components/hisense_tv/media_player.py#L403Monitoring on the MQTT broker, it seems there is a significant delay in this above message being received. The TV however does seem to post the sleep state in
/remoteapp/mobile/broadcast/ui_service/state
. This is what I receive when the TV is off:This state is visible instantly. I have had a look at the processing of that state, but haven't been able to fully test making a change to the code there at this point.
If I get chance, I will try and test some changes. But open to suggestions!