I currently use Icloud - iphone device tracking along with unifi.
Is there away to disable Icloud device polling while a device is detected via Unifi?
There is no sense in polling the Iphone if we know it is home via the wifi connection.
I currently use Icloud - iphone device tracking along with unifi.
Is there away to disable Icloud device polling while a device is detected via Unifi?
There is no sense in polling the Iphone if we know it is home via the wifi connection.
I’ve created a PR to replace the default tracker. It has dynamic intervals for each individual device instead of a fixed interval for all devices linked to one account. The interval is based on the state of the device_tracker entity (in a known zone or not), the distance towards home and the battery level.
It also adds 3 new services:
In your case, you could add an automation to set the interval higher when you’re home and decrease it if you’re no longer at home (if you need to)
I’m confused, where are we on this now? I am using the iCloud component to tell if anyone is home. I understand and am experiencing the battery drain issue . I think part of what was being done here was to allow us to change the interval for each device when they were in a defined zone so that we could slow down the pings. Is that right, is that something we can do now? Sorry if it’s out there somewhere, I got kind of lost following the threads once they went over to github.
Thanks
@turboc the current icloud device_tracker uses this logic to determine the interval:
So at home, the interval should be 30 minutes. You can always change it using the device_tracker.icloud_set_interval
service. If you use a value for interval
in the service data, it will put the interval to that fixed value until you call that service again or until your device enters or leaves a zone. If you don’t use interval
in the service data, it will revert the interval back to it’s default calculated value based on the logic from above.
Thanks for your clear answer Bart.
Despite the 30 min interval when at home I still find the battery drainage very high. I also see that that the tracker has some kind of keep a live function that fires every minute. Could it be that this keep a live function also has a impact on the battery?
My understanding of the keep alive is to keep you logged into Icloud but it does no “poll” to your device.
If you are using another method for Device tracking you could have an automation set the interval very high when you are “home” and then set it back to dynamic when you leave.
One nice side effect of this, I know when my son has been spending time somewhere other than home or school, because he complains about his battery being dead.
Was there ever any issue reported here with the battery drain? I have 0.35.3 installed and hooked up the iCloud component and it seems to be draining not only the phone batteries I’m tracking, but also my wife’s iWatch that it can also see (I turned tracking off for it though). I’m not sure if the iWatch is unrelated but I’ve definitely noticed the phones (as has my wife). @Bart274
it’s mentioned in the documentation for iCloud on Hass
Yeah, and I would expect slightly more battery drain on the devices I’m tracking. I’m talking about killing a battery in four hours and killing the battery of every device associated with the iCloud account. I did some Googling on the generic issue and it seems like it might be more on Apple’s side of the house. Not entirely sure what’s going on there.
With the icloud solution, you are constantly asking the cloud to tell you where the phone is. So it has to wake the phone up and get it to read it’s GPS to tell the cloud where it is. Doing this on-demand when you are figuring out where your kids are, is no big deal. Doing it every 5 minutes, drains the battery.
Agreed, but when an interval is set at 30 minutes at home, that is 8 extra pings in 4 hours. That should not drain the battery as quickly as it seemed to be doing (I get more push notifications from Outlook per hour). And I don’t really know what the Find my iPhone API looks like or how it works, but I would hope you could specify individual devices to ping instead of also having to ping untracked devices (which were also draining quickly).
Honestly though, It looks like it is a bigger issue than this component from Googling around the Apple Q&A areas.
Yes, it is a bigger problem, and it is apples problem. And I agree it shouldn’t kill your battery at one ping every 30 minutes. But the reasons you are describing are the reasons I went away from iCloud for presence detection. I just haven’t found anything I like to replace it yet.
Hi Bart274,
Wondering if you could help - for the life of me, I can’t figure out what the device_name to put in when calling icloud_lost_iphone. Is it the device_tracker.devicename or is it just device name without device_tracker, or is it the actual device name in iCloud? Also, my iCloud device name is Sherwin’s iPhone 6S. Does the device name support the apostrophe? Much appreciated. Thanks.
I think they show up in known_devices once you configure your iPhone account in the configuration.yaml file correctly. Right???
Yup it does, but I tried device_tracker.device name and just the device name, and even the name I use in iCloud for the device but no dice. Could be because the icloud device name has an apostrophe in it? “Sherwin’s iPhone 6S”. I know the service works since if I leave out the device name, it’ll do a lost iphone call to all the devices, and they react accordingly.
Sorry I missed this for so long. If it’s still a problem, try it without the apostrophe in it. I always try to shy away from those because they make quoting things a bit of a pain.
I had to remove the apostrophe from my iphones name to solve a number of problems within HA. I can remember exactly the issue I was having but it fixed my issues.
Thanks! Will try it again and hope it works. I also removed the apostrophe on my iphone name just to remove all uncertainty, as suggested by the others in the thread.