JSONPATH-transformation failed

I had a working thing with three channels each extracting a temperature from an mqtt string. It was displaying the three temperatures without issue for a few hours then when I check later all values just showed a hyphen.
The following is an extract from the log.

Executing the JSONPATH-transformation failed: Invalid path '$.3C01A8160EFB.Temperature' in '{"Time":"2020-06-20T13:35:52","DS18B20_1":{"Id":"3C01A8160EFB","Temperature":34.4},"DS18B20_2":{"Id":"3C01A8162221","Temperature":28.3},"DS18B20_3":{"Id":"51D7FD1D64FF","Temperature":35.5},"TempUnit":"C"}'

I can’t see where the problem is, I’ve reinstalled the JSONpath transformation and restarted openhab but it’s still giving the error. I did add a new thing and item but it was still working after that. No other things have a JSON transformation. Since then I’ve removed the new thing and item and restarted openhab but I’m still getting the error.

Hi Lester, you’re having a mare with these sensors!

Your transformationPattern should look something like:


The ID attribute is nested at the same level as the temperature attribute - the ID attribute doesn’t have a temperature attribute.

Nothing changed at the sensor end? An explanation is that the format of the JSON string has somehow changed…

Hi Lester

Maybe openhab can’t see the sensor any more

What controller you got the sensors plugged into

If it’s a D1 mini with Tasmota firmware you can see the temperatures of sensors on main screen?
If can’t see them maybe loose connection?

Maybe a reboot may help?

Yet it was working.
I’ve now changed the


back to


and saved it but the log still shows it is looking for


I’m using Visual Studio Code to create and edit my scripts and it normally shows any syntax errors but I get the following in my log.

2020-06-20 15:21:55.458 [INFO ] [el.core.internal.ModelRepositoryImpl] - Validation issues found in configuration model 'mythings.things', using it anyway:

2020-06-20 15:21:55.471 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'mythings.things'

It seems to be ignoring the change. There are 3 things in mythings.things and the others are working fine but they don’t use the JSON transformation.

openhab is seeing the tasmota device with the sensors because that is where it is getting the mqtt string shown in the error log. The device console also shows that it is sending the message every minute.

You’d have to post the entire contents of mythings.things if you want troubleshooting help!

This is mythings.things file.

Bridge mqtt:systemBroker:embedded-mqtt-broker [host="openhab", secure=false] {
Thing mqtt:topic:nodemcu1 "nodemcu1" @ "myHome/Water_Heater"
			Type number : temperature "Temperature" [
			Type number : temperature2 "Temperature2" [
			Type number : temperature3 "Temperature3" [
Thing mqtt:topic:sonoffs26_1 "SonoffS26_1" @ "myHome/Living_Room"
			Type switch : power "S26_1 On/Off" [ 
Thing mqtt:topic:sonoffs26_2 "SonoffS26_2" @ "myHome/Living_Room" 
			Type switch : power "S26_2 On/Off" [ 

Visual Studio Code doesn’t show any errors.


Have you changed anything like typing sensor ID wrong .

Nothing to do with Setoption64 ?

I’m just a beginner here

Nothing was changed from when it was working until it wasn’t.
The fact that I have now changed from the id (3C01A8162221) to name (DS18B20_2) and saved the file but openhab is still looking for the id I think is the clue.
openhab isn’t seeing the change in the things file or that section of the things file.


Not sure how you do it ,Google be your friend

Maybe clean the openhab2 cache?

What version of OpenHAB are you using? Earlier versions required a complete restart after changing a things file. This was only fixed ‘relatively’ recently…

(Also, a small note: the embedded MQTT broker will go away in future versions of OpenHAB. At this stage I would take the opportunity to move to stand-alone MQTT broker, such as Mosquitto)

OK. I’ve tried swapping id and name back and forth with a reboot each time I make a change and it appears that it doesn’t work with id. I would swear the values changed when I first swapped to id but perhaps I saved the changes but didn’t restart openhab so it was still using the name.
If that is the case, what is the transformation needed to extract the Temperature from the following string based on id?


Unless I really misunderstand JSON, you can’t extract the temperature based on the ID attribute - they are not related other than being at the same level. You can visualise the levels like so:

	"Time": "2020-06-20T13:35:52",
	"DS18B20_1": {
		"Id": "3C01A8160EFB",
		"Temperature": 34.4
	"DS18B20_2": {
		"Id": "3C01A8162221",
		"Temperature": 28.3
	"DS18B20_3": {
		"Id": "51D7FD1D64FF",
		"Temperature": 35.5
	"TempUnit": "C"

As you can see, DS18B20_1 is the ‘name’ of a group of attributes, which are Id and Temperature. Using transformationPattern to extract temperature, you need:


To be clear, you can’t extract Temperature using Id.

To perhaps give you more to work with, see my thing below. This is a Sonoff Basic switch with a DHT22 sensor attached, flashed with Tasmota. My MQTT broker is Mosquitto, which I have defined in a separate things file and is referenced in the (mqtt:broker:MosquittoMqttBroker) part of the thing definition.

    // Switch Bedroom Desk Light
	Thing mqtt:topic:swBedroomDeskLight "Switch Bedroom Desk Light" (mqtt:broker:MosquittoMqttBroker) {
			Type switch : switch "Power Switch" [ 
			Type switch : reachable "Reachable" [
				stateTopic = "tele/swBedroomDeskLight/LWT",
			Type number : temperature "Temperature" [ 
			Type number : humidity "Humidity" [ 
			Type string : tempunit "TempUnit" [ 
			Type switch:state "State" [

The JSON string received on tele/swBedroomDeskLight/SENSOR looks very similar to yours:


Because Temperature is within the group AM2301, my transformationPattern is:


OK. It’s working again after changing back to names for all 3 sensors and restarting.
I’m worried that if I restart the nodemcu with sensors attached that it may rename them depending on the order in which is sees them.

Can I install Mosquitto in parallel with the embedded broker and change over one at a time to make sure I don’t stuff something else up?

I don’t know the answer to that, unfortunately. I presume the default ports for both brokers is the same, which might cause some issues.

I’ve just updated to openhab 2.5.5-1.
I’ll let you know how I go converting to Mosquitto.
Thanks again for your help.

I deleted my MQTT Broker under Things in PaperUI and uninstalled the MQTT binding then followed an article I found on how to install Mosquitto…
I then went into openhab configuration > optional components and installed Mosquitto. I then went into Things in PaperUI and installed MQTT Broker. In the configuration there is a field for Broker ID.

The thing shows the same as the last one mqtt:systemBroker:embedded-mqtt-broker

Configuration of the broker needs a Broker ID.

Do you know what form the Broker ID should take?

So you installed Mosquitto twice? Are you on openhabian? I’m not, so my system may vary…

All I did was install Mosquitto completely separately from openHAB using the instructions on the Mosquitto website.

Then, back in openHAB, I have a single things file with the following:

Bridge mqtt:broker:MosquittoMqttBroker "Mosquitto MQTT Broker" [

That’s it, I think.

In PaperUI I can then see (under Configuration -> Things):


Each thing is then connected to Mosquitto as exampled in JSONPATH-transformation failed

You definitely need to re-install this, though!!

Careful, “System Broker” is not what you want, that is about the embedded moquette broker that you just abandoned.

You want a Bridge Thing under the MQTT binding, pointing to your mosquitto.

It is, by the way, quite common for bindings not to pick up small edits to existing Things in-flight. Generally you only need to restart the binding to enforce new settings, not re-boot, not cache clearing.