Owntrack is working from my iphone, I get the lat and long properly, I can see them on MQTT FX, but then I do not get any data in Openhab. In the Log I do not receive any info about the LAt LONg and so on.
I am not sure, but the mqtt sentence is not right at all…
2018-06-22 19:28:07.560 [ERROR] [el.item.internal.GenericItemProvider] - Binding configuration of type 'mqtt' of item 'mqttPositionJuanRaw' could not be parsed correctly.
org.eclipse.smarthome.model.item.BindingConfigParseException: Invalid mqtt binding configuration 'mosquitto:owntracks/openhab/iphone:default' for item mqttPositionJuanRaw
at org.openhab.core.binding.internal.BindingConfigReaderDelegate.processBindingConfiguration(BindingConfigReaderDelegate.java:52) ~[?:?]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:400) ~[?:?]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.internalDispatchBindings(GenericItemProvider.java:369) ~[?:?]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.processBindingConfigsFromModel(GenericItemProvider.java:229) ~[?:?]
at org.eclipse.smarthome.model.item.internal.GenericItemProvider.modelChanged(GenericItemProvider.java:435) ~[?:?]
at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.notifyListeners(ModelRepositoryImpl.java:301) ~[?:?]
at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:139) ~[?:?]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:227) ~[?:?]
at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.processWatchEvent(FolderObserver.java:291) ~[?:?]
at org.eclipse.smarthome.core.service.WatchQueueReader.lambda$3(WatchQueueReader.java:323) ~[?:?]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:?]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]```
Great, I got it.
I had wrong the sentence. I putted Switch instead of String
ok, now I get data in OH.
I will test the rules. I will let you know, thanks for helping, after hours in front of code, i am blind.
Well, I get this:
==> /var/log/openhab2/events.log <==
2018-06-22 19:51:13.096 [ome.event.ItemUpdatedEvent] - Item 'mqttPositionJuanRaw' has been updated.
2018-06-22 19:51:13.152 [vent.ItemStateChangedEvent] - mqttPositionJuanRaw changed from NULL to {"batt":43,"lon":xxx.7320520877928764,"acc":10,"p":xxxx,"vel":0,"vac":4,"lat":xx.xx,"conn":"w","tst":1529689018,"alt":51,"_type":"location","tid":"NE"}
And then I get this error:
2018-06-22 19:59:00.013 [ERROR] [ntime.internal.engine.ExecuteRuleJob] - Error during the execution of rule 'Execute script IphonePresence': An error occurred during the script execution: Could not invoke method: org.eclipse.smarthome.model.script.actions.LogAction.logInfo(java.lang.String,java.lang.String,java.lang.Object[]) on instance: null```
I made some progress. It seems that the rules are working fine. But I guess that I need to move, in order to see how change the values, beacuse Owntrack does not send mqtt if stay on the same location right?
2018-06-23 08:03:56.557 [vent.ItemStateChangedEvent] - mqttPositionJuanRaw changed from to {"tst":1529733835,"acc":1414,"_type":"location","alt":51,"lon":xxx.7336854984647179,"vac":19,"lat":xxx.385122162777407,"batt":97,"conn":"w","tid":"NE"}
2018-06-23 08:03:56.570 [vent.ItemStateChangedEvent] - mqttJuanLatitude changed from 53.2 to 52.38512216277741
2018-06-23 08:03:56.577 [vent.ItemStateChangedEvent] - mqttJuanLongitude changed from 9.34 to 9.733685498464718
2018-06-23 08:03:56.581 [vent.ItemStateChangedEvent] - mqttJuanAccuracy changed from 10 to 1414
2018-06-23 08:03:56.586 [vent.ItemStateChangedEvent] - mqttJuanBattery changed from 24 to 97
The only thing that is not working fine is the ON/OFF switch I have for the presence. This switch does not change never.
Switch mqttJuanPresence "Juan @ Home [MAP(presence.map):%s]" <present> (gPresent) { mqttitude="mosquitto:owntracks/openhab/iphone:home”}
by this:
Switch mqttJuanPresence "Juan @ Home [MAP(presence.map):%s]" <present> (gPresent) { mqttitude="mosquitto:owntracks/openhab/iphone"}
It seems is working, at least I have output because I got this in the log:
2018-06-23 09:15:45.299 [ome.event.ItemUpdatedEvent] - Item 'mqttJuanPresence' has been updated.
2018-06-23 09:15:46.088 [vent.ItemStateChangedEvent] - mqttJuanPresence changed from NULL to OFF
but I do not understand way I have “AWAY” instead of “HOME” if the device is within the fence. I should have this switch ON.
In the transform I have:
ON=HOME
OFF=AWAY
-=-
NULL=-
From wontrack website:
“The app will publish the location additionally everytime the device leaves or enters one of the regions, and the published data contains an indication of whether the device is entering or leaving the region.”
So, I only get info everytime I leave or enter the fence. ok. So, I should move to test properly.