iCloud Binding - changed behavior of LOCATION item?

I have installed iCloud binding to monitor location of my devices. Since a few days I get the following error when I apply my rule to convert the location to the address:

“error_message” : “Invalid request. Invalid ‘latlng’ parameter.”,
“results” : [],
“status” : “INVALID_REQUEST”
}

When I look at the item that I have linked in PaperUI to LOCATION, I notice that it not only returns “lat,lng” but returns “lat,lng,0.0”

The additional dimension “0.0” generates the error. Previously, it used to work perfectly. Did I miss any change in the way the binding works?

I have the same problem. Does anyone know how to solve?
Thanks!

You might have to update your rule, the altitude was added to the location, this was indeed not properly added to the release notes, apologies.

FTR: the PR https://github.com/openhab/openhab2-addons/pull/4209/files

Can you help me on that one?
This is my current rule:

rule "Distance from home"

when
	Item iPhone_Location changed
then
Home_Location.state = new PointType(new DecimalType(50), new DecimalType(4))
Distance_From_Home_iPhone.postUpdate(Home_Location.distanceFrom(iPhone_Location) as Number)
val _url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + iPhone_Location.state + "&key=some_key"
val _geocodeJSON = sendHttpGetRequest(_url)
val _address = transform("JSONPATH", "$.results[0].formatted_address", _geocodeJSON)
iPhone_Location_Address.postUpdate(_address)

end

Found it my self, rule needs to be changed as follows:

rule "Distance from home”
when Item iPhone_Location changed
then
Home_Location.state = new PointType(new DecimalType(50), new DecimalType(4))
Distance_From_Home_iPhone.postUpdate(Home_Location.distanceFrom(iPhone_Location) as Number)
val tmp_loc = new PointType(new DecimalType(iPhone_Location.state.toString.split(",").get(0)), new DecimalType(iPhone_Location.state.toString.split(",").get(1)))
val _url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + tmp_loc.toString() + "&key=some_key"
val _geocodeJSON = sendHttpGetRequest(_url)
val _address = transform("JSONPATH", "$.results[0].formatted_address", _geocodeJSON) iPhone_Location_Address.postUpdate(_address)
end

Hi @martinvw
could you please share an information why the altitude was added?
The value is always zero and doesn´t change at all…
The PR only mentions the lowbattery channel and some french descriptions but not a change at the location.

Do we really need an altitude when the value is empty and is it possible to remove this value?

kind regards
Michael

I got a reply from the author why it was added.

I just noticed that iCloud API made this information available, and as LocationType is able to handle it, I did add it.

Given that it can only be removed in a next stable revision (or in the snapshot but it was added there already on the 11th of november) I don’t think it makes any sense to remove it, because by then all people will have updated there rules. And given its returned in the response it might contain valid / relevant details for some users or in the near future.

CC: @glhopital

1 Like

Thanks for the explanation :+1:
So let´s see if and when Apple will add the altitude information.

kind regards
Michael