iCloud device data integration in openHAB

I do not think so - as the information is sent to the iCloud anyhow; the rule does not query the device itself.

with kind regards,
Patrik

I’m not agree … when you ask iCloud where is the device iCloud send a request where is the iPhone … ( and may be once every X Time ) so if you send 20 request every day … it gonna affect the battery life !

For exemple : When I use Find my Friends with my girl friend when I open the app find my friends said where she was 1h ago then it refresh to is later location

As said - not sure; my devices are not noticably affected with 5 minutes poll time … also this discussions hints to that iCloud data does not consume as much battery as a tracking app:

1 Like

I can confirm, that iCloud send a request to the devices. On the iPhone you can see, that the little arrow that indicates the use of the location service shows up every five minutes. On my mac, which is linked to the same iCloud account, you can see the same behavior. There is also indicated, that the service “findmydecived” is using the location service.
But I can’t tell you, how much the impact on the battery life is.

2 Likes

Hi Guys is there anybody who could help me with this error im getting

2017-08-06 10:15:02.168 [INFO ] [.smarthome.model.script.icloud.rules] - Longitude: 18.7020133174454
2017-08-06 10:15:02.168 [INFO ] [.smarthome.model.script.icloud.rules] - Accuracy: 1414.0
2017-08-06 10:15:02.169 [INFO ] [.smarthome.model.script.icloud.rules] - TimeStamp: 2017-08-06T10:12:05.052+0200
2017-08-06 10:15:02.172 [INFO ] [.smarthome.model.script.icloud.rules] - iCloud retrieval finished
2017-08-06 10:15:02.216 [INFO ] [smarthome.model.script.icloud2.rules] - iPhone Battery update
2017-08-06 10:15:02.218 [INFO ] [smarthome.model.script.icloud2.rules] - iPhone Battery: 93%
2017-08-06 10:15:41.430 [ERROR] [systeminfo.handler.SysteminfoHandler] - No information for channel battery#remainingCapacity with device intex 0 :
org.openhab.binding.systeminfo.model.DeviceNotFoundException: Device with index: 0 can not be found!
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getDevice(OshiSysteminfo.java:89)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getBatteryRemainingCapacity(OshiSysteminfo.java:329)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.getInfoForChannel(SysteminfoHandler.java:293)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishDataForChannel(SysteminfoHandler.java:253)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishData(SysteminfoHandler.java:246)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.access$1(SysteminfoHandler.java:240)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler$2.run(SysteminfoHandler.java:226)[221:org.openhab.binding.systeminfo:2.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
2017-08-06 10:15:41.430 [ERROR] [systeminfo.handler.SysteminfoHandler] - No information for channel battery#remainingTime with device intex 0 :
org.openhab.binding.systeminfo.model.DeviceNotFoundException: Device with index: 0 can not be found!
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getDevice(OshiSysteminfo.java:89)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getBatteryRemainingTime(OshiSysteminfo.java:320)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.getInfoForChannel(SysteminfoHandler.java:296)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishDataForChannel(SysteminfoHandler.java:253)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishData(SysteminfoHandler.java:246)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.access$1(SysteminfoHandler.java:240)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler$2.run(SysteminfoHandler.java:226)[221:org.openhab.binding.systeminfo:2.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
2017-08-06 10:16:41.434 [ERROR] [systeminfo.handler.SysteminfoHandler] - No information for channel battery#remainingCapacity with device intex 0 :
org.openhab.binding.systeminfo.model.DeviceNotFoundException: Device with index: 0 can not be found!
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getDevice(OshiSysteminfo.java:89)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getBatteryRemainingCapacity(OshiSysteminfo.java:329)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.getInfoForChannel(SysteminfoHandler.java:293)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishDataForChannel(SysteminfoHandler.java:253)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishData(SysteminfoHandler.java:246)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.access$1(SysteminfoHandler.java:240)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler$2.run(SysteminfoHandler.java:226)[221:org.openhab.binding.systeminfo:2.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
2017-08-06 10:16:41.435 [ERROR] [systeminfo.handler.SysteminfoHandler] - No information for channel battery#remainingTime with device intex 0 :
org.openhab.binding.systeminfo.model.DeviceNotFoundException: Device with index: 0 can not be found!
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getDevice(OshiSysteminfo.java:89)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getBatteryRemainingTime(OshiSysteminfo.java:320)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.getInfoForChannel(SysteminfoHandler.java:296)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishDataForChannel(SysteminfoHandler.java:253)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishData(SysteminfoHandler.java:246)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.access$1(SysteminfoHandler.java:240)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler$2.run(SysteminfoHandler.java:226)[221:org.openhab.binding.systeminfo:2.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
2017-08-06 10:17:41.429 [ERROR] [systeminfo.handler.SysteminfoHandler] - No information for channel battery#remainingCapacity with device intex 0 :
org.openhab.binding.systeminfo.model.DeviceNotFoundException: Device with index: 0 can not be found!
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getDevice(OshiSysteminfo.java:89)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getBatteryRemainingCapacity(OshiSysteminfo.java:329)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.getInfoForChannel(SysteminfoHandler.java:293)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishDataForChannel(SysteminfoHandler.java:253)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishData(SysteminfoHandler.java:246)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.access$1(SysteminfoHandler.java:240)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler$2.run(SysteminfoHandler.java:226)[221:org.openhab.binding.systeminfo:2.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
2017-08-06 10:17:41.430 [ERROR] [systeminfo.handler.SysteminfoHandler] - No information for channel battery#remainingTime with device intex 0 :
org.openhab.binding.systeminfo.model.DeviceNotFoundException: Device with index: 0 can not be found!
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getDevice(OshiSysteminfo.java:89)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getBatteryRemainingTime(OshiSysteminfo.java:320)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.getInfoForChannel(SysteminfoHandler.java:296)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishDataForChannel(SysteminfoHandler.java:253)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishData(SysteminfoHandler.java:246)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.access$1(SysteminfoHandler.java:240)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler$2.run(SysteminfoHandler.java:226)[221:org.openhab.binding.systeminfo:2.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
2017-08-06 10:18:41.430 [ERROR] [systeminfo.handler.SysteminfoHandler] - No information for channel battery#remainingCapacity with device intex 0 :
org.openhab.binding.systeminfo.model.DeviceNotFoundException: Device with index: 0 can not be found!
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getDevice(OshiSysteminfo.java:89)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getBatteryRemainingCapacity(OshiSysteminfo.java:329)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.getInfoForChannel(SysteminfoHandler.java:293)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishDataForChannel(SysteminfoHandler.java:253)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishData(SysteminfoHandler.java:246)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.access$1(SysteminfoHandler.java:240)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler$2.run(SysteminfoHandler.java:226)[221:org.openhab.binding.systeminfo:2.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
2017-08-06 10:18:41.431 [ERROR] [systeminfo.handler.SysteminfoHandler] - No information for channel battery#remainingTime with device intex 0 :
org.openhab.binding.systeminfo.model.DeviceNotFoundException: Device with index: 0 can not be found!
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getDevice(OshiSysteminfo.java:89)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getBatteryRemainingTime(OshiSysteminfo.java:320)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.getInfoForChannel(SysteminfoHandler.java:296)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishDataForChannel(SysteminfoHandler.java:253)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishData(SysteminfoHandler.java:246)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.access$1(SysteminfoHandler.java:240)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler$2.run(SysteminfoHandler.java:226)[221:org.openhab.binding.systeminfo:2.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
2017-08-06 10:19:41.430 [ERROR] [systeminfo.handler.SysteminfoHandler] - No information for channel battery#remainingCapacity with device intex 0 :
org.openhab.binding.systeminfo.model.DeviceNotFoundException: Device with index: 0 can not be found!
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getDevice(OshiSysteminfo.java:89)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getBatteryRemainingCapacity(OshiSysteminfo.java:329)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.getInfoForChannel(SysteminfoHandler.java:293)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishDataForChannel(SysteminfoHandler.java:253)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishData(SysteminfoHandler.java:246)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.access$1(SysteminfoHandler.java:240)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler$2.run(SysteminfoHandler.java:226)[221:org.openhab.binding.systeminfo:2.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]
2017-08-06 10:19:41.430 [ERROR] [systeminfo.handler.SysteminfoHandler] - No information for channel battery#remainingTime with device intex 0 :
org.openhab.binding.systeminfo.model.DeviceNotFoundException: Device with index: 0 can not be found!
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getDevice(OshiSysteminfo.java:89)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.model.OshiSysteminfo.getBatteryRemainingTime(OshiSysteminfo.java:320)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.getInfoForChannel(SysteminfoHandler.java:296)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishDataForChannel(SysteminfoHandler.java:253)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.publishData(SysteminfoHandler.java:246)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler.access$1(SysteminfoHandler.java:240)[221:org.openhab.binding.systeminfo:2.1.0]
at org.openhab.binding.systeminfo.handler.SysteminfoHandler$2.run(SysteminfoHandler.java:226)[221:org.openhab.binding.systeminfo:2.1.0]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)[:1.8.0_131]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)[:1.8.0_131]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)[:1.8.0_131]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)[:1.8.0_131]
at java.lang.Thread.run(Thread.java:748)[:1.8.0_131]

This looks very interesting and I will try it next week or so. But currently I am bit concerned with saving my apple id and password in plain text :wink: Has anyone tried to use app-specific passwords? This means that passwords would still be saved in plain text but at least its a bit safer? https://support.apple.com/en-us/HT204397

Patrik and Thom, this is some really great stuff you have done with iCloud. Thanks.

It works great for me when setting it up with my wife’s iCloud (she has only one device). But I am struggling to get it to work with my own iCloud with more than one device.

Does any body have a working rule with more than one iCloud device which can be shared? (Remember to remove appleID and password :slight_smile:)

Kind regards,
Christian

It’s pretty easy an I’ve already done that with a iPhone and iWatch. You can actually find this in the first posting, the part deviceIndex = 0 will fetch all data for the first device, if you added some lines with deviceIndex = 1 you’d get data for the second device etc.

To get an overview about which devices are there and what info is provided for those, check out the output of logInfo(filename, "Message: " + connection.responseMessage), which will result in a long json string. You can prettyfy this string here: https://jsonformatter.curiousconcept.com
If you want to evaluate the Jsonpath strings used to filter the json, check out this nifty page: http://jsonpath.com/

Good luck!

2 Likes

Hi Patrik

What a great integration, using it in my Openhab since you posted it.
Im using it primarily for a presence detection, and was wondering if someone could help my with a solution where more than 1 apple id is used.
Im using my own Apple Id, my girlfriend hers, and the kids have there own as well, all theses are linked in a family share.
The Json returned only includes the devices, from each Apple ID.
My solution was to make a copy for every Apple ID, witch works great until i restart Openhab.
Here it only starts 1 of all the copy’s i have of it ??
Could this be related to the String buffer ???
If i start every script by itself it runs flawless, with a total of 6 devices.

Br. Allan

If you copy the file for each id I don’t see any reason why this would not work. Maybe you need to change the cron times slightly to avoid overlaps.

Hi Thom

Thanks for your feedback, but no luck.
I have tried with “0 1/5 * * * ? *”, “0 2/5 * * * ? *” and so on, even with “0 0/5 * * * ? * sleep 1”.
The rules load fine at startup but, it seems to stop there, i only get results on 1 of the 6 copied rules, and it always the same rule as well ???

Any suggestions ?

I have the same issue (i use two different rules for two iCloud accounts). My workaround is to save the .rules file, which is not executed properly, again while openhab is running. So the rule is loaded again and than both are executed properly.

This might be simple, you need 6 different sets of items with 6 sets of names.
Taking this into count, I have it running for three ID’s in one rules file.

1 Like

Hi Hans-Jörg

So your solution is to have it all in 1 rule instead of having 6 different rules ?
Will give it a try, later this weekend.

No, that is not what I was saying, it does not matter if you have it in one or muliple rules files.
The important point is to have unique items for each device you want to monitor.
The example above has one set of items, so you can monitor one device only.
In my setup, I have 8 sets of items, three rules for three different Apple IDs to retreive the data sets and 8 rules for battery state information.

1 Like

Sorry for the misunderstanding, but that was pretty fundamental for me to have unique items pr. device. The problem is to have the rule running.
It loads fine on startup, but it does not pul data, i have to edit it, so the rule loads again, just like Christoph mentioned earlier, to make it run and pull data.

You should take a look at your openHAB log and perhaps add some more loginfos into your rules. In some cases the data is not retrieved completely, which causes errors and could stop execution.
I changed the data retrieving rule a bit, so if one Apple ID has multiple devices (up to 4 in my case), I just copied the transformation block, not the retrieval.

Thanks for the advice.
The rule loads in the log, but they don’t run.
It’s only 1 of the 6 rules that runs, the other 5 simply won’t run, i have to edit and save them for openhab to reload the rules, to make them run.
When i do so, all works like a charme, battery, location, location match, etc. etc.

In this case, it would be worth to try having all 6 rules in one file.

Hans, feel free to post your improvements to the OP solution :wink: