I also have IPhone 15 with OH4.1 For me it works in general. The problem pops up every few month for an older phone. Disabling and reenabling the device worked for me every time. The offline status is reported by icloud - it’s not clear when. But I still think there is an issue in the binding, which does not recover from that state.
So if you like to help, activate debug or tracing logging for the binding and post logs here when the issue arrises.
I posted my trace on the GitHub issue. For me, it’s not an issue of the phones dropping out after a while. My 15 stays online and never goes off. The only issue is the find my phone feature fails immediately when initiated with a timeout error code (see trace log on GitHub). It seems like whatever OH is sending to the iCloud API for that command is not what the server is expecting.
Marty
which version are you using?
4.1. My symptoms started on 4.0.x. Not sure which one.
For what it’s worth, I use the PyiCloud python module now, and I’ve been getting an increasing number of errors trying to connect recently. It may be an issue (or “feature” from Apple’s perspective) on Apple’s end.
Which one?
I’m still facing issues … sad about.
Does anyone find a solution for? I’ve removed things and reintalled binding but still no luck, it’s getting error “Reported offline by iCloud webservice”
Since today one of two bridges shows offline, invalid credentials. As nothing has changed, this is strange. Furthermore the credentials work in apple Webinterface :-/
If others have same issue coming up there may be some new changes by apple?
2024-08-27 22:57:20.186 [DEBUG] [icloud.internal.ICloudHandlerFactory] - bundle org.openhab.binding.icloud:4.2.1 (278)[org.openhab.binding.icloud.internal.ICloudHandlerFactory(359)] : Querying state active
2024-08-27 22:57:20.187 [DEBUG] [nternal.ICloudTlsCertificateProvider] - bundle org.openhab.binding.icloud:4.2.1 (278)[org.openhab.binding.icloud.internal.ICloudTlsCertificateProvider(360)] : Querying state active
2024-08-27 22:57:32.768 [DEBUG] [l.handler.ICloudAccountBridgeHandler] - iCloud bridge handler initializing ...
2024-08-27 22:57:32.769 [DEBUG] [l.handler.ICloudAccountBridgeHandler] - iCloud bridge handler initialized.
2024-08-27 22:57:34.350 [DEBUG] [l.handler.ICloudAccountBridgeHandler] - Starting iCloud authentication (AuthState=INITIAL, Thing=icloud:account:accountname)...
2024-08-27 22:57:34.350 [DEBUG] [inding.icloud.internal.ICloudService] - Checking session token validity
2024-08-27 22:57:34.350 [DEBUG] [inding.icloud.internal.ICloudSession] - iCloud request POST https://setup.icloud.com/setup/ws/1/validate.
2024-08-27 22:57:34.450 [DEBUG] [inding.icloud.internal.ICloudService] - Token is not valid. Attemping new login.
2024-08-27 22:57:34.451 [DEBUG] [inding.icloud.internal.ICloudService] - Authenticating as NAME@DOMAIN.DE...
2024-08-27 22:57:34.451 [DEBUG] [inding.icloud.internal.ICloudSession] - iCloud request POST https://idmsa.apple.com/appleauth/auth/signin?isRememberMeEnabled=true.
2024-08-27 22:57:35.655 [DEBUG] [inding.icloud.internal.ICloudSession] - iCloud request POST https://setup.icloud.com/setup/ws/1/accountLogin.
2024-08-27 22:57:35.838 [DEBUG] [inding.icloud.internal.ICloudService] - Invalid authentication.
I’m not having these issues.
Ok, thanks. Some hours later bridge logs in again. Hope it had been only a temporarily issue and not a change by Apple.
It seems there was another change at iCloud.
Atleast my binding says the credentials are invalid while i´m still able to login with the exact same credentials when using at icloud(dot)com.
When activating the TRACE log of the iCloud binding, i can see an unavailable message.
2024-11-02 12:15:27.549 [DEBUG] [l.handler.ICloudAccountBridgeHandler] - iCloud bridge handler initializing ...
2024-11-02 12:15:27.549 [DEBUG] [l.handler.ICloudAccountBridgeHandler] - iCloud bridge handler initialized.
2024-11-02 12:15:27.551 [DEBUG] [l.handler.ICloudAccountBridgeHandler] - Starting iCloud authentication (AuthState=INITIAL, Thing=icloud:account:openhab)...
2024-11-02 12:15:27.551 [DEBUG] [inding.icloud.internal.ICloudService] - Checking session token validity
2024-11-02 12:15:27.551 [DEBUG] [inding.icloud.internal.ICloudSession] - iCloud request POST https://setup.icloud.com/setup/ws/1/validate.
2024-11-02 12:15:27.552 [TRACE] [inding.icloud.internal.ICloudSession] - Calling https://setup.icloud.com/setup/ws/1/validate
Headers -----
java.net.http.HttpHeaders@db4184c6 { {Origin=[https://www.icloud.com], Referer=[https://www.icloud.com/]} }
Body -----
null
------
2024-11-02 12:15:27.767 [TRACE] [inding.icloud.internal.ICloudSession] - Result https://setup.icloud.com/setup/ws/1/validate 421
Headers -----
java.net.http.HttpHeaders@a064eb71 { {access-control-allow-credentials=[true], access-control-allow-origin=[https://www.icloud.com], access-control-expose-headers=[X-Apple-Request-UUID,Via], cache-control=[no-cache, no-store, private], connection=[keep-alive], content-length=[1382], content-type=[application/json; charset=UTF-8], date=[Sat, 02 Nov 2024 11:15:27 GMT], server=[AppleHttpServer/b866cf47a603], strict-transport-security=[max-age=31536000; includeSubDomains;], via=[xrail:mr47p00ic-qujn01091102.me.com:8301:24R554:grp23,631194250daa17e24277dea86cf30319:2b63de37ad44eaf1a99ab6426a39467c:nlhfd1], x-apple-edge-response-time=[132], x-apple-request-uuid=[323392a6-3f65-4a8b-861d-9234ffe707b3], x-apple-user-partition=[30], x-responding-instance=[setupservice:33000401:mr21p30ic-ibaf07200201:8001:2427B451:ff1f862c13ba]} }
Body -----
{"success":false,"requestInfo":[{"country":"DE","timeZone":"GMT+1","region":"NW"}],"configBag":{"urls":{"accountCreateUI":"https://appleid.apple.com/widget/account/?widgetKey=...#!create","accountVerifyUI":"https://id.apple.com/identity?widgetKey=...","accountLoginUI":"https://idmsa.apple.com/appleauth/auth/signin?widgetKey=...","accountLogin":"https://setup.icloud.com/setup/ws/1/accountLogin","accountRepairUI":"https://appleid.apple.com/widget/account/?widgetKey=...#!repair","downloadICloudTerms":"https://setup.icloud.com/setup/ws/1/downloadLiteTerms","repairDone":"https://setup.icloud.com/setup/ws/1/repairDone","accountAuthorizeUI":"https://idmsa.apple.com/appleauth/auth/authorize/signin?client_id=...","vettingUrlForEmail":"https://id.apple.com/IDMSEmailVetting/vetShareEmail","accountCreate":"https://setup.icloud.com/setup/ws/1/createLiteAccount","getICloudTerms":"https://setup.icloud.com/setup/ws/1/getTerms","vettingUrlForPhone":"https://id.apple.com/IDMSEmailVetting/vetSharePhone"},"accountCreateEnabled":true},"error":"Missing X-APPLE-WEBAUTH-TOKEN cookie"}
------
2024-11-02 12:15:27.768 [DEBUG] [inding.icloud.internal.ICloudService] - Token is not valid. Attemping new login.
org.openhab.binding.icloud.internal.ICloudApiResponseException: Request https://setup.icloud.com/setup/ws/1/validate failed with 421.
at org.openhab.binding.icloud.internal.ICloudSession.request(ICloudSession.java:148) ~[?:?]
at org.openhab.binding.icloud.internal.ICloudSession.post(ICloudSession.java:98) ~[?:?]
at org.openhab.binding.icloud.internal.ICloudService.validateToken(ICloudService.java:190) ~[?:?]
at org.openhab.binding.icloud.internal.ICloudService.authenticate(ICloudService.java:94) ~[?:?]
at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.checkLogin(ICloudAccountBridgeHandler.java:338) ~[?:?]
at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.callApiWithRetryAndExceptionHandling(ICloudAccountBridgeHandler.java:164) ~[?:?]
at org.openhab.binding.icloud.internal.handler.ICloudAccountBridgeHandler.lambda$2(ICloudAccountBridgeHandler.java:127) ~[?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) [?:?]
at java.lang.Thread.run(Thread.java:840) [?:?]
2024-11-02 12:15:27.773 [DEBUG] [inding.icloud.internal.ICloudService] - Authenticating as openhab@oberhaus.nrw...
2024-11-02 12:15:27.773 [DEBUG] [inding.icloud.internal.ICloudSession] - iCloud request POST https://idmsa.apple.com/appleauth/auth/signin?isRememberMeEnabled=true.
2024-11-02 12:15:27.774 [TRACE] [inding.icloud.internal.ICloudSession] - Calling https://idmsa.apple.com/appleauth/auth/signin?isRememberMeEnabled=true
Headers -----
java.net.http.HttpHeaders@a04df65a { {Accept=[*/*], Content-Type=[application/json], Origin=[https://www.icloud.com], Referer=[https://www.icloud.com/], X-Apple-OAuth-Client-Id=[...], X-Apple-OAuth-Client-Type=[firstPartyAuth], X-Apple-OAuth-Redirect-URI=[https://www.icloud.com], X-Apple-OAuth-Require-Grant-Code=[true], X-Apple-OAuth-Response-Mode=[web_message], X-Apple-OAuth-Response-Type=[code], X-Apple-OAuth-State=[auth-c0a5066a-e41e-4fa6-9165-77bad626e1fe], X-Apple-Widget-Key=[d39ba9916b7251055b22c7f910e2ea796ee65e98b2ddecea8f5dde8d9d1a815d]} }
Body -----
{"password":"SuperSafePasswort1234","accountName":"openhab","trustTokens":[""],"rememberMe":true}
------
2024-11-02 12:15:28.382 [TRACE] [inding.icloud.internal.ICloudSession] - Result https://idmsa.apple.com/appleauth/auth/signin?isRememberMeEnabled=true 503
Headers -----
java.net.http.HttpHeaders@70670681 { {connection=[keep-alive], content-length=[190], content-type=[text/html], date=[Sat, 02 Nov 2024 11:15:28 GMT], server=[Apple]} }
Body -----
<html>
<head><title>503 Service Temporarily Unavailable</title></head>
<body>
<center><h1>503 Service Temporarily Unavailable</h1></center>
<hr><center>Apple</center>
</body>
</html>
------
2024-11-02 12:15:28.382 [WARN ] [l.handler.ICloudAccountBridgeHandler] - iCloud authentication failed. Invalid credentials.
Yes, same here. I also have the same problem with other OSS tools using icloud, eg pyicloud,
I got pyicloud working with adding the not yet merged change manually from:
https://github.com/picklepete/pyicloud/pull/459/files
and added the missing dependency too:
pip install srp