I can report that iPhone SE and iPad Air 2 are both working devices.
I still have two minor issues.
The Distance From Home is static and when at home it is saying 750m. I have set the lat/long in the PaperUI regional settings to match my location reported by my iPhone and it still says the same after saving the change.
I am seeing the following error in my logs any ideas?
It seems to be caused by this line:
val String owner = transform(“JSONPATH”, “$.userInfo.firstName”, jsonResponse) + " " + transform(“JSONPATH”, “$.userInfo.lastName”, jsonResponse)
do you use the binding; or the scripts. If you use the scripts you might want to give the binding a try (from the market place); it automatically provides the distance from home.
@smar were you able to use this in a meaningful way to get more timely updates? Can you share your implementation? I want to use the binding to track the location of our Apple devices to determine if we are home. Right now the refresh cycle of 5 minutes plus the iCloud update frequency means OH2 may not know that we are home for up to almost 10 minutes after we’ve arrived.
I was using both! DOH…
I tried the binding but did not seem to get anything so I rtead this thread
and implemented the scripts, needing to change the names of the items and
suchlike to match the ones created by the binding.
More than once I wondered what on earth the binding was doing as it seemed
the scripts were doing all the heavy lifting. With your comment I have
removed the rules file and went back to investigate why the binding was not
working. Then I say the Refresh Switch so set that to ON and started to see
the results in my sitemap.
I will take a look again after I go into work tomorrow to see if it works
there too and reflects the correct data, but looks good right now
Thanks!
Paul
[EDIT] Actually it only gets new data when I set the Refresh Switch to ON and only once. I have set the Interval to 5 minutes (default) why is it not automatically refreshing every 5 mins, what have I missed?
@nolan_garrett For my presence at home detection, I use a combination of iCloud, Owntracks and ARP table notifications from my router. iCloud can be up to 10 minutes out of date, but I find that Owntracks is usually quite quick and my ARP table monitoring is also within a minute. Thus presence at home is usually detected by OH2 by the time we have finished parking and reached the front door.
The corollary though is that detection for when the house is empty can take up to 10 to 15 minutes, as it takes that long for my firewall to release the entry in its ARP table. I haven’t looked into reducing this as it is fine for my purposes. However, one work-around could be to give precedence to Owntracks’ geofence Exit message over the ARP table data. Not sure how well that would work in practice, but from my experience of Owntracks, it should be reasonably accurate.
For myself, I use the iCloud (and also similar Android) location solutions more to show where family members are at any time on an openHAB sitemap that each family member has access to.We have refresh buttons on the sitemap such that we can get accurate location data if required. iCloud can be forced to get an updated location at any time by clicking refresh again immediately after it has given you the the stale location info. That way, you don’t have to wait 10 minutes for the iCloud refresh cycle. This will of course impact the iPhone user’s battery, and so probably not something you want to do in a rule.
I am using OH 2.1
can you advise the karaf command that will enable binding debug mode?
I cannot easily startup OH server in debug mode as it is my production
system and I do not want to cause disruptions.
Thanks @ThomDietrich
I have tried setting the logging to DEBUG using
log:set DEBUG org.openhab.binding.icloud
and then tried filtering using the filter below:
log:tail org.openhab.binding.icloud
I monitored and got no log entries, so I forced a refresh using the switch and got an output. So it would seem to suggest the DEBUG and tailing are working but under normal circumstances there is no 5 minute refreshing going on.
09:53:57.964 [DEBUG] [binding.icloud.handler.BridgeHandler] - iCloud bridge refreshing data ...
09:54:00.686 [DEBUG] [binding.icloud.handler.BridgeHandler] - iCloud device discovery for [iPhone SE]
09:54:00.699 [DEBUG] [binding.icloud.handler.BridgeHandler] - iCloud device discovery for [iPhone 4s]
09:54:00.707 [DEBUG] [binding.icloud.handler.BridgeHandler] - iCloud device discovery for [iPad Air 2]
09:54:00.719 [DEBUG] [binding.icloud.handler.BridgeHandler] - iCloud bridge data refresh complete.
I have never rebooted my device since installing icloud, is there perhaps something that needs a reboot to start the chron item scheduling?
It works fine if I add things through Paper UI, but if it’s done through a config file I get this error for each of the things:
2017-11-18 11:56:36.204 [ERROR] [ome.core.thing.internal.ThingManager] - Exception occurred during bridge handler (‘icloud:account:tgudlek’) notification about handler initialization of child ‘icloud:device:tgudlek:5fe26aff’: null
java.lang.NullPointerException: null
at java.lang.String$CaseInsensitiveComparator.compare(String.java:1193) [?:?]
at java.lang.String$CaseInsensitiveComparator.compare(String.java:1186) [?:?]
at java.lang.String.compareToIgnoreCase(String.java:1239) [?:?]
at org.openhab.binding.icloud.handler.DeviceHandler.getDeviceData(DeviceHandler.java:168) [198:org.openhab.binding.icloud:2.2.0.201711171328]
at org.openhab.binding.icloud.handler.DeviceHandler.update(DeviceHandler.java:53) [198:org.openhab.binding.icloud:2.2.0.201711171328]
at org.openhab.binding.icloud.handler.BridgeHandler.childHandlerInitialized(BridgeHandler.java:124) [198:org.openhab.binding.icloud:2.2.0.201711171328]
at org.eclipse.smarthome.core.thing.internal.ThingManager$10.run(ThingManager.java:811) [105:org.eclipse.smarthome.core.thing:0.9.0.201710240931]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Binding-specific log doesn’t contain much information:
Device IDs are set correctly in the config file (following the example from github repo), and the binding is installed manually using SNAPSHOT jar. I’m also using OH2.2.
I checked the code of the binding & it fails during the evaluation of a configured thing device id:
String deviceId = thing.getProperties().get(IDPROPERTY);
for (int i = 0; i < content.size(); i++) {
if (content.get(i).getId().compareToIgnoreCase(deviceId) == 0) {
return content.get(i);
}
}
Can you verify that all three things have the correct id set and maybe post your configuration? To be precise the “compareToIgnoreCase(deviceId)” seems to fail. I´ll also add additional logging to the binding in that area. I´ll let you know once that is ready.
I can confirm that you´ve found a bug in the binding; please use paper UI for the moment for the thing creation. I´ll work on a fix this weekend and let you know once an updated binding is available.
thanks for providing the info and kind regards,
Patrik