iCloud device data integration in openHAB

The binding doesn’t communicate with your phones, but with icloud, so it can’t affect the battery of your phone.

That’s right and somehow not, because iCloud checks every time the position of all of your iDevices, see: https://community.openhab.org/t/icloud-device-data-integration-in-openhab/32329/44?u=syn

I have this issue with an iPhone 6, too. I have it set at polling every 5 minutes. Before, I would only use 40% of my battery during the day, but with the iCloud binding polling, I needed to recharge my phone around dinner time.

Hi!

Can you please check if you can increase the time to more than 10 Minutes?

Thanks

I will try and set it to 9 minutes first, then to 10 minutes and report back here.

Update: running iT every 9 minutes went fine. Then i changed the update interval to 12 minutes, 5 times an hour, and that seems to be running fine, too.

I was wrong after all.

The test I did was to have a rule check for a change of the LastUpdated channel. That channel is updated every 12 minutes, but it appears that (for example) the battery value is set to ‘0’. I will rerun some tests, while testing for the battery channel. To be continued.

jup,

my items are set to init values as well when i set the refresh time to something greater than 9 minutes.

is there any news on the battery-consumption issue?

thanks!

Battery consumption probably cannot be influenced other than increasing the poll time. This is how find my friends works. You ask Apple for a location and Apple pings the device. The more pings the more battery consumption.

Hi all,

I’ve just discovered the binding and installed it.

As written in the doc’s I’ve created a icloud.things file. But when looking into PaperUI I only see this error:

Server returned HTTP response code: 401 for URL: https://fmipmobile.icloud.com/fmipservice/device/someone@mac.com/initClient

Hope one of you has a hint for me…

Hi

I have been playing a lot with this bundle, and it was working great. I say “was” because this WE, I changed my timezone (in order to get the right time), and since, the binding doesn’t work anymore.

I changed the /etc/timezone to be Europe/Brussels

The error in openHab.log is :+1: 2018-03-13 08:57:17.295 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method ‘ThingHandler.thingUpdated()’ on ‘org.openhab.binding.icloud.handler.ICloudDeviceHandler@12bfcbe’: 2018-03-12T18:28:24CET is not in a valid format.
java.lang.IllegalArgumentException: 2018-03-12T18:28:24CET is not in a valid format.

Any idea to workaround this ?

Hi Karl,

I’ve updated some code in the binding in the area of date/time parsing - do you use OH 2.2 release, or cutting edge snapshots? In the 2nd case we can verify the fix/change to see if it solves your problem once the PR is merged:

If you use snapshot you can also try a CI build of the binding to verify it. Please note that the CI probably won’t be compatible with OH 2.2 release.

with kind regards,
Patrik

I’m using this on OH 2.2.0 :

206 │ Active │ 80 │ 2.2.0 │ iCloud Binding

Installed via paperUI

None of you a hint for me on my issue?

@mircsicz Hi Mirco,

can you try configuration using paper UI to x-check if it still fails? 401 is an authorization problem; note that application specific passwords are not supported by the binding.

with kind regards,
Patrik

@patrik_gfeller I’ve already tried both ways…

First setup was using the console, then I reentered the passwd through UI several time’s. And yes I’m aware of App specific passwd’s, read it in the doc’s before I started…

I copy&pasted my login passwd tried it on icloud.com in the browser and pasted it into pUI right away, but it didn’t work out! :frowning:

@patrik_gfeller Rechecked the passwd in icloud.things and realized PaperUI never updated the passwd. I had one character to much in my passwd… removed the typo from the things file and tada Inbox is loaded!!!

THX for helping my wrap my head around it once more!!!

But I’ld consider it a bug that the pUI isn’t updating the things file! So as an EBI I’ld at least wish that to be mentioned in the doc’s… :wink:

Marcus,
How did you add a second account to the iCloud binding? I use the paperUI and don’t see any option to do it.

add another thing for the icloud binding

Ok, I was able to add a another iCloud account. But the binding is not finding any devices, like it did with the first account I added. In the paperUI the account shows its “Online”. Any ideas for getting it to find the devices.

Hello everybody,

I’ve explored the iCloud Binding a little bit more on the weekend.

First I switched from an old BETA version to the current release in 2.3.0 snapshot.

When integrating two iCloud accounts, I noticed that I also see the devices of the second iCloud account, via the family sharing, in the Paper UI Inbox.
The devices from the family sharing, do not provide the location but only for example the battery level back.
So I had to be careful when integrating things, which device I would add, came over which iCloud account.
After a few new rules (distance from home, formatted Address) I had achieved the status as with the BETA Binding.

Now I was interested, after I had read here of the many battery consumption, how big this is?

I had a test iPhone SE configured for this as follows:

  • The device had only the basic device configurations after reset.
  • Mobile -> connected to 4G (3-4 bars)
  • Wi-Fi -> on and connected (good connection)
  • Bluetooth -> off
  • Location service -> on

The battery was always fully charged (100%) for the test and operated for exactly 12 hours on battery power (8 am to 8 pm).

  1. Without iCloud integration, the battery still had 95% after 12 hours

  2. With iCloud integration and a refresh interval of 10 min. still 91%
    image

  3. With iCloud integration and a refresh interval of 5 min. still 86%
    image

From this it can be deduced, for the iphone SE, that within 12 hours the battery consumption by the iCloud binding with a refresh time of 10 min. -> 4-5% and at 5 min. -> 9-10%.

What can still be stated is that with every refresh the binding sends a request to the iCloud account and from the iCloud account at the same time a request is sent to the devices.

This means at a refresh time of 10 min. the scanned values are between 10-20 min. old.
At a refresh time of 5 min. correspond to 5-10 min. old.

So if you want to get a current value, you have to send the refresh twice in the case of a manual refresh (see Binding description), because the returned value is always from the previous request. Between the two refreshes should be 10-15 seconds.

Furthermore, in case of a manual refresh of the location for a device, a request will be sent from the account to all devices of the iCloud account!

image

Maybe this will help one or the other …

2 Likes