How to define an item with MQTT payload {...}

I have an MQTT433Gateway.

I want to link an item to the MQTT message. The problem is the payload looks like this:

{“id”:6, “unit”:2, “state”:“on”}

The curly brackets are part of the payloud.

How should the item definition look like?

Thanks.

Make a topic like …/6/2 or make it one string („id:6,unit:2,state:on”) and send it all as payload.

Actually I want to receive that payload and understand it.

I solved it with the Json manipulation extension. Now my item is like this:

mqtt="<[mosquitto:rf434/recv/conrad_rsl_switch/6:state:JSONPATH($.state)]"}

Ah o.k., because it’s a string you have to provide a string item for receiving:

String receive_mqtt_message "MQTT Teststring [%s]" <info> {mqtt="<[<broker>:test/string:state:default]"}
  Frame label="Test" {
    Text label="Test" icon="info" {
      Switch item=testSwitch mappings=[ON="Ein", OFF="Aus"]
      Text item=testString
    }
  } 

Then you have to extract from this string the values you need. Looks like that.

grafik