lukasroegner / homebridge-apple-tv-remote

Plugin for controlling Apple TVs in homebridge.
MIT License
131 stars 13 forks source link

Switch turning off #44

Closed adamrzanek closed 4 years ago

adamrzanek commented 4 years ago

Sometimes switch turning off even when atv is on. Sometimes now playing switch is on even when atv is off.

adamrzanek commented 4 years ago

The it was because I was air playing to my HomePod. Is it fixable?

lukasroegner commented 4 years ago

There has been a long discussion in #30 on handling the AirPlay state. It seems that the solution that I've provided there does not work for you.

Can you please start Homebridge in debug mode (parameter -D) and take a look at the logs when turning off the Apple TV? The important log entries are

Message received: logicalDeviceCount - X |  isProxyGroupPlayer - XXXX | isAirplayActive - XXXX

Those are the three parameter that are considered in the on/off state logic. As soon as the HomeKit state of the switch does not match the actual state, get the corresponding logs and post it here, thus we can check whether the logic has to be fixed.

adamrzanek commented 4 years ago

The OnOff switch is unfortunately very unreliable even when I don’t use airplay... sometimes appletv is off and switch is on. Don’t know what to do.

adamrzanek commented 4 years ago

[5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] On/off switch changed to false [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] On/off switch changed to false [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] On/off switch changed to false [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] On/off switch changed to false [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Getting power state... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Getting power state... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Getting power state... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Getting power state... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Returning cached value true for power state [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Returning cached value true for power state [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Returning cached value true for power state [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Returning cached value true for power state [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Pressing key topmenu... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Pressing key topmenu... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Pressing key topmenu... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Pressing key topmenu... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:53] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Pressing key select... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Pressing key select... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Pressing key select... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Pressing key select... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Sending heartbeat... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Sending heartbeat... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Sending heartbeat... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Sending heartbeat... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Message received: logicalDeviceCount - 1 | isProxyGroupPlayer - false | isAirplayActive - false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Message received: logicalDeviceCount - 1 | isProxyGroupPlayer - false | isAirplayActive - false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Message received: logicalDeviceCount - 1 | isProxyGroupPlayer - false | isAirplayActive - false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Message received: logicalDeviceCount - 1 | isProxyGroupPlayer - false | isAirplayActive - false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] On/off switch updated to true [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] On/off switch updated to true [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] On/off switch updated to true [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] On/off switch updated to true [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:55] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] Message received: logicalDeviceCount - 0 | isProxyGroupPlayer - false | isAirplayActive - false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] Message received: logicalDeviceCount - 0 | isProxyGroupPlayer - false | isAirplayActive - false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] Message received: logicalDeviceCount - 0 | isProxyGroupPlayer - false | isAirplayActive - false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] Message received: logicalDeviceCount - 0 | isProxyGroupPlayer - false | isAirplayActive - false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] On/off switch updated to false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] On/off switch updated to false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] On/off switch updated to false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] On/off switch updated to false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:51:57] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Now playing info received: paused [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Play/pause switch updated to false [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] On/off switch changed to true [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] On/off switch changed to true [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] On/off switch changed to true [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] On/off switch changed to true [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Getting power state... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Getting power state... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Getting power state... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Getting power state... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Returning cached value false for power state [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Returning cached value false for power state [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Returning cached value false for power state [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Returning cached value false for power state [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Pressing key topmenu... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Pressing key topmenu... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Pressing key topmenu... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Pressing key topmenu... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Connecting... [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Force reconnect: false [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Retry count: 10 [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Already connected [5/23/2020, 20:52:00] [AppleTvPlatform] [Apple TV] Already connected

adamrzanek commented 4 years ago

I’ve just turned off and on the switch once

adamrzanek commented 4 years ago

Now when I was ariplaying to HomePod switch was off and I turned it on but now Apple TV was back to home screen

adamrzanek commented 4 years ago

[5/23/2020, 20:56:54] [AppleTvPlatform] [Apple TV] On/off switch changed to true [5/23/2020, 20:56:54] [AppleTvPlatform] [Apple TV] Getting power state... [5/23/2020, 20:56:54] [AppleTvPlatform] [Apple TV] Returning cached value false for power state [5/23/2020, 20:56:54] [AppleTvPlatform] [Apple TV] Pressing key topmenu...

lukasroegner commented 4 years ago

I think it is an issue with concurrency in your case. All entries in the logs are displayed four times, they should only be displayed once. You could take a look at the logs when the plugin is started and when the logs entries start to occur twice.

adamrzanek commented 4 years ago

D7244D36-C168-4F22-9AF6-0880FF122475

I’m close to giving up :( right now my appletv is off and switch is on

lukasroegner commented 4 years ago

I've created an issue that merges several other issues. This new issue will be used to track the instability issues: #46

As soon as there are new findings, the new issue will be updated. I recommend to come back later, it will take some time to do extensive testing.