I’m also going to move to the ‘find-my-iphone’ to replace the broken API calls used in the fmip package from pimatic-phone.
-
Pimatic phone icloud error
-
@bstrebel said in Pimatic phone icloud error:
I’m also going to move to the ‘find-my-iphone’ to replace the broken API calls used in the fmip package from pimatic-phone.
A preliminary hot fix (with some limitations) is available with pimatic-phone@0.5.0. See fmip@3.0.1 for details.
-
Seems to be working with phone plugin 5.0. but i get a message every 60 seconds with an generated code. If i type the code after the password, i get an icloud error
-
As of Rev. 0.6.2 pimatic-phone now uses a complete new session based iCloud client module. See GitHub README for details. The plugin is thoroughly tested with my Apple ID but please have a close look on your debug enabled pimatic daemon log and send me any error message and stack traces …
-
hey @bstrebel,
to get informations from my iphone, I have to log in via 2-factor authentification. Does your plugin work with 2fa?
-
I have experienced that, even with 2FA enabled, the verification code is not really required. 2FA is activated for my account but the plugin is able to establish a iCloud session and retrieves location updates for the device without any verification code. I just ignore the notification email and the 2FA pop up on the device. The notificatians are generated only once, wenn the session is established on pimatic startup. I think you should give it a try …
-
I have another question. Would it be possible to trigger the position of an device by a rule and not with a interval? This could save a lot of accupower on the phone. I’m thinking of situations like, when i’m at home and my phone is connected by wifi i don’t need the gps location service and use this service only when i’m not connected to my wifi.
regards daice
-
This post is deleted!
-
So, I have a Problem with the actual Version:
After the initial adding of two devices (one with 2-factor-auth, one without) both devices update their location.
I set the interval to 1200 seconds, but when they try to update i get this error:Device update of “iphone” failed, ICloudError: Unknown error [450]
I had one device activated today with a interval of 600, wich worked, but then i changed the interval to 1200 and now it doesnt update.
i will wait if it successfully updates once in the next hours and if not set it back to 600 and report back -
@theslashy , thanks for the report. I’ll try to reproduce the error. I remember, I got the 450 response during testing when deleting the cookie of an established session…
-
@bstrebel said in Pimatic phone icloud error:
@theslashy , thanks for the report. I’ll try to reproduce the error. I remember, I got the 450 response during testing when deleting the cookie of an established session…
Perhaps something related to this:
when I edit the Phone Device it doesnt show any location but in the debug info I see[pimatic-phone] debug: Update location for iPhone-5: GPS:xxxxxxxxxxxxxxxxx,xxxxxxxxxxxxxxxxxxxxxxx
(with the real coordinates)
-
@bstrebel said in Pimatic phone icloud error:
I have experienced that, even with 2FA enabled, the verification code is not really required. 2FA is activated for my account but the plugin is able to establish a iCloud session and retrieves location updates for the device without any verification code. I just ignore the notification email and the 2FA pop up on the device. The notificatians are generated only once, wenn the session is established on pimatic startup. I think you should give it a try …
One thing to this:
Just create a code on your iphone and add the code to the end of your password, works for me
-
@theslashy said in Pimatic phone icloud error:
@bstrebel said in Pimatic phone icloud error:
I have experienced that, even with 2FA enabled, the verification code is not really required. 2FA is activated for my account but the plugin is able to establish a iCloud session and retrieves location updates for the device without any verification code. I just ignore the notification email and the 2FA pop up on the device. The notificatians are generated only once, wenn the session is established on pimatic startup. I think you should give it a try …
One thing to this:
Just create a code on your iphone and add the code to the end of your password, works for me
Could you pls. provide a step-by-step description how you manage this? How do you create a verification code? I get the verifaction code popup after log in (without code) during device initialization. I’m not able to use this code for the next client session (with other ID, cookies, etc. …) by appending it to the password. I get a failure on login …
-
@theslashy said in Pimatic phone icloud error:
@bstrebel said in Pimatic phone icloud error:
@theslashy , thanks for the report. I’ll try to reproduce the error. I remember, I got the 450 response during testing when deleting the cookie of an established session…
Perhaps something related to this:
when I edit the Phone Device it doesnt show any location but in the debug info I see[pimatic-phone] debug: Update location for iPhone-5: GPS:xxxxxxxxxxxxxxxxx,xxxxxxxxxxxxxxxxxxxxxxx
(with the real coordinates)
I could reproduce the error in my environment and found that an idle session has to be refreshed every 10 minutes. Unfortunately this refresh call doesn’t work with 2FA enabled accounts. As a short term fix, I could implement the session refresh for 2FA disabled accounts with location update intervals > 10 minutes. Until I found a suitable solution to handle the interactive management of a verification code in a background task like the pimatic-phone plugin, we stick with high update rates (interval < 10 minutes) for 2FA accounts. Curious enough, the the location updates are working without any verification code.
-
@bstrebel
Great, thank you for your work.
I’ll try to sum up what I’m doing.
I have two devices, one with 2FA, one without.
To Generate a Code for 2FA:
Go to the Settings App->icloud->Tab the top button(your icloud account)->Password&Security->Last Button (Get Verification Code)I append this Code directly to the password in the Device setting in Pimatic, as described by apple in the link I provided a few posts up.
I’ll try to set both devices to refresh every 9 minutes and see what happens.
The Problem is that calling the location every 9 minutes will likely drain the battery of the phone, and a interval of 60 or 30 minutes would be enough I think
-
@theslashy said in Pimatic phone icloud error:
@bstrebel
Great, thank you for your work.
I’ll try to sum up what I’m doing.
I have two devices, one with 2FA, one without.
To Generate a Code for 2FA:
Go to the Settings App->icloud->Tab the top button(your icloud account)->Password&Security->Last Button (Get Verification Code)I append this Code directly to the password in the Device setting in Pimatic, as described by apple in the link I provided a few posts up.
I’ll try to set both devices to refresh every 9 minutes and see what happens.
The Problem is that calling the location every 9 minutes will likely drain the battery of the phone, and a interval of 60 or 30 minutes would be enough I think
Thanks for the explanation. I didn’t recognize the option to generate the code in advance on the iOS device. With password+code the login works without a popup on my iPad. But I’m still not able to use validate() or refreshWebAuth() on such a 2FA session to keep the client idle without requesting the iPhone . I also found that none of the public available Javascript or Python examples work as expected if you have a closer look on them. At the moment, after testing several clients I cannot login with password+code but also the warning popups are missing. The iCloud API is going to drive me crazy …
-
@daice said in Pimatic phone icloud error:
I have another question. Would it be possible to trigger the position of an device by a rule and not with a interval? This could save a lot of accupower on the phone. I’m thinking of situations like, when i’m at home and my phone is connected by wifi i don’t need the gps location service and use this service only when i’m not connected to my wifi.
regards daice
Assuming you are talking about an iOS device, I would take this as an interesting feature request. I see at least two different solutions: (a) let the pimatic-phone plugin check if the device is available and suspend iCloud requests in this case (b) use pimatic-ping plugin to check device presence and trigger a rule to suspend location updates through a new API call to pimatic-phone. Both require you to configure your DHCP-Server/WLAN-Router to use a static IP address for your phone.
The situation looks completely different for Android devices where the phone itself updates it’s location directly via an API call to your pimatic server. You can use tools and apps as described in the documentation to handle location updates with very low power consumption.
Maybe, someone develops an iOS app which uses the pimatic-phone API for efficient location updates without the need of periodically iCloud pushes.
-
@bstrebel I’m looking at a few alternatives at the moment. Thought I’d be nice to share them.
-
Owntracks
I tried setting up a MQTT server because I did not want my location to be shown to everyone who uses Owntracks. This was pretty complicated and the mqtt had to be opened to everyone which I don’t really like. -
IFTTT
With the maker channel you could create a web request to your Pimatic which alters a phone variable when you leave / enter a place. At first I thought this was the perfect solution, but then I realized I had to add my pimatic credentials in the URL. This did not feel safe. -
HomeKit
@Lex has homekit based solution: https://forum.pimatic.org/topic/2753/solution-for-ios-location-based-automation/2 but this does not work for me because I don’t have a iPad or AppleTV
All of them are not perfect solutions, I’m wondering if I missed something.
-
-
@bstrebel
I had it running the whole day and it worked and my location was logged the whole day.
Unfortunately it completely sucked my battery dry … -
@theslashy said in Pimatic phone icloud error:
@bstrebel
I had it running the whole day and it worked and my location was logged the whole day.
Unfortunately it completely sucked my battery dry …Sorry for that … Which settings did you use for the iCloudInterval? With the old default settings of 1 minute I have no problem with my iPad while the iPhone6s of my wife gets sucked. BTW, just published Rev. 0.7.2 which may be of interest for you. You will find my comments on iOS devices at the beginning of the documentation