Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[roku] representation-property seems to be tied to an unused field #16164

Closed
morph166955 opened this issue Dec 31, 2023 · 9 comments · Fixed by #16210
Closed

[roku] representation-property seems to be tied to an unused field #16164

morph166955 opened this issue Dec 31, 2023 · 9 comments · Fixed by #16210
Labels
bug An unexpected problem or unintended behavior of an add-on

Comments

@morph166955
Copy link
Contributor

I noticed that my inbox has entries for all of my Roku devices despite them being added already. I believe this may be due to the fact that the representation-property in the xml is tied to a uuid field which doesn't seem to exist. From what I can tell this may need to be changed to the serial number instead.

https://github.com/openhab/openhab-addons/blob/706ae583239d0fbfaffd8d38564fdbf62697f56b/bundles/org.openhab.binding.roku/src/main/resources/OH-INF/thing/roku.xml#L34C4-L34C27

@morph166955 morph166955 added the bug An unexpected problem or unintended behavior of an add-on label Dec 31, 2023
@mlobstein
Copy link
Contributor

Did you add the Roku things manually? In that case the uuid is not set on the thing and the discovery service will pick them up again. The discovery debug should look like this:
image

Is this a TV? I also just noticed that the label for a TV (model name + model number) in the inbox is not very friendly when compared to a non-tv Roku device.

@morph166955
Copy link
Contributor Author

Yes, these were manually added TVs. It's my understanding that the intention is even manually added devices should be able to be tracked to orevent duplicate entries in the inbox. Perhaps the uuid field needs to be exposed to be manually set in this case? Could you rely on the serial number or something else that's discoverable instead?

@mlobstein
Copy link
Contributor

mlobstein commented Jan 5, 2024

Right now the uuid is the serial number obtained from the ssdp packet. I guess the thing configuration could be updated by the handler to add the uuid/serial number. Something like this maybe (AFAIK, won't work on things provisioned from a file):

Configuration configuration = this.getConfig();
configuration.put(PROPERTY_UUID, serialNumber);
this.updateConfiguration(configuration);
this.thingUpdated(this.getThing());

Or just use the ignore button in the inbox?

@morph166955
Copy link
Contributor Author

Given that uuid is just the serial number, is there any reason for uuid to exist at all? My understanding of representation-property is that as soon as the property is set (either through discovery or once it comes online and the binding sets it) the inbox will auto match and hide it.

@mlobstein
Copy link
Contributor

Given that uuid is just the serial number, is there any reason for uuid to exist at all? My understanding of representation-property is that as soon as the property is set (either through discovery or once it comes online and the binding sets it) the inbox will auto match and hide it.

Try adding this in RokuHandler line 116:

thing.setProperty(PROPERTY_UUID, deviceInfo.getSerialNumber().toLowerCase());

@morph166955
Copy link
Contributor Author

I'll make a branch and try to monkey with it this weekend.

@morph166955
Copy link
Contributor Author

morph166955 commented Jan 6, 2024

That worked for the roku_tv devices in the inbox. I still get a duplicate entry of roku_player for 6 out of 10 of them (and it's unclear to me why 4 don't show up, they all have the proper is-tv in the xml).

@morph166955
Copy link
Contributor Author

@morph166955
Copy link
Contributor Author

morph166955 commented Jan 6, 2024

I have a possible answer to the 6/10 issue. Those devices are all new in the house. I'm wondering if while they were going through the setup process they were not announcing properly as TVs. I deleted and rescanned and now they aren't coming back.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants