-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
Merge UniFi device tracker to config entry #24367
Merge UniFi device tracker to config entry #24367
Conversation
Hey there @Kane610, mind taking a look at this pull request as its been labeled with a integration ( This is a automatic comment generated by codeowners-mention to help ensure issues and pull requests are seen by the right people. |
Pretty please let us filter which devices the tracker will pull off the unifi controller. The current tracker allows for filtering by site, ssid etc.- if you just import everything that will be a mess. |
@olbjan when config entry options are supported in the front end, a lot of configuration is possible. Site is already part of the configuration, so a new config entry per site. I will look into keeping the current configuration when importing to a config entry |
Why would it be a mess? You can just choose to not show the entities in the Lovelace UI? |
The UniFi controller can eg host multiple homes as different sites - or depending on the setup you may be tracking hundreds of devices even though they're not shown just to get the few that are actually interesting to you. We use HA at work for the office and I would eg not want it to track every cellphone connected to the guest wifi ssid whilst I may be interested in the devices on the IoT ssid. |
Seems like a valid use case 👍 Let's start with keeping that config in configuration.yaml and we can migrate it later to config flow options. |
9ad1a28
to
164be49
Compare
@balloob should we define what data which is interesting for this entity type and make properties for them all? We got a possibility to shape up a lot of data here. |
Yes, but let' keep it rather simple. For now maybe just implement an entity that has it's own |
Sure will look at that next |
83ac745
to
59a379a
Compare
@balloob isnät what you want just having each network device exposing a last_seen property? |
It's not just last seen. Each entity will have to schedule an update when the last seen property passes over the threshold that it is considered not home. |
@balloob something like this? |
5aeb9de
to
533d9ff
Compare
133e0df
to
e2e9ee3
Compare
113386d
to
9d32e4a
Compare
8fac508
to
30b85c1
Compare
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.
Looks good!
From the breaking changes paragraph:
This sentence sounds a bit weird. Should it start: "If configuring SSID filter or detection time you will need to..."? |
Are you planning on adding GPS coordinates? Ultimately, so I can track the same device with via the home assistant app on IOS... This is how I was doing it prior. I see this in the logs when I update my location via IOS: If not, I suppose I can make 2 devices for the same phone and tie them together via the person. Seems silly, but a pretty easy workaround. |
Tying things via person integration is the way forward. Also, we should not discuss things on closed PRs. |
Breaking Change:
Device tracker is now part of config entry. After initial import the unifi device tracker configuration is no longer needed. If configuring SSID filter or detection time you will need to use the new configuration from UniFi. See UniFi component documentation for details.
Description:
Allows migrate device tracker unifi configuration to config entry
Removes requirement to have an admin level account, controls are moved to the switch platform
Additional configuration handled from unifi: level.
Related issue (if applicable): fixes #24895, #23490, #21636, #19301, #14663
Pull request with documentation for home-assistant.io (if applicable): home-assistant/home-assistant.io#9847
Example entry for
configuration.yaml
(if applicable):Checklist:
tox
. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
python3 -m script.hassfest
.requirements_all.txt
by runningpython3 -m script.gen_requirements_all
..coveragerc
.If the code does not interact with devices: