konradknitter / homebridge-philips-android-tv

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

Unable to discover after upgrade #36

Open slacky84 opened 3 years ago

slacky84 commented 3 years ago

I have installed the plugin, but i am unable to discover my tv (65oled854) via the IOS Home app, and it does not appear in my homebridge accessories.

I have removed and reinstalled the plugin with no success.

the following messages appear in the log on startup - note that i have added the tv twice just to test the different MAC address formats:

[6/3/2021, 9:55:05 PM] [PhilipsAndroidTV] [ { name: 'Big TV', ip: '192.168.1.202', macAddress: '3C-91-80-D9-F8-03', apiUser: 'PwQMfhiACDARVRl2', apiPass: '2c51c465689b07641c42d18f4f37b0025902c47df0e85554fd0ea97015320612', apiVersion: 6, wakeUntilAPIReadyCounter: 100, alternativePlayPause: true, dedicatedMuteSwitch: true, dedicatedVolumeLightbulb: true, channels: { useFavorites: false, favoriteListId: '1', includeAll: false } }, { name: 'Living Room Telly', ip: '192.168.1.202', macAddress: '3C:91:80:D9:F8:03', apiUser: '2OAiUBZFec8cydGC', apiPass: 'e40997e3a81b8f45fb7ef5c829752c74240f48e2bed4b88959d49285e0d2a70b', apiVersion: 6, wakeUntilAPIReadyCounter: 100, alternativePlayPause: false, dedicatedMuteSwitch: false, dedicatedVolumeLightbulb: false, channels: { useFavorites: false, favoriteListId: '1', includeAll: true } } ] [6/3/2021, 9:55:05 PM] [PhilipsAndroidTV] Adding new accessory: Big TV [6/3/2021, 9:55:05 PM] [PhilipsAndroidTV] [Big TV] Connecting to TV to fetch current informations

[6/3/2021, 9:56:03 PM] [Homebridge UI] [homebridge-philips-android-tv] Terminating child process... [6/3/2021, 9:56:03 PM] [Homebridge UI] [homebridge-philips-android-tv] Child process ended

Can you offer any suggestions as to why this is not working?

slacky84 commented 3 years ago

an update on my issue, I have managed to discover my tv in the home app now, however there are a few issues.

1) the repeated errors as reported under a previous issue: [6/3/2021, 11:43:10 PM] [PhilipsAndroidTV] [BIG TV] Start responding again. [6/3/2021, 11:43:10 PM] [PhilipsAndroidTV] [BIG TV] Stop responding.

2) despite the dedicate mute switch, and dedicated volume light bulb flags set to "true", they do not appear in the home app.

3) when i power off my tv from the home app or from the home bridge guy, it immediately powers itself back on.

my config is as follows: { "debug": false, "configVersion": 1, "tvs": [ { "ip": "192.168.1.202", "mac": "3C:91:80:D9:F8:03", "name": "BIG TV", "apiUser": "sOp9hH4LdXOes08M", "apiPass": "265472dbabe34be9d5e7726369346a35a876fd6e92d32ee3c033d886df830422", "dedicatedMuteSwitch": true, "dedicatedVolumeLightbulb": true } ], "platform": "PhilipsAndroidTV"

Write commented 3 years ago

Same issue here. I have to remove dedicatedMuteSwitch, dedicatedVolumeLightBublbe and apiVersion to make it work. Otherwise the plugin doesn't seem to read the config properly. Basically i can't make any change after I first paired the TV, if I do, it wont read the config properly and would show as 'No response' on HomeKit side. And once it work, it spams Start responding again. / Stop Responding. Also i had issue where TV couldn't be turned off (it would instantly turn back on). I reverted to v0.4.15, back then it was an accessory and not a platform for now as it's the most stable version for me.

konradknitter commented 3 years ago

I've noticed that Platform config won't work with volume lightbulb. I will cover that afternoon. Legacy (accessory) configuration should work like it used to.

For turning on TV after turning off. I can't reproduce it - in afternoon build I will add debug prints with all messages under debug flag and will need to understand what's going on there.

jagrob9 commented 3 years ago

Can confirm that there seems to be an issue with the config. I had to remove nearly everything to get it work (not just volume lightbulb):

{ "debug": false, "configVersion": 1, "tvs": [ { "name": "PhilipsFernseher", "ip": "192.168.5.161", "macAddress": "70:AF:24:A5:9F:A5", "apiUser": "bzgSYHbK2F56EnBb", "apiPass": "b6df56bcb391343746bddec31c83ab2d239e43ed5a1a6b1d25d92a04d36bdece" } ], "platform": "PhilipsAndroidTV" }

konradknitter commented 3 years ago

"And once it work, it spams Start responding again. / Stop Responding. Also i had issue where TV couldn't be turned off (it would instantly turn back on)."

Fixed wakeUp loop in case of error.

dedicatedMuteSwitch: true, dedicatedVolumeLightbulb: true,

Can't get it work under platform quickly. I will get back to issue this evening.

[6/3/2021, 11:43:10 PM] [PhilipsAndroidTV] [BIG TV] Start responding again. [6/3/2021, 11:43:10 PM] [PhilipsAndroidTV] [BIG TV] Stop responding.

With flag config: debug = true, there should have additional logs with errors. If you could provide me this log - I could debug it.

Write commented 3 years ago

"And once it work, it spams Start responding again. / Stop Responding. Also i had issue where TV couldn't be turned off (it would instantly turn back on)."

Fixed wakeUp loop in case of error.

dedicatedMuteSwitch: true, dedicatedVolumeLightbulb: true,

Can't get it work under platform quickly. I will get back to issue this evening.

[6/3/2021, 11:43:10 PM] [PhilipsAndroidTV] [BIG TV] Start responding again. [6/3/2021, 11:43:10 PM] [PhilipsAndroidTV] [BIG TV] Stop responding.

With flag config: debug = true, there should have additional logs with errors. If you could provide me this log - I could debug it.

Thanks for your awesome (and free) work. As for the logs, for now i'm kinda lazy to update to latest version, i'll come back in a few days when a new update is out, and i'll try everything and post logs.

slacky84 commented 3 years ago

thanks for the work - I can now turn off my TV!!!!!!

the issue regarding the Start/Stop responding is still present, and the connection to home bridge is very intermittent/unstable. see the following current config and log with debug enabled - which is not very enlightening!

{ "platform": "PhilipsAndroidTV", "name": "PhilipsTV-TEST", "debug": true, "configVersion": 1, "tvs": [ { "ip": "192.168.1.202", "mac": "3C:91:80:D9:F8:03", "name": "Test-TV", "apiUser": "4mmVzIf0XSqfol7t", "apiPass": "c5707d57245480a4b3db331e86841bb6c3497a51d0d17392fb1a4d4b0f6aed48" } ] }

6/4/2021, 3:38:01 PM] [PhilipsTV-TEST] [Test-TV] Start responding again. [6/4/2021, 3:38:02 PM] [PhilipsTV-TEST] [Test-TV] Stop responding. [6/4/2021, 3:38:07 PM] [PhilipsTV-TEST] [Test-TV] Start responding again. [6/4/2021, 3:38:07 PM] [PhilipsTV-TEST] [Test-TV] Stop responding. [6/4/2021, 3:38:12 PM] [PhilipsTV-TEST] [Test-TV] Start responding again. [6/4/2021, 3:38:12 PM] [PhilipsTV-TEST] [Test-TV] Stop responding. [6/4/2021, 3:38:17 PM] [PhilipsTV-TEST] [Test-TV] Start responding again. [6/4/2021, 3:38:17 PM] [PhilipsTV-TEST] [Test-TV] Stop responding. [6/4/2021, 3:38:22 PM] [PhilipsTV-TEST] [Test-TV] Start responding again. [6/4/2021, 3:38:22 PM] [PhilipsTV-TEST] [Test-TV] Stop responding. [6/4/2021, 3:38:27 PM] [PhilipsTV-TEST] [Test-TV] Start responding again. [6/4/2021, 3:38:27 PM] [PhilipsTV-TEST] [Test-TV] Stop responding.

konradknitter commented 3 years ago

@slacky84 did you update to the newest one?

There should be if set debug always log:

in src/PhilipsTVPlatform.ts

if (this.responsive) { this.log.info('[' + this.config.name + '] Stop responding.'); this.responsive = false; } if (this.config.debug) { this.log.debug('checkStatus: error:' + err); }

I see that on the next issue, and I can't reproduce this scenario myself.

slacky84 commented 3 years ago

yes - i'm running homebridge-philips-android-tv v0.10.6 that was released today!

where do i find the src/PhilipsTVPlatform.ts file on my mac? i have searched for it but nothing is found.

when i enable debug mode in home bridge, I also see the following:

[6/4/2021, 6:11:36 PM] [PhilipsTV-TEST] [Test-TV] Start responding again. [6/4/2021, 6:11:36 PM] [PhilipsTV-TEST] [Test-TV] Stop responding. [6/4/2021, 6:11:36 PM] [PhilipsTV-TEST] checkStatus: error:TypeError: Cannot read property 'name' of undefined

konradknitter commented 3 years ago

[6/4/2021, 6:11:36 PM] [PhilipsTV-TEST] checkStatus: error:TypeError: Cannot read property 'name' of undefined

okay, so that's the issue. My only guess looking at the code that TV is returning nothing when asking about current TV channel. Added additional check in 0.10.7.

Write commented 3 years ago

I'm trying 0.10.7

It seems to work for now but still some bug with the config.

With a config like this : image

The TV is well detected and working.

If i got to Plugins > Philips Android TV > Settings > Parameter Editor, and then, Save (So the TV get default json value) The TV stop responding. Altough in the Config File all informations required to connect is here (Mac, IP, apiUser, apiPass).

And i can see the plugin actually can read the data because it shows up in the console on startup :

image

But...

image

JSON look like that at this point :
image

Then, i remove everything from the JSON config EXCEPT apiUser, Pass , mac , ip and name and it connect again on reboot.

So I tried to manually add each parameters one by one and reboot each time to see which parameters make the plugin bug out.

Aaaand it's actually when waitUntilAPIReadyCounter is defined (at least the default value, which is 100).

So for now my config look like that and everything work great. (Well almost, i don't have the Volume Light Bulb showing up actually)

{
    "debug": true,
    "configVersion": 1,
    "tvs": [
        {
            "name": "TV",
            "ip": "192.168.1.10",
            "macAddress": "64:E0:03:57:E1:5D",
            "apiUser": "dvIBXcMZos38nPD1",
            "apiPass": "ed5753e4d9693c798e7db15b6e518ed941dda2a8474dfd36e23e3d9828c9ef8f",
            "apiVersion": 6,
            "alternativePlayPause": false,
            "dedicatedMuteSwitch": false,
            "dedicatedVolumeLightbulb": true,
            "channels": {
                "useFavorites": false,
                "favoriteListId": "1",
                "includeAll": "false"
            },
            "apps": [
                "Netflix",
                "Kodi",
                "Prime Video",
                "Molotov"
            ]
        }
    ],
    "platform": "PhilipsAndroidTV"
}
konradknitter commented 3 years ago

Thanks for catching that! Fixed. :)

Write commented 3 years ago

So fast ! Early test shows that i work for me now.

I'll report back any issue

Thanks you !

slacky84 commented 3 years ago

Hi, Firstly thankyou for all your work on this - you are doing a great job.

So i have now been able to add the volume and mute switches to my apple home - great!

However.....

as soon as I use these switches to either toggle the mute or change the volume, the accessory immediately shows as "no response" in the home app. It does appear to issue the commands and change the TV volume, however the display doesn't update with the new volume value, and returns to the original level (display only, the volume stays as set). After a while, the app refreshes and displays the correct value.

slacky84 commented 3 years ago

https://user-images.githubusercontent.com/83460976/121491775-2d933480-c9ce-11eb-8914-4e9884cd5771.MP4

slacky84 commented 3 years ago

since upgrading to v10.9 the volume or mute buttons no longer work at all

konradknitter commented 3 years ago

@slacky84 still about bulb and switch? I didn’t figure out those yet.

TV Remote Widget should be fully functional.

slacky84 commented 3 years ago

yeah - just the bulb and switch. on/off works fine

konradknitter commented 3 years ago

If you use TV Remote Widget you can control volume as well (using side buttons of the device). - I hope those are working well for you.

When I fix bulb/switch having some time in near future - I will bump major version. - yesterday patch was to solve trivial issue for plugin verification. Mute/Volume require some time to test…

Write commented 3 years ago

I remember I had some issue with Volume Bulb where i had to remove old one from cache. Idk if that's it.