Dear Community!
I have been using a rule from here, but it stopped working…
I get this error:
Error executing the transformation 'JSONPATH': the given parameters 'JSonPath' and 'source' must not be null
Here is the whole rule, if that matters:
val String GoogleAPIKey = "My API key"
rule LocationString
when
Item KristofIPhone_Location changed or
Item EdinaIPhone_Location changed or
Item ReKaIPhone_Location changed
then
val PointType location = (triggeringItem.state) as PointType
val nameParts = triggeringItem.name.toString.split("_")
val triggeringiPhoneName = nameParts.get(0) + "_LocationString"
val Latitude = location.latitude
val Longitude = location.longitude
val geocodeURL = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + Latitude + "," + Longitude + "&sensor=true&key=" + GoogleAPIKey
val String gecodeResponse = sendHttpGetRequest(geocodeURL)
val String formattedAddress = transform("JSONPATH", "$.results[0].formatted_address", gecodeResponse)
postUpdate(triggeringiPhoneName, formattedAddress)
end
I think that the rule is ok, because it used to work. Now I only get ‘null’ for return value.
What I have tried so far:
- Restarting openHab
- Reinstalling the JSONPATH transformation
What I’m missing?
Thanks!