Does anyone have Influxdb correctly persist locations, it seems not to work for me with 2.2 stable (and prior) ?
I’m persisting everything:
Strategies {
everyMinute : "0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyMinute, everyChange
}
Items {
* : strategy = everyChange, everyHour, everyDay, restoreOnStartup
}
I’m using the iCloud binding for all my devices like follows:
String MacBookDadBatteryStatus "Battery Status [%s]" <battery> (giCloudDadMacBook) {channel="icloud:device:abc:def:batteryStatus"}
Number MacBookBatteryLevel "Battery Level [%.0f %%]" <battery> (giCloudDadMacBook) {channel="icloud:device:abc:def:batteryLevel"}
Switch MacBookDadFindMyPhone "Find Dad MacBook" (giCloudDadMacBook) ["Switchable"] {channel="icloud:device:abc:def:findMyPhone"}
Location MacBookDadLocation "Coordinates" (giCloudDadMacBook) {channel="icloud:device:abc:def:location"}
String MacBookDadLocationString "[%s]" <place>
Number MacBookDadLocationAccuracy "Coordinates Accuracy [%.0f m]" (giCloudDadMacBook) {channel="icloud:device:abc:def:locationAccuracy"}
DateTime MacBookDadLocationLastUpdate "Last Update [%1$td.%1$tm.%1$tY, %1$tH:%1$tM]" (giCloudDadMacBook) {channel="icloud:device:abc:def:locationLastUpdate"}
and I have the following rule to translate location into readable address:
rule "MacBook Dad formatted address"
when
Item MacBookDadLocation changed
then
val _url = "https://maps.googleapis.com/maps/api/geocode/json?latlng=" + MacBookDadLocation.state.toString + "&key=abcdef"
val _geocodeJSON = sendHttpGetRequest(_url)
val _address = transform("JSONPATH", "$.results[0].formatted_address", _geocodeJSON)
MacBookDadLocationString.postUpdate(_address)
end
persistence works fine for all the items except location, for example for changes to the LocationString I get the following in trace log:
2017-12-21 15:04:15.226 [vent.ItemStateChangedEvent] - MacBookDadLocationString changed from some street, some city, Germany to some street, some city, Germany
2017-12-21 15:04:15.404 [TRACE] [.internal.InfluxDBPersistenceService] - Tried to get item from item class class org.openhab.core.library.items.StringItem, state is some street, some city, Germany
2017-12-21 15:04:15.404 [DEBUG] [.internal.InfluxDBPersistenceService] - got String value some street, some city, Germany
2017-12-21 15:04:15.404 [TRACE] [.internal.InfluxDBPersistenceService] - storing MacBookDadLocationString in influxdb value some street, some city, Germany, MacBookDadLocationString (Type=StringItem, State=some street, some city, Germany)
while for changes to Location I only get something like this, it seems it doesnt even try to persist the value:
2017-12-21 15:09:16.622 [vent.ItemStateChangedEvent] - MacBookDadLocation changed from 57.16784242952166,14.695187186432912 to 52.16784165925779,12.695187517415263