I´m using the iCloud Binding to find/monitor my various iCloud connected devices. I´ve configured the appleID username/password and I´m able to discover things. However, I am not able to define the things myselves in a .things file. The reason is probably that I do not have the right DeviceID. I´ve looked at the binding documentation, but it does not state what this DeviceID is. I´ve tried to use the UDID number, but it does not seem to be correct.
Does anyone know what the DeviceID defined in the binding doc is?
I found the ID from the Paper as well and added it to me .items file. However, I cannot get the binding to work. Configuring the binding in Paper and adding the items in the .items file kind of works, but as soon as I define a thing in the .things file (using the ID retrieved from the Paper UI), the binding seams to fail. Have you got it working using the .things / .items files only?
Arrrrggghhhhh… I´m a total idiot! Thanks to your post I had a closer look at my .things file and found a missing bracket at the end of the device configuration. Changed that and Bob´s your uncle…
Now it works, except for the “locationLastUpdate” item. Have you this working as well ?
unfortunately documentation is not my strong point; especially as I do not use textual configuration myself. If you have improvements that I can include in the readme please feel free to provide feedback. A appreciate if you are as specific as possible, or even provide fragments I can directly use .
Patrik, overall I think the documentation is for the most part quite informative, but I will have a read through and see if I can come up with some suggestions or additions to the docs.
I still cannot get the locationLastUpdate item to work. I´ve looked in the logs and find the following in the openhab.log.
2017-12-25 10:53:49.704 [ERROR] [nal.common.AbstractInvocationHandler] - An error occurred while calling method 'ThingHandler.thingUpdated()' on 'org.openhab.binding.icloud.handler.ICloudDeviceHandler@c39140': 2017-12-25T10:48:47CET is not in a valid format.
java.lang.IllegalArgumentException: 2017-12-25T10:48:47CET is not in a valid format.
at org.eclipse.smarthome.core.library.types.DateTimeType.<init>(DateTimeType.java:96) ~[?:?]
at org.openhab.binding.icloud.handler.ICloudDeviceHandler.getLastLocationUpdateDateTimeState(ICloudDeviceHandler.java:172) ~[?:?]
at org.openhab.binding.icloud.handler.ICloudDeviceHandler.updateLocationRelatedStates(ICloudDeviceHandler.java:123) ~[?:?]
at org.openhab.binding.icloud.handler.ICloudDeviceHandler.deviceInformationUpdate(ICloudDeviceHandler.java:74) ~[?:?]
at org.openhab.binding.icloud.handler.ICloudAccountBridgeHandler.lambda$2(ICloudAccountBridgeHandler.java:155) ~[?:?]
at java.util.ArrayList.forEach(ArrayList.java:1249) [?:?]
at java.util.Collections$SynchronizedCollection.forEach(Collections.java:2062) [?:?]
at org.openhab.binding.icloud.handler.ICloudAccountBridgeHandler.informDeviceInformationListeners(ICloudAccountBridgeHandler.java:155) [218:org.openhab.binding.icloud:2.2.0]
at org.openhab.binding.icloud.handler.ICloudAccountBridgeHandler.refreshData(ICloudAccountBridgeHandler.java:144) [218:org.openhab.binding.icloud:2.2.0]
at org.openhab.binding.icloud.handler.ICloudDeviceHandler.initializeThing(ICloudDeviceHandler.java:137) [218:org.openhab.binding.icloud:2.2.0]
at org.openhab.binding.icloud.handler.ICloudDeviceHandler.initialize(ICloudDeviceHandler.java:84) [218:org.openhab.binding.icloud:2.2.0]
at org.eclipse.smarthome.core.thing.binding.BaseThingHandler.thingUpdated(BaseThingHandler.java:228) [116:org.eclipse.smarthome.core.thing:0.10.0.b1]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:497) ~[?:?]
at org.eclipse.smarthome.core.internal.common.AbstractInvocationHandler.invokeDirect(AbstractInvocationHandler.java:153) [109:org.eclipse.smarthome.core:0.10.0.b1]
at org.eclipse.smarthome.core.internal.common.Invocation.call(Invocation.java:53) [109:org.eclipse.smarthome.core:0.10.0.b1]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:?]
at java.lang.Thread.run(Thread.java:745) [?:?]
Caused by: java.time.format.DateTimeParseException: Text '2017-12-25T10:48:47CET' could not be parsed, unparsed text found at index 19
at java.time.format.DateTimeFormatter.parseResolved0(DateTimeFormatter.java:1952) ~[?:?]
at java.time.format.DateTimeFormatter.parse(DateTimeFormatter.java:1851) ~[?:?]
at java.time.LocalDateTime.parse(LocalDateTime.java:492) ~[?:?]
at org.eclipse.smarthome.core.library.types.DateTimeType.<init>(DateTimeType.java:89) ~[?:?]
... 21 more
Any suggestions to what could be the reason for this ?
that looks like a bug in the binding; it can not parse the date format your server response produces. I´ll have a look into that and let you know once I´ve an updated version.
I am running the stable version. Would it simply be a matter of renaming the file, changing the permissions and dropping it into /var/lib/openhab2/tmp/mvn/org/openhab/binding/org.openhab.binding.icloud/2.2.0 ?
257 │ Active │ 80 │ 2.2.0.201712251133 │ iCloud Binding
and the item locationLastUpdate is now being updated as it should.
2017-12-25 20:25:15.218 [vent.ItemStateChangedEvent] - Martin_LocationLastUpdate changed from 2017-12-25T20:20:19.187+0100 to 2017-12-25T20:20:23.648+0100
Thanks for fixing and for hints on how to get the snapshot running. I´ve had it running for approximately 1 hour with refreshTimeInMinutes=5 with no exceptions. There is a slight delay detecting location change (I took a walk to test if the service updated location and locationLastUpdate to where I actually was at various times), but I think this due to how icloud updates information and not the binding.
@sipvoip@MartinKo
I see new things in auto discovery but they are formattet like:
“icloud:device:myaccount:1e97b374:batteryStatus”
so I assumed that device ID is “1e97b374” but with this there is no connection possible.
You all had longer device IDs. You really just looked in the auto discovery in the things?