After doing some more research and thinking about it more, using hostname identifiers could actually be considered more user friendly. Though IMHO, it should be either the MAC address or the hostname. Allowing the user to enter either / both seems redundant and I’m afraid it will just confuse users.
Unfortunately I am indeed an edge-case… Kids with cheap phones stuck on Android 7. So all the fancy features in 8 or 9 of android are not at my disposal. So I will check out what you did in this release (and I understand you cannot maintain code for edge cases).
Do you mind if I fork this off to make my own adaption of this release as I might need my edge-case add-on ?
To clarify: only after a reboot the device uses a new MAC address. Which indeed is weird… (I’ve been a network engineer for 20+ years already and was baffled when I found out).
To be honest, I think there is a use case for tracking by hostname / alias (as viewed by the controller) as it’s a little more user friendly than MAC addresses.
I was thinking about this on my way to the office today and the binding could easily be adapted to accept either a MAC address or hostname as the unique identifier. However, this means the config parameter shouldn’t be called mac anymore as it would accept both MAC addresses and hostnames as valid inputs.
The other option would be to just simply accept hostnames in the MAC address parameter (as a workaround for these edge-cases) and leave it as an undocumented easter egg.
I agree with the parameters needing to have a dedicated meaning but both optional?
If they’re both optional, I could set a CONFIGURATION_ERROR status with a detail saying at least one of the mac or hostname parameters needs to be defined.
Hi there!
I’m kind of new to Openhab specially compared with you guys!
In the search of better presence detection than the one I’ve got i came across this thread and the Unifi binding. I do got a UAP and a Unifi controller running on a Raspberry but I can’t figure out how this binding is installed, is there any chance anyone can point me in the right direction and maybe give me some hints if necessary?
Thank you!
/c
very strange: I resaved my items file - Items were refreshed and the errors didn’t re-appear again.
I’ll try to re-produce the error and pull more logs as you suggested.
I added client name support so now you can define the client by the MAC address or the name. The name is as it’s seen by the controller - either the hostname or the alias that you can define via the configuration tab in the clients view of the controller.
Please test it out and let me know if you have any issues.
IMO having two “unique” identifier properties that are optional is redundant and could potentially confuse users. Since we have an edge-case where using the MAC address won’t work, I would prefer to just use the name of the client and make it required and just do away with the MAC address altogether.
I prefer having both but at least the mac address. When having multiple sites the mac address is always the same and detection always works. When only having hostnames it would mean in my case making sure that all mobile equipment is named exactly the same on 15 sites…
There may be another issue with hostnames: Not all devices register a hostname on the Unifi Controller (I am on 5.6.40)
In this case: Their hostname will display the MAC in the Name field of the Clients table.
You can set an Alias of course to overcome this.
Your 15 site setup is also an edge-case but I understand the pain of setting the same Aliases in all 15 sites
want me to TRACE the one that I am currently running (v10 = 2.3.0.201804221805 org.openhab.binding.unifi) or the latest ? (v14 = Ubiquiti Unifi Binding Feature Discussion)