homebridge-tv-cec icon indicating copy to clipboard operation
homebridge-tv-cec copied to clipboard

New power state is not retrieved correctly after state change

Open CameronSmith93 opened this issue 4 years ago • 8 comments

Hi all, I've only just installed this plugin, but am having an issue with the detection of the new power state of the TV after changing the state using the Home app.

Take the below output as an example of the issue:

*toggle power On in Home app*
[5/20/2020, 12:16:51] [TV] Turning TV on
[5/20/2020, 12:17:21] [TV] TV is not turning on
*TV is marked as 'No Response' in the Home app*
*close and reopen Home app*
[5/20/2020, 12:17:43] [TV] Checking TV power status
[5/20/2020, 12:17:43] [TV] TV is on

The state is not detected correctly after changing until closing and reopening the Home app, forcing a re-check.

The same is true of toggling the power Off:

*toggle power Off in Home app*
[5/20/2020, 12:17:54] [TV] Turning TV fff
[5/20/2020, 12:18:24] [TV] TV is not turning off
*TV is marked as 'No Response' in the Home app*
*close and reopen Home app*
[5/20/2020, 12:19:28] [TV] Checking TV power status
[5/20/2020, 12:19:29] [TV] TV is off

Unfortunately I am not familiar enough with nodeJS to make the change myself, but is there a way to call the getPowerStatus() and return that result at the end of setPowerStatus()?

CameronSmith93 avatar May 20 '20 02:05 CameronSmith93

Same issue here

adamrzanek avatar May 20 '20 20:05 adamrzanek

I actually got it working almost perfectly now - Samfox2 has forked this repository and made a number of improvements - by copying and pasting the contents of this index.js file and replacing the one I have within home bridge already, everything works perfectly except the following case:

When the TV is off, and HomeKit knows that the TV is off, and the TV is then switched on with a remote control, the change in state is not pushed back to HomeKit without opening the Home app on one of your devices which forces a re-check of the state.

Perhaps there is a way to get the state to automatically get checked every 1-5 seconds or so?

https://github.com/Samfox2/homebridge-tv-cec/blob/master/index.js

CameronSmith93 avatar May 21 '20 00:05 CameronSmith93

How can I apply this on my homebridge? Sorry to bother you but I’m newbie and I want this plugin so bad :)

adamrzanek avatar May 22 '20 18:05 adamrzanek

@dominick-han my changes are quite proprietary for my TV but maybe I could merge them in any way. Are you still interested in updating this plugin?

Samfox2 avatar May 22 '20 20:05 Samfox2

It would be do great you guys start working on this. This is my dream plugin and it doesn’t work for me :)

On 22 May 2020, at 22:09, Samfox2 [email protected] wrote:

 @dominick-han my changes are quite proprietary for my TV but maybe I could merge them in any way. Are you still interested in updating this plugin?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

adamrzanek avatar May 22 '20 20:05 adamrzanek

@dominick-han my changes are quite proprietary for my TV but maybe I could merge them in any way. Are you still interested in updating this plugin?

I can update the plugin, but I have no means of testing it (no devices)

I realized that the CEC implementation might be quite device specific, and my cheap 4K TV might be a bad example of CEC implementation

dominick-han avatar May 22 '20 20:05 dominick-han

@dominick-han my changes are quite proprietary for my TV but maybe I could merge them in any way. Are you still interested in updating this plugin?

I can update the plugin, but I have no means of testing it (no devices)

I realized that the CEC implementation might be quite device specific, and my cheap 4K TV might be a bad example of CEC implementation

It would be great!

adamrzanek avatar May 24 '20 15:05 adamrzanek

It would be excellent if you could add functionality to periodically retrieve the state of the television automatically and report to HomeKit rather than the current behaviour in which the state is retrieved when HomeKit is refreshed!

CameronSmith93 avatar Sep 11 '20 13:09 CameronSmith93