[SOLVED] MQTT read multiple values from one line

Hi,
i have a little problem how to read/spilt multiple values.
What i can is:

BME/Temperature 23.36
BME/Humidity 51.36
BME/Pressure 1018.74

it is single lined and i can read in items with:

Number    F2_Upstairs_Temperature   "Temperatur [%.2f °C]"         <temperature>   (F2_Upstairs, gTemperature)       {mqtt="<[broker:BME/Temperature:state:default]"}

Now i have a new device what send me all the data in one message:

/sonoffSC1/SENSOR {"Time":"2018-08-11T11:58:04","SonoffSC":{"Temperature":26.0,"Humidity":16.0,"Light":60,"Noise":30,"AirQuality":100},"TempUnit":"C"}

I have never seen this messaging before and stay a little bit for a wall.
Can me help someone over it? How can i read and show the different values?

Use JSONPATH to extract values from the Sonoff’s JSON payload.

install
JSONPath Transformation
then

{mqtt="<[broker:/sonoffSC1/SENSOR:state:JSONPATH($.SonoffSC.Temperature)]"}

JsonPath Transformation Service

1 Like

Thank you, that was to easy :slight_smile:

Works great!