iCloud Binding Communication Error

Really appreciate Fabio. Many thanks!

That would be a very welcome support, does ithe lib support 2FA? Any ideas how the input of the code could be integrated into the startup process, normally there is no user interaction, …

I tried now a different approach. I still had a vm with a test-installation of Home Assistant. The icloud3 addon for HA has a lot of features and it seems, it doesn‘t have the 2 month reauthentication restriction. So all states of HA are published via MQTT. In OH I read the values from MQTT. For interaction with HA (like forcing a refresh or triggering a message) I use the HA Rest API and trigger it via OH sendhttppostrequest.

This setup might be an overkill for most users and as I am a completely beginner with HA, it took me a lot of time to get it sorted…

Please have a look at EchoControl binding, there is a separate page for such.

Else implement it as a second config param the user can set after receiving the code.

Hi, since the current iCloud Binding is very instable I created a little wrapper around the pyicloud lib and publish the device data to a mqtt broker.

Please be aware that this was quickly ‚hacked‘ and errors are likely to appear :wink:
Error reports or Pull requests are very welcome.

1 Like

Another simple workaround (with support for 2FA/2SA):

I used the iCloud binding for detecting sleep mode (=iPhones are all in Flight Mode) and presence detection.

For presence detection I´m using now GPS tracker (own tracks on iOS) and for the sleep mode I´m building a scale using ESP32 controller and weight modules to check the weight of our bed to determine if sleep mode should be activated or not.

Anyhow I would like to see this binding working again. Thanks for your effort!

Hello everyone,
I would also be very happy if this binding works again.
It does exactly what I need and it’s easy to configure…

Maybe you should set up a donate button on Github :wink:

Thank you for the work.

Does anybody know where I can found some documentation about the iCloud API (Rest API doc, Authentication)?

I created a prerelease working version: Release proof-of-concept-1 · maihacke/openhab-addons · GitHub

Also see discussion here [iCloud] Bridge-Thing generates Communication Error · Issue #13282 · openhab/openhab-addons · GitHub

6 Likes

This are good news. Thanks for your effort. But i am not able to input the code using MainUI because there is no field for this. My thing config is within a json-file under userdata.

Can you give me a hint?

You have to provide it in the thing config file:

Bridge icloud:account:simon [appleId="", password="*", code="XXXXXX", refreshTimeInMinutes=5]

2 Likes

I have seen this within your description. But my json file format looks like this and is created by MainUI. Can i modify the json in order to do the job?

"icloud:account:62ba8ace": {
    "class": "org.openhab.core.thing.internal.ThingStorageEntity",
    "value": {
      "isBridge": true,
      "channels": [],
      "label": "iCloud Account Willi",
      "configuration": {
        "appleId": "willibald.konrath@t-online.de",
        "password": "xxxxxx",
        "refreshTimeInMinutes": 5
      },
      "properties": {},
      "UID": "icloud:account:62ba8ace",
      "thingTypeUID": "icloud:account",
      "location": ""
    }

Where needs an icloud.things (not a .config) file to be stored and how does it come together with my json file? Sorry for this kind of questions but i am a MainUI user type.

I have tested it…it’s working…Thank You!!!

What you are referring to is the json db. I’m not sure if it works to add it there. I meant a .things file in the config dir.

1 Like

Understood now. Is my first xxx.things file. Took a while because i am not a text config user.

Works for me, asked for access confirmation cipher code twice.
Thanks a ton for the effort!

The discovery seems to double work since I configured two apple account bridges in the thing file.

Stored the icloud.things file using the same account ID “62ba8ace” as in my old json database file and it does the job using the existing account thing :smiley:.

Many thanks so far.

Bridge icloud:account:**62ba8ace** [appleId="willibald.konrath@t-online.de",
1 Like

Understood, thats also interesting. I will try to find out how to add the config to the UI.

1 Like

Adding the code to the UI was very easy. Created a new release for that:

4 Likes