Hi Jürgen,
No i do not think that is the problem. I have tried it with the following cfg’s:
JSONPATH($.DS18B20.DS1.Temperature)
JSONPATH($.DS18B20.Temperature)
JSONPATH($.DS18x20.DS1.Temperature)
JSONPATH($.DS18x20.Temperature)
But when i look into the openhab log, with every change in this items file i get the following Warning messages:
2018-02-27 13:38:26.306 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'mqtt.items'
2018-02-27 13:38:52.117 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'mqtt.items'
2018-02-27 13:38:52.589 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1d2b72d' with value 'NULL' failed: An error occurred while opening file.
2018-02-27 13:38:52.626 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1d2b72d' with value 'NULL' failed: An error occurred while opening file.
2018-02-27 13:38:52.636 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1d2b72d' with value 'NULL' failed: An error occurred while opening file.
I do’nt know if that has something to do with the DS18B20 sensor. My other sensor the Si7021 is using also JSONPATH, and is working OK, both Temp and Humidity.
I do not know it it helps but i added the following to my …/transform/binary.map file:
key=value
1=ON
0=OFF
ON=1
OFF=0
NULL=unknown
-=unknown
As what the transformations concerns, i starten with installing jsonpath- and map transformation. Later on i also included, one-by-one, Exec-, Javascript-, Xpath- en Xslt tranformations, but this did not change the behaviour.
I just restarted openhab and most transformations were uninstalled:
2018-02-27 13:51:08.466 [INFO ] [arthome.ui.paper.internal.PaperUIApp] - Started Paper UI at /paperui
2018-02-27 13:51:08.656 [INFO ] [basic.internal.servlet.WebAppServlet] - Started Basic UI at /basicui/app
2018-02-27 13:51:33.384 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-xpath'
2018-02-27 13:51:49.328 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1b5d4ea' with v alue 'NULL' failed: An error occurred while opening file.
2018-02-27 13:51:49.410 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1b5d4ea' with v alue 'NULL' failed: An error occurred while opening file.
2018-02-27 13:51:49.428 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@1b5d4ea' with v alue 'NULL' failed: An error occurred while opening file.
2018-02-27 13:51:54.510 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-map'
2018-02-27 13:52:18.522 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-javascript'
2018-02-27 13:52:37.630 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-xslt'
2018-02-27 13:52:47.957 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:52:47.968 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
2018-02-27 13:52:48.003 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:52:48.010 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
2018-02-27 13:52:48.021 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:52:48.028 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
2018-02-27 13:52:56.044 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-exec'
2018-02-27 13:53:14.783 [INFO ] [core.karaf.internal.FeatureInstaller] - Uninstalled 'openhab-transformation-jsonpath'
2018-02-27 13:53:43.318 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to broker was lost
org.eclipse.paho.client.mqttv3.MqttException: MqttException
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:197) [216:org.openhab.io.transport.mqtt:1.12.0.201802180209]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.lang.NoClassDefFoundError: com/jayway/jsonpath/Predicate
at org.eclipse.smarthome.transform.jsonpath.internal.JSonPathTransformationService.transform(JSonPathTransformationService.java:57) ~[?:?]
at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:65) ~[?:?]
at org.openhab.binding.mqtt.internal.MqttMessageSubscriber.processMessage(MqttMessageSubscriber.java:138) ~[?:?]
at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.messageArrived(MqttBrokerConnection.java:556) ~[?:?]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:475) ~[?:?]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:379) ~[?:?]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:183) ~[?:?]
... 1 more
Caused by: java.lang.ClassNotFoundException: com.jayway.jsonpath.Predicate cannot be found by org.eclipse.smarthome.transform.jsonpath_0.10.0.201802191927
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:410) ~[?:?]
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:372) ~[?:?]
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:364) ~[?:?]
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:161) ~[?:?]
at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:?]
at org.eclipse.smarthome.transform.jsonpath.internal.JSonPathTransformationService.transform(JSonPathTransformationService.java:57) ~[?:?]
at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:65) ~[?:?]
at org.openhab.binding.mqtt.internal.MqttMessageSubscriber.processMessage(MqttMessageSubscriber.java:138) ~[?:?]
at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.messageArrived(MqttBrokerConnection.java:556) ~[?:?]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:475) ~[?:?]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:379) ~[?:?]
at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:183) ~[?:?]
... 1 more
2018-02-27 13:53:43.532 [ERROR] [t.mqtt.internal.MqttBrokerConnection] - MQTT connection to 'mybroker' was lost: MqttException : ReasonCode 0 : Cause : com/jayway/jsonpath/Pr edicate
2018-02-27 13:53:43.538 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting connection helper to periodically try restore connection to broker 'mybroker'
2018-02-27 13:53:53.546 [INFO ] [t.mqtt.internal.MqttBrokerConnection] - Starting MQTT broker connection 'mybroker'
2018-02-27 13:53:58.923 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:53:58.928 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
2018-02-27 13:53:58.956 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:53:58.960 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
2018-02-27 13:53:58.967 [WARN ] [.core.transform.TransformationHelper] - Cannot get service reference for transformation service of type MAP
2018-02-27 13:53:58.971 [WARN ] [.core.transform.TransformationHelper] - Couldn't transform value because transformation service of type 'MAP' is not available.
I see that the connection to the mqtt broker gets lost and is started again???
Also, in PaperUI i see all that all transformations are uninstalled…
And when i install JSONPath Transformation again, my Si7021 sensor is no longer working
The install is a test on an Banana Pro with ssd on sata interface. It is a new install, on which i firtst wanted to try my new Sonoff TH16 with the sensors.
If that would work fine i am planning to transfer my current install on RPi2 to this platform.
I do not understand why the Sonoff with the Si7021 has stopped functioning in my sitemap; i did not touch this part of the config.
And on my tty sessies i see both Sonoff/sensor reacting on the mosquitto_sub commands…
Hopefully someone has a suggestion?
Is there perhaps a way to do this without using JSONPath?
Update.
Updated my openhab snapshot. had to reinstall all UI’s and Addons. Now the Sonoff/Si7021 is working again. But Sonoff/DS18B20 not. Still the folowing Map Transformation warnings about a NULL value:
2018-02-27 16:19:48.906 [WARN ] [.core.transform.TransformationHelper] - Transformation 'org.eclipse.smarthome.transform.map.internal.MapTransformationService@15a1e55' with value 'NULL' failed: An error occurred while opening file.