konradknitter / homebridge-philips-android-tv

Homebridge module for the Philips Android TV
Apache License 2.0
48 stars 6 forks source link

Accessory not responding after power off TV or homebridge restart #9

Closed Kepete closed 3 years ago

Kepete commented 3 years ago

Describe The Bug:

1) If homebridge is restarted at the time when TV is turned off, the plugin accessory state in home app will be "not responding" 2) If TV is turned off the (via the home app) then the TV is not waking up from the home app. 3) If manually TV is turned on(via TV remote) then in home app the accessory state is not up to date.

To Reproduce:

Covered above already

Expected behavior:

TV state in home app is always in sync, homebridge can be restarted with TV in turned off

Logs: For points 2) and 3) logs show:

[11/12/2020, 7:36:22 PM] [TV] getCurrentActivity: error: Error: ESOCKETTIMEDOUT

Logs for point 1)

[11/12/2020, 8:03:57 PM] [TV] Fetching channels
[11/12/2020, 8:04:03 PM] [TV] getCurrentActivity: error: Error: ETIMEDOUT
[11/12/2020, 8:04:03 PM] [TV] getCurrentActivity: error: Error: ETIMEDOUT
[11/12/2020, 8:04:43 PM] [TV] getCurrentActivity: error: Error: connect EHOSTUNREACH 192.168.1.95:1926

Logs when homebridge is rebooted with TV turned on:

[11/12/2020, 8:07:19 PM] [TV] Fetching channels
[11/12/2020, 8:07:20 PM] [TV] Available Channels: ETV,............................. 
[11/12/2020, 8:07:20 PM] [TV] Fetching applications
[11/12/2020, 8:07:20 PM] [TV] Available applications: YouTube ........
[11/12/2020, 8:07:20 PM] [TV] Publishing accessory
[11/12/2020, 8:07:20 PM] TV is running on port 46273.
[11/12/2020, 8:07:20 PM] Please add [TV] manually in Home app. Setup Code:

Plugin Config:

{
            "accessory": "PhilipsAndroidTV",
            "name": "TV",
            "ip": "192.168.1.95",
            "macAddress": "1c:5a:xx:xx:xx",
            "apiUser": "xxx",
            "apiPass": "xxx",
            "apps": [
                "Netflix",
                "YouTube",
                "TV"
            ],
            "channels": [
                "ETV"
            ],
            "alternativePlayPause": true
        },

Screenshots:

Environment:

konradknitter commented 3 years ago

Hi,

Plug-in doesn’t save any data between restarts right now. It tries to WOL TV on startup to read data from APIs.

From your scenario description I see that WOL doesn’t work. Do you have Wake over WiFi enabled on your TV? If yes, does MAC address provided to plug-in is WLAN card one?

If both are provided, I would need to know more about your network to check it.

—-

In future I plan to add persistent data between restarts. Just ain’t my priority right now.

Best regards, Konrad Knitter

Wiadomość napisana przez Ken-Tristan Peterson notifications@github.com w dniu 12.11.2020, o godz. 21:17:

 Describe The Bug:

If homebridge is restarted at the time when TV is turned off, the plugin accessory state in home app will be "not responding" If TV is turned off the (via the home app) then the TV is not waking up from the home app. If manually TV is turned on(via TV remote) then in home app the accessory state is not up to date. To Reproduce:

Covered above already

Expected behavior:

TV state in home app is always in sync, homebridge can be restarted with TV in turned off

Logs: For points 2) and 3) logs show:

[11/12/2020, 7:36:22 PM] [TV] getCurrentActivity: error: Error: ESOCKETTIMEDOUT Logs for point 1)

[11/12/2020, 8:03:57 PM] [TV] Fetching channels [11/12/2020, 8:04:03 PM] [TV] getCurrentActivity: error: Error: ETIMEDOUT [11/12/2020, 8:04:03 PM] [TV] getCurrentActivity: error: Error: ETIMEDOUT [11/12/2020, 8:04:43 PM] [TV] getCurrentActivity: error: Error: connect EHOSTUNREACH 192.168.1.95:1926 Logs when homebridge is rebooted with TV turned on:

[11/12/2020, 8:07:19 PM] [TV] Fetching channels [11/12/2020, 8:07:20 PM] [TV] Available Channels: ETV,............................. [11/12/2020, 8:07:20 PM] [TV] Fetching applications [11/12/2020, 8:07:20 PM] [TV] Available applications: YouTube ........ [11/12/2020, 8:07:20 PM] [TV] Publishing accessory [11/12/2020, 8:07:20 PM] TV is running on port 46273. [11/12/2020, 8:07:20 PM] Please add [TV] manually in Home app. Setup Code: Plugin Config:

{ "accessory": "PhilipsAndroidTV", "name": "TV", "ip": "192.168.1.95", "macAddress": "1c:5a:xx:xx:xx", "apiUser": "xxx", "apiPass": "xxx", "apps": [ "Netflix", "YouTube", "TV" ], "channels": [ "ETV" ], "alternativePlayPause": true }, Screenshots:

Environment:

Plugin Version: homebridge-philips-android-tv v0.2.4 Homebridge Version: v1.1.6 Node.js Version: NPM Version: Operating System: Debian / hb-service — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

Kepete commented 3 years ago

Today tested it further. I double checked the MAC and IP from the TV settings.

Another plugin for the Philips TV WOL works(kind of works, sometimes if a sleep for long then it won't wake). But the other plugin lacks extra functionalities, which this plugin has.

Should the MAC addresses be provided without any prefix like wol:// ?

But even if the WOL doesn't work, should it respond once turned on from IR remote? After it's already turned on I believe it will use APIs and these should anyways work?

TV model: 55PUS7181/12

konradknitter commented 3 years ago

Just MAC address of wireless card, and wake over lan enabled on TV.

WOL won’t turn on TV, just makes API responsive. Separate command has to be send to turn it on. Point of WOL is to wake up TV from long sleep, so seems like other plugins might have issue.

Without WOL, TV has to be on during startup of homebridge. Then it should be functional, without WOL of course.

konradknitter commented 3 years ago

I've refactored WOL procedure for more robust one. Increased readability of logs.

With WOL configured on my TVs it have good success rate when restarting homebridge.