This: 49.xxxxxxxxx,8.xxxxxxxxxx is not a simple float. You could try %s instead.
However these coordinates are pretty worthless unless you are a walking map.
On your Basic UI all you need to add are those two elements:
Text item=iPhone_Battery icon="iphone"
Text item=iPhone_Location icon="iphone"
… which are the result of the above rules and which actually are meaningful and comprehendible to the user.
hi there… very intresting solution! thanks for it!
in the log message there are all data but an error also:
"16:40:01.921 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule iCloud Data Retrieval: An error occurred during the script execution: The name 'iPhoneLocation' cannot be resolved to an item or type."
Thanks for the hint. There was a small spelling mistake in the first posting. You can check to see that there was indeed no item with that name in your items file. I’ve done the needed changes, didn’t test them though. Please let us know if all works fine now.
another problem now: Finding a solution for a rule using this data!
I want to change a switch for presence detection with checking the location has changed
rule "iPhone Anwesenheit"
when
Item iPhone_Coordinates changed
then
if (iPhone_Location.state == home )
{
sendCommand(DummyItem,ON)
}
end
But this doesn´t work…
Also, it does not help to put the word home in quotation marks. The switch is also switched off without that the iphone changes the location.
I forgot to say: there is a second rule which switches the DummyItem to OFF when the iPhone_Location.state != home
Best regards
Besides: Your rule should work with two things in mind: home with and without quotation marks makes a huge difference. In the quote case you are comparing to the string “home”. In the unquoted case you are comparing with the variable named home - > this variable does not exist!!
Furthermore you should react on a change of the item iPhone_Location, not iPhone_Coordinates.
Lastly, if you implemented the rule as proposed, the iPhone_Location item will read “Home (13m)” and never be equal to “home”.
I am quite experienced in Openhab, using it since version 1.3, but putting somewhere the working icloud config in one text (forum contains mods, changes, corrections,…) would be great/extremely useful for newcomers using an idevice.
Strange, followed the instructions given here and applied it in two differend scripts, one for myself and one for a second person. Each script is identical beside of apple id and pass.
While the sceond script runs ( I got all locations, battery status and so on) my own account seems to be different:
2017-08-04 06:45:00.019 [INFO ] [home.model.script.iPhone_Loc_M.rules] - Retrieving iCloud data
2017-08-04 06:45:01.563 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule iCloud Data Retrieval : null
Both accounts have the 2 factor auth on. both account have one iPhone each and a windows laptop registered. I verified the settings on both phones as well as on the apple id settings…they are identical.
Any idea what that could be?
Thinking of turning on debug mode, creating a new account …
Hi I am really interested in your integration of icloud. I have however a question … Does it affect the life of the battery of the iphone to locate them like that with icloud ??