kiwi-cam / homebridge-broadlink-rm

[This fork supports TV accessories] Broadlink RM Mini and Pro plugin for homebridge: https://github.com/nfarina/homebridge
Apache License 2.0
304 stars 96 forks source link

Issues with icon TVs on iOS 14 GM #57

Closed masterfordev closed 4 years ago

masterfordev commented 4 years ago

When i add 2 or more tv for broadlink device i have this error on the homebridge log:

[2020-9-16 20:27:18] One of your plugins incorrectly registered an external accessory using the platform name ([object Object]) and not the plugin identifier. Please report this to the developer!

It should be clarified that if I add only one TV, this does not happen.

And on iOS 14, the Home App dont display the devices as TV, in this case it doesn't matter if I have one or more televisions, never put the TV icon on them (see the screenshot): Screenshot

I hope you can check this issues. Im on homebridge 1.2.2, and plugin 4.3.0. Thanks.

sergoo-lbt commented 4 years ago

I also have a house instead of a TV

masterfordev commented 4 years ago

We need help @kiwi-cam :p

I've been trying to locate the error in the plugin code but I can't detect where it originates.

Faisalthe01 commented 4 years ago

it is due to something that changed in iOS 14 GM Version.

New icons too

https://twitter.com/HerrSupereg/status/1306278447317123072

https://github.com/homebridge/homebridge/issues/2683

masterfordev commented 4 years ago

but I'm also using the homebridge-samsung-tizen plugin with my smart tv samsung and that tv does show a tv icon.

Screenshot

it is due to something that changed in iOS 14 GM Version.

New icons too

https://twitter.com/HerrSupereg/status/1306278447317123072

homebridge/homebridge#2683

Faisalthe01 commented 4 years ago

but I'm also using the homebridge-samsung-tizen plugin with my smart tv samsung and that tv does show a tv icon.

it is due to something that changed in iOS 14 GM Version. New icons too https://twitter.com/HerrSupereg/status/1306278447317123072 homebridge/homebridge#2683

Can you changes the icon for that TV in home app?

masterfordev commented 4 years ago

but I'm also using the homebridge-samsung-tizen plugin with my smart tv samsung and that tv does show a tv icon.

it is due to something that changed in iOS 14 GM Version. New icons too https://twitter.com/HerrSupereg/status/1306278447317123072 homebridge/homebridge#2683

Can you changes the icon for that TV in home app?

No, I have never been able to change a TV icon, ios 14 or ios 13, never allowed me to change it.

sergoo-lbt commented 4 years ago

I tried deleting the TV in homekit and in the.json config. Nothing helped. The problem remained. TV-Home!

masterfordev commented 4 years ago

I tried deleting the TV in homekit and in the.json config. Nothing helped. The problem remained. TV-Home!

Yes, as mentioned @Faisalthe01 and (@Supereg on twitter), it seems to be a Homekit problem and not a homebridge or plugin problem.

sergoo-lbt commented 4 years ago

I tried deleting the TV in homekit and in the.json config. Nothing helped. The problem remained. TV-Home!

Yes, as mentioned @Faisalthe01 and (@Supereg on twitter), it seems to be a Homekit problem and not a homebridge or plugin problem.

And it's very sad

masterfordev commented 4 years ago

We must wait, maybe there is a solution because the samsung tizen plugin does work without problem. Only in this one it does not.

Faisalthe01 commented 4 years ago

I tried deleting the TV in homekit and in the.json config. Nothing helped. The problem remained. TV-Home!

Yes, as mentioned @Faisalthe01 and (@Supereg on twitter), it seems to be a Homekit problem and not a homebridge or plugin problem.

no don't think HomeKit problem. more of a Homebridge and Plugin issue since Apple changed something. Read @Supereg comment on the tweet i sent

masterfordev commented 4 years ago

But the samsung tizen plugin is working fine with the icons. That makes me think that maybe the problem comes from the plugin.

Faisalthe01 commented 4 years ago

But the samsung tizen plugin is working fine with the icons. That makes me think that maybe the problem comes from the plugin.

yeah maybe Broadlink is missing a TV category code in the TV accessory file and Samsung Tizen does not. @kiwi-cam would be the best and qualified person to look at the code

https://github.com/tavicu/homebridge-samsung-tizen/blob/c3e879b78c547399a845525cd40a0b945b4ef510/lib/accessories/television.js#L20

If you don't mind can you re add the TV connected to your Samsung Tizen Plugin and see if you get option to choose a different icon like Setup box or Stick?

masterfordev commented 4 years ago

I did and it doesn't allow me to choose an icon for the tv. It automatically places the TV icon.

Faisalthe01 commented 4 years ago

I did some research and found out this.

With this Plugin https://github.com/Martvvliet/homebridge-denon-heos Their TV now looks like a Audio Receiver Box after GM because the plugin have the Category code for Audio Receiver https://github.com/Martvvliet/homebridge-denon-heos/blob/d34ee5786ab900c4a838be4a2414c25887ecb195/index.js#L813

Same as Samsung Tizen TV accessory have the code for Category as Television https://github.com/tavicu/homebridge-samsung-tizen/blob/c3e879b78c547399a845525cd40a0b945b4ef510/lib/accessories/television.js#L20

Unfortunately, Broadlink does not have any category listed and just the Service which is Television and since Apple added categories to Television service that's why Broadlink TV does not have any icon now.

https://github.com/homebridge/HAP-NodeJS/blob/b3bc73ceb99c4cb1df17d910ed557c3e6c8362e1/src/lib/Accessory.ts#L87

masterfordev commented 4 years ago

Yes! That's the reason! I told you that the problem was coming from the plugin xD

Faisalthe01 commented 4 years ago

Yeah! Thats the reason! I said, the issue becomes from the plugin xD

lol. so would you know how to define the category in Broadlink tv.js file?

it is defined like this in Denon-Heos plugin

        this.tvAccesory = new Accessory(this.name, UUIDGen.generate(this.ip+this.name+"tvService"));
        this.tvAccesory.category = this.api.hap.Categories.AUDIO_RECEIVER;

and like this in Samsung-Tizen

this.platformAccessory = new Homebridge.platformAccessory(this.device.config.name, this.UUID, Homebridge.hap.Accessory.Categories.TELEVISION);

masterfordev commented 4 years ago

So the problem is here?: https://github.com/kiwi-cam/homebridge-broadlink-rm/blob/a62c43a091cc65a5f43dd0eefe0772f6186c3e5b/helpers/accessoryCreator.js#L14

Faisalthe01 commented 4 years ago

So the problem is here?:

https://github.com/kiwi-cam/homebridge-broadlink-rm/blob/a62c43a091cc65a5f43dd0eefe0772f6186c3e5b/helpers/accessoryCreator.js#L14

Yes looks something like this.

Is this file linked to Tv.js?

masterfordev commented 4 years ago

Look this: https://github.com/kiwi-cam/homebridge-broadlink-rm/blob/a62c43a091cc65a5f43dd0eefe0772f6186c3e5b/platform.js#L81

Faisalthe01 commented 4 years ago

So the problem is here?:

https://github.com/kiwi-cam/homebridge-broadlink-rm/blob/a62c43a091cc65a5f43dd0eefe0772f6186c3e5b/helpers/accessoryCreator.js#L14

So this file that you mentioned did work for me. thank you for that but i had to add an extra TV with random hex codes in my Home App then hid it in default room so i cannot see it anymore on main screen because for some reason the first TV added automatically by Broadlink is not picking up the category for it but for rest of the TV that i had to manually in Home App does pick up the category. Maybe you can figure it out why

So i did it one by one first i added my TV but before i added this on line 14

const accessory = new platformAccessory(displayName, accessoryUUID, Accessory.Categories.TELEVISION);

then i added the TV manually in Home app and it showed up as TV.

then i changed the line 14 to

const accessory = new platformAccessory(displayName, accessoryUUID, Accessory.Categories.AUDIO_RECEIVER);

then i added my Panasonic surround system manually and it showed up as Audio Receiver

then i changed the line 14 to

const accessory = new platformAccessory(displayName, accessoryUUID, Accessory.Categories.TV_SET_TOP_BOX);

then i added my Vodafone Android TV Box manually and it showed up as Set top box.

this is how my icons look now

new icons

and this icon does not do anything but it has to be there as broadlink adds 1st TV automatically

old icon

kiwi-cam commented 4 years ago

Nice work @Faisalthe01 and @masterfordev. I'm just publishing a BETA version which fixes the issue for additional TVs. Just need to find the code for the first one. HomeKit only allows a single TV on a bridge so the plugin uses accessoryCreator.js to create standalone accessories for all additional TVs. Just need to work out how to fix the Category for the initial TV.

I'm also totally adding Receiver and STB support soon too!

Faisalthe01 commented 4 years ago

Nice work @Faisalthe01 and @masterfordev. I'm just publishing a BETA version which fixes the issue for additional TVs. Just need to find the code for the first one. HomeKit only allows a single TV on a bridge so the plugin uses accessoryCreator.js to create standalone accessories for all additional TVs. Just need to work out how to fix the Category for the initial TV.

I'm also totally adding Receiver and STB support soon too!

Hey mate. Thank you for looking into this.

So with the extra code you put in "accessoryType". We will be able to define that in our config file whether it a TV, Set top box or Audio Receiver?

kiwi-cam commented 4 years ago

So with the extra code you put in "accessoryType". We will be able to define that in our config file whether it a TV, Set top box or Audio Receiver?

No, they'll just be TVs.... for now. I've got a STB too so I'm keen to integrate the categories you've found. Just pondering how to do it (new types or expand the existing tv type).

masterfordev commented 4 years ago

Nice work @Faisalthe01 and @masterfordev. I'm just publishing a BETA version which fixes the issue for additional TVs. Just need to find the code for the first one. HomeKit only allows a single TV on a bridge so the plugin uses accessoryCreator.js to create standalone accessories for all additional TVs. Just need to work out how to fix the Category for the initial TV.

I'm also totally adding Receiver and STB support soon too!

Thanks @kiwi-cam ! im testing the beta. and work for the additional TVs.

kiwi-cam commented 4 years ago

So... the HomeBridge documentation (https://developers.homebridge.io/#/service/Television) sets up all TVs as separate accessories (not using Homebridge as a Bridge). This works nicely to resolve our issue... but it does mean people will need to add all TVs separately in the Home app - and their current first TV will disappear and need to be re-added this way.

It's a bit of pain, but I think it's a better approach.

A new BETA using this approach has been published. This should get all your TVs looking right... after you re-add them 😁

masterfordev commented 4 years ago

So... the HomeBridge documentation (https://developers.homebridge.io/#/service/Television) sets up all TVs as separate accessories (not using Homebridge as a Bridge). This works nicely to resolve our issue... but it does mean people will need to add all TVs separately in the Home app - and their current first TV will disappear and need to be re-added this way.

It's a bit of pain, but I think it's a better approach.

A new BETA using this approach has been published. This should get all your TVs looking right... after you re-add them 😁

Thanks! I have upgraded to Beta 2 and it is working perfectly.

Faisalthe01 commented 4 years ago

So... the HomeBridge documentation (https://developers.homebridge.io/#/service/Television) sets up all TVs as separate accessories (not using Homebridge as a Bridge). This works nicely to resolve our issue... but it does mean people will need to add all TVs separately in the Home app - and their current first TV will disappear and need to be re-added this way.

It's a bit of pain, but I think it's a better approach.

A new BETA using this approach has been published. This should get all your TVs looking right... after you re-add them 😁

Appreciate your quick and great work @kiwi-cam

There is another category that icon looks like a Fire Stick, add that too. the category name is TV_STREAMING_STICK

masterfordev commented 4 years ago

@kiwi-cam I still have this in the homebridge log after each reboot, but all is working fine.

[2020-9-17 19:29:52] One of your plugins incorrectly registered an external accessory using the platform name ([object Object]) and not the plugin identifier. Please report this to the developer!

kiwi-cam commented 4 years ago

@masterfordev - Not much we can do about that. There's some discussion on that issue here: #26

Faisalthe01 commented 4 years ago

Christmas comes early. i wanted these icons for a long time now. Really happy :D

masterfordev commented 4 years ago

@masterfordev - Not much we can do about that. There's some discussion on that issue here: #26

Oh... I see. thanks anyway 😅

masterfordev commented 4 years ago

Christmas comes early. i wanted these icons for a long time now. Really happy :D

lol! i just want the STB. But is like an TV, just witht other icon hehe

Faisalthe01 commented 4 years ago

Christmas comes early. i wanted these icons for a long time now. Really happy :D

lol! i just want the STB. But is like an TV, just witht other icon hehe

lol. Still looks better than only TV. Audio Receiver looks very dope. If your STB is like a Fire Stick you can use Stick icon too the one i mentioned above, i think @kiwi-cam did add that in the beta too

kiwi-cam commented 4 years ago

I've got an update in git that should update the icons but I haven't been able to test yet - I'm not at home right now to add the new TV.

All going well I'll update the BETA this evening. If you like, you can install direct from Git using: npm install -g git+https://github.com/kiwi-cam/homebridge-broadlink-rm.git#kiwi-cam-tv-subtypes. I usually do a bit of testing before pushing a beta so this is very ALPHA status... maybe even DRAFT status.

The documentation will be updates too: https://github.com/kiwi-cam/homebridge-broadlink-rm/tree/kiwi-cam-tv-subtypes (note the new option under TV)

masterfordev commented 4 years ago

I've got an update in git that should update the icons but I haven't been able to test yet - I'm not at home right now to add the new TV.

All going well I'll update the BETA this evening. If you like, you can install direct from Git using: npm install -g git+https://github.com/kiwi-cam/homebridge-broadlink-rm.git#kiwi-cam-tv-subtypes. I usually do a bit of testing before pushing a beta so this is very ALPHA status... maybe even DRAFT status.

The documentation will be updates too: https://github.com/kiwi-cam/homebridge-broadlink-rm/tree/kiwi-cam-tv-subtypes (note the new option under TV)

Yup, i was reading the changes in the repository https://github.com/kiwi-cam/homebridge-broadlink-rm/tree/kiwi-cam-tv-subtypes 😅 dont worry. We can wait until you have time to make the changes and tests.

kiwi-cam commented 4 years ago

I've just pushed the new BETA. I re-added my TVs and they worked beautifully. If you can install and let me now if there are issues, I'll push a new version in a day or two.

masterfordev commented 4 years ago

After update is working with no problems. But now i can use sub-category or that is a future update?

masterfordev commented 4 years ago

I found a issue. After add the TV, if i use the Control from Control Panel for volume up/down, the TV turn off.

kiwi-cam commented 4 years ago

Yep. Under your TV config add “subType” and set it to tv, stb, receiver, or stick.

E.g. “subType”: “stb”

You might have to remove and re-add the TV for it to update.

masterfordev commented 4 years ago

Yep. Under your TV config add “subType” and set it to tv, stb, receiver, or stick.

E.g. “subType”: “stb”

You might have to remove and re-add the TV for it to update.

Work! 👏

I found a issue. After add the TV, if i use the Control from Control Panel for volume up/down, the TV turn off.

nevermind this, now is working fine 😅 i dont know why but is working!!

masterfordev commented 4 years ago

OMG this look very nice! :D Screenshot

great work @kiwi-cam !! thanks for all!

sergoo-lbt commented 4 years ago

Everything is fine! Great beta! Low bow to you!

Faisalthe01 commented 4 years ago

the Audio Receiver icon does not appear in Remote app it still displayed as TV.

I have reported it to Apple, anyone else wanna to do that too.

kiwi-cam commented 4 years ago

the Audio Receiver icon does not appear in Remote app it still displayed as TV.

I have a feeling I might’ve got a typo in there. I’ll check soon.

sergoo-lbt commented 4 years ago

C3287CBF-05D3-45C9-9D55-ED7FBAEFDCA7

the Audio Receiver icon does not appear in Remote app it still displayed as TV.

I have a feeling I might’ve got a typo in there. I’ll check soon.

"subType”:" stb " doesn't work for me.

masterfordev commented 4 years ago

the Audio Receiver icon does not appear in Remote app it still displayed as TV.

I have a feeling I might’ve got a typo in there. I’ll check soon.

"subType”:" stb " doesn't work for me.

"subType": "stb"

masterfordev commented 4 years ago

you deleted the tv and added again?

sergoo-lbt commented 4 years ago

you deleted the tv and added again?

Yes! Deleted and added again. I'll try again.

sergoo-lbt commented 4 years ago

This time it worked! I'm sorry!