-
-
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
[hdpowerview] Wrong re-discovery of existing Things #18149
Comments
The binding does already implement representation properties. So we need to find out more about what is going wrong in your particular system. Can you please give information about 1) your Thing and Item configurations, and 2) your LAN configuration? And concerning the latter, is your system LAN using IPv4 or IPv6 or both? |
The LAN uses IPv4. Here's the code. Thing:
Items (one shade included; the others follow the same pattern):
Repeater:
Scenes & Automations:
|
Ok. Many thanks. So what are you seeing resp. not seeing in the Inbox? |
Also: is your Gen 2 Hub connected via Ethernet or via WiFi (or both)? I see that you have configured the hub to use a host name rather than an Ip address. If the hub is connected via both Ethernet and Wifi then it will have different Ip addresses on each interface. And probably the host name applies to one or other of those Ip addresses but not both. In which case the hub will indeed present as two hubs in the Inbox since the representation property is the Ip address (or the mac address , I forget; but either way each interface has separate Ip addresses and mac addresses). |
The Gen 2 Hub is connected via Ethernet only. The address is 192.168.2.190. I used the hosts file to translate the name, which resolves to 192.168.2.190. This is the same address that is always discovered. Is it possible that the binding itself is seeing that the hub name is different from its IP address? |
I've reverted to using the IP address instead of the host name. Perhaps this will change the behaviour. |
Yes, the problem is that the hostname/IP address is used as representation property, and the IP address found by discovery doesn't match your configured hostname. |
I"m at my phone now, but did a quick check. I think we could switch to using serial number as representation property. It requires an additional call (I think), but we already have one call to detect generation 1/2, so that's probably not a big issue. Alternatively we could resolve the hostname, but it still feels awkward to use it as representation property. WDYT, @andrewfg? |
@jlaur in principle we could use either the serial number or the host name. In the former case the discovery services must make an extra HTTP call to read it, whereas in the latter case they must do a host name lookup. I think the overhead is trivial either way. Nevertheless I do more strongly support using the serial number rather than the host name for the following reasons.
|
I agree, that was also my primary and preferred proposal. 👍 |
@jlaur shall I create a PR or do you prefer to do it yourself? EDIT I already started work on it :) |
Thank you both for your quick attention. Your efforts are truly appreciated. |
Your Environment
The binding works very well, but keeps auto-discovering my Hunter-Douglas PowerView Gen 2 Hub, even after ignoring it.
According to the following, https://www.openhab.org/docs/developer/bindings/thing-xml.html#representation-property, a representation property is used to auto-ignore discovery results of Things that already exist in the system. This can happen if, a) a Thing has been created manually, or b) the Thing has been discovered separately by two mechanisms e.g. by mDNS, and by NetBios, or UPnP. If this is the case, the Thing in the inbox is automatically ignored. Note that this Thing is automatically removed when the manually added Thing is removed. A new discovery would then automatically find this Thing again and add it to the inbox properly.
See also Implementing a Discovery Service
It would be great to add this feature.
The text was updated successfully, but these errors were encountered: