Executing the JSONPATH-transformation failed: Invalid path '$.BME280.Pressure' in '{"Time":"2022-08-12T10:01:20","Switch1":"ON"}'

  • Platform information:
    • Raspberry PI4 4GB
    • Openhabian

looked at the logfiles and have seen this every 5 mins

2022-08-12 10:56:20.769 [WARN ] [t.generic.ChannelStateTransformation] - Executing the JSONPATH-transformation failed: Invalid path ‘$.BME280.Temperature’ in ‘{“Time”:“2022-08-12T09:56:20”,“Switch1”:“ON”}’

2022-08-12 10:56:20.769 [WARN ] [t.generic.ChannelStateTransformation] - Executing the JSONPATH-transformation failed: Invalid path ‘$.BME280.Pressure’ in ‘{“Time”:“2022-08-12T09:56:20”,“Switch1”:“ON”}’

2022-08-12 10:56:20.781 [WARN ] [t.generic.ChannelStateTransformation] - Executing the JSONPATH-transformation failed: Invalid path ‘$.BME280.Humidity’ in ‘{“Time”:“2022-08-12T09:56:20”,“Switch1”:“ON”}’

i have 4 BME280 tasmota sensors but none have a Teleperiod set to 5 mins ,they have either 60 secs or 120 secs

all sensors are on , and posting temp,humidity and pressure i believe .

using this JSONPATH:$.BME280. on the channel transformation values.

not sure where to look for a solution?

The status topic you selected doesn’t contain the BME280 sensor information. In such cases it is beneficial to use a tool e.g. the MQTT explorer to check what is sended by Tasmota and for which topic. It seems that Tasmota configuration is not correct, so that the BME280 sensor information is not published.

i do use

JSONPATH:$.BME280.Temperature

JSONPATH:$.BME280.Humidity

JSONPATH:$.BME280.Pressure

i have 4 of these sensors and all are giving me readings

Sure, but the point is that one or more of your state topics is also getting a message that DOES NOT include BME280.xxxx and so the attempt to transform it fails.

Have a closer look at the error message.

Your channel that is subscribed to topic blah/bleh/stat or whatever it might be, sometimes gets message payloads that include the JSON element that you are lookng for.

And sometimes the message payload on the same topic is
{“Time”:“2022-08-12T09:56:20”,“Switch1”:“ON”}
which of course does not contain any BME280 element, so the JSONPATH that you asked it do will fail, and it tells you so.

It’s doing what you asked it to do, but making nuisance log entries.

So you will need to change what you are asking for. Only try to extract the JSON for “temperature” if the JSON actually does include “temperature”.
There’s a well-known technique to do that by first using REGEX to filter messages, before trying JSONPATH.

1 Like
  • sure that there are no other things that may by accident use the wrong JSONPATH expression ?
  • temporarily disable your 4 known BME280 things to see if the warning messages still occurs; this should make clear if the message is related to these 4 or other things
1 Like