Temperature Value Not Displaying

Hi All,

I have openhab1 running on a raspberry pi,

In the .items file there is the following …

Group esp3

Number esp_workshop_temp “Workshop Temperature[%.0f Degree’s Celsius]” <temp_icon> (esp3) {mqtt="<[mymosquitto:/Workshop_1/DHT_Workshop/Temperature:state:default]"}

Group enode

Number enode_1 “DS18B20 Temperature [%.2f Degree’s Celsius]” <temp_icon> (enode) {mqtt="<[mymosquitto:/enode1/PZEM/from/temperature:state:default]"}

When looking at MQTT traffic using mqtt SPY …

/Workshop_1/DHT_Workshop/Temperature 23.00 and

/enode1/PZEM/from/temperature {“T0”:25.19}

The DHT_Workshop/Temperature is displayed correctly on the openhab web interface but no value is displayed for the PZEM device.

I notice the data value is inside curly brackets,while the working workshop nodes data is only the actual temperature value - “T0” being the device ID of the sensor connected to the node,up to 10 DS18B20’s can be connected to the same node and 25.19 is the temperature value.

What must the line be changed to in the items file to display the sensor number and its temperature value,are going to add more sensors to this node ?
tia

Dave

First stepp could be to change to

String esp_workshop_temp “Workshop Temperature[%s]” …

changing the line to String enode_1 “DS18B20 Temperature Sensor [%.12s]”

displays the whole data string sent from the node.

{“T0”:25.19}

Is there a way to remove the curly brackets from displaying perhaps ?

After adding another DS18B20 sensor to this node the data payload is {“T0”:21.31,“T1”:21.37}

T0 and T1 being the ID’s of the sensors

Is there a way to split this values so they show on their own lines in openhab web interface ?

You can you the JSONPATH transform either in the label or in the biding:

String enode_1 “DS18B20 Temperature [JSONPATH($.T0):%.2f Degree’s Celsius]” <temp_icon> (enode) {mqtt="<[mymosquitto:/enode1/PZEM/from/temperature:state:default]"}``csv

```

or

```csv
Number enode_1 “DS18B20 Temperature [%.2f Degree’s Celsius]” <temp_icon> (enode) {mqtt="<[mymosquitto:/enode1/PZEM/from/temperature:state:JSONPATH($.T0)]"}
```