-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[hue] Fix assignment of serial number property #6094
Conversation
…like tht mac address Signed-off-by: Christoph Weitkamp <[email protected]>
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/bug-in-persistentinbox/82031/3 |
Signed-off-by: Christoph Weitkamp <[email protected]>
Signed-off-by: Christoph Weitkamp <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This pull request has been mentioned on openHAB Community. There might be relevant details there: https://community.openhab.org/t/hue-auto-discovery-finds-the-same-bridge-all-the-time/39689/5 |
Hi @cweitkamp, I think this issue is still not fixed: I am running the latest snapshot which I downloaded today, so I believe that the binding JAR file is indeed a build that does contain your changes (??) Anyway, with this version I am still getting lots of the following discovery messages every few minutes. Note that this relates to the discovery of my own Hue Bridge which is a) instantiated as a Thing via my .things file, and b) is nevertheless also being repeatedly discovered in the Inbox.
Note 1) it's just an idea, and may or may not be the cause of the problem, but please notice that there is different capitalisation of the hex 'C' in the following attributes..
Note 2) when I click on the discovered bridge in the Inbox, and to try to instantiate it, then I get an error message "not found"..
|
PS you may be interested to see the following interleaved reports between openhab.log and events.log, which show that the bridge is in fact being repeatedly added and DELETED again from the Inbox..
|
@andrewfg There was a second bug in OHC causing duplicate inbox items (see openhab/openhab-core#1051). Now the interesting question is: Which OH version are you using? |
I am using OH 2 version 2.5.0-SNAPSHOT whatever is the current snapshot for today October 13th (build #1721) |
I have been doing a bit more snooping.. In the DiscoveryResult JSON database (org.eclipse.smarthome.config.discovery.DiscoveryResult.json) there is the following entry for the hue hub. => Note that it has four properties "ipAddress", "protocol", "serialNumber" and "port"..
In the UpnP discovery code (HueBridgeNupnpDiscovery.java) the DiscoveryResult creates two properties "ipAddress" and "serialNumber"; so I was wondering where the extra two properties are coming from..
Therefore I looked through the remaining hue code, and found another module (HueBridgeDiscoveryParticipant.java) that also produces a DiscoveryResult with four properties..
So I am wondering if the problem is perhaps due to some kind interference between these two different discovery processes ?? |
Yup, it very much seems that the binding is running two different discovery services in parallel
|
Signed-off-by: Christoph Weitkamp <[email protected]>
Signed-off-by: Christoph Weitkamp <[email protected]>
Signed-off-by: Christoph Weitkamp <[email protected]> Signed-off-by: Tim Roberts <[email protected]>
Signed-off-by: Christoph Weitkamp <[email protected]>
The serial number is the representational property of discovered devices. If we overwrite it with a wrong value the same device will be discovered again and again. The calculation of the serial number from the bridge id is derived from nUPnP discovery:
https://github.com/openhab/openhab2-addons/blob/a1d1c9cc3762ffee08c455a4d1928b1f82868a25/bundles/org.openhab.binding.hue/src/main/java/org/openhab/binding/hue/internal/discovery/HueBridgeNupnpDiscovery.java#L89
Signed-off-by: Christoph Weitkamp [email protected]