OH3 changes JSON value

I’m getting from MQTT a valid JSON string. If I store this value in a string item, OH changes every : to a =. The problem now is that i cannot use the JSONPATH transformer to get out a the needed value.

For example: I am getting {“barometric_pressure_1”:974,“relative_humidity_1”:44,“temperature_1”:20} from MQTT and store it in a string item linked to my MQTT Channel. But now the shown value of the item is {barometric_pressure_1=974, relative_humidity_1=36, temperature_1=23} and I want to get the temperature value with JSONPATH but that doesn’t work obviously.

I hope you can help me

How do you know? i.e. where are you looking to inspect this Item state.
It sounds like an odd character set issue.

You know you can do that in the MQTT channel?

Are you using a generic topic Thing here, or have you created an event channel linked directly to your broker bridge Thing?

When you press on the linked item it shows it’s value.

Yeah I know, but i want to use one MQTT Channel for multiple data and sort out the data in the linked item itself.

Generic MQTT Thing

May we see your config? Will you show your events.log for a change to your Item?

A generic MQTT Thing suppots multiple channels, each of which can extract a different bit of JSON from the same payload, and update multiple Items of different types.

I’m having the same problem. I tried to have a channel that reads a MQTT topic with a json payload, which partially extracts the info, and then multiple items that extract just what they need from the result

The topic contains the following json:

{"Info1":{"Module":"Sonoff ZbBridge","Version":"12.1.1(zbbridge)","FallbackTopic":"cmnd/DVES_28A286_fb/","GroupTopic":"cmnd/tasmotas/"}}

I have a “Info1” channel with a transformation of $.Info1 I was expecting this to give me:

{"Module":"Sonoff ZbBridge","Version":"12.1.1(zbbridge)","FallbackTopic":"cmnd/DVES_28A286_fb/","GroupTopic":"cmnd/tasmotas/"}

and then I could have multiple items that just extract a single part eg $.Module $.Version etc.

But what I get is:

{Module=Sonoff ZbBridge, Version=12.1.1(zbbridge), FallbackTopic
=cmnd/DVES_28A286_fb/, GroupTopic=cmnd/tasmotas/}

I can work around it by having no transformation on the channel, and then on the items extracting with the full path. eg: $.Info1.Module $.Info1.Version

The thing/channel config is:

UID: mqtt:topic:local:zbbridge
label: Zigbee Bridge
thingTypeUID: mqtt:topic
  payloadNotAvailable: Offline
  availabilityTopic: tele/tasmota_28A286/LWT
  payloadAvailable: Online
bridgeUID: mqtt:broker:local
  - id: info1
    channelTypeUID: mqtt:string
    label: Info1
    description: ""
      stateTopic: tele/tasmota_28A286/INFO1
      transformationPattern: $.Info1

My events.log shows:

2022-09-13 12:36:15.978 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ZigbeeBridge_module' changed from NULL to {Module=Sonoff ZbBridge, Version=12.1.1(zbbridge), FallbackTopic=cmnd/DVES_28A286_fb/, GroupTopic=cmnd/tasmotas/}

Welcome to openHAB forum!

openHAB cannot guess that you meant JSONPATH, not MAP or SCALE etc. transformation. You have to tell it.

However, you’re on the wrong general approach here.

A Thing may have multiple channels with identical stateTopic

When a single incoming message matches the stateTopic, all channels will receive the whole message for processing.

psuedo-config -
channelA stateTopic=bleh/blah transform=JSONPATH:$.Info1.Module
channelB stateTopic=bleh/blah trandform=JSONPATH:$.Info1.Version

Then link to ItemA, ItemB