Sending mqtt command via jsonpath

Good day everyone,

The light I use has an MQTT topic in json format:

{“brightness”: 254, “color”: { “x”: 0.4146, “y”: 0.3952 }, “color_mode”:“color_temp”, “color_temp”: 299, “linkquality”: 3 “state”: "OFF "}

When I want to get the “state” parameter, I enter “JSONPATH:$.state” in the “Incoming Value Transformations” field.

When I enter the same in the “Outgoing Value Transformation” field to change the value of the “state” parameter, it doesn’t work.

Can someone please advise me how to solve this?

Thank you in advance Jan

Do you know this thread

Good day everyone,

Unfortunately, when describing my problem, I didn’t mention that it was a zigbee device connected via zigbee2mqtt. While studying the structure of mqtt topics for device control, I found that my problem can be solved quite easily by adding keywords to the topic (eg zigbee2mqtt/device_name/set) with {“state”: “ON”} ) as the payload. Other methods can be used in a similar way, see:

I hope that my findings will also help someone… ;-))

best regards Jan