JSONPATH selects one value from a whole set of JSON key-value pairs. There’s not much use for that in an outbound transformation. You’d have to command your Item with a set of JSON so that the JSONPATH could pick out one value to be sent to MQTT.
That was a simple example.
I need to send multiple datatypes, no only switch, but color, string, etc…
I thought I could use JSONPATH to achieve this. I was mistaken i believe
If you need to send multiple different bits of info in one payload, it’s probably easiest to assemble that with a rule.
Once you’ve built your single string of JSON, you can either publish it directly from the rule using MQTT action, or command a suitable Item linked to channel.
If only need to send one Item’s worth of information in one payload, but it might be multi-part, like a Color state, you could use a javascript JS transform to build a JSON string and do any scaling or conversion of values