Here is the things, I have an item that is polling its value from a modbus sensor and I would like to forward that value to a MQTT broker using the follow profile and the MQTT 1.x binding. It seems to connect to the broker but not to send the correct payload.
As I understand it, the [profile="follow"] part would require you to specify another Item to follow - so I don’t think that does anything at all here and can be left out.
mqtt=">[mybroker ... should be sufficient to what you want, but I know nothing of configuring MQTT 1.x
First, use the state instead of command.
Second, the JSONPATH transform only works one way. You can’t do it this way.
You will need to use a JS transformation
Actually I’ve found a solution using version 2 that adds mqtt as a channel. I don’t know why it did not get to my mind yesterday. Way easier !!!
Need to add a mqtt Bridge thing with channels and commandTopic. Then add an item and the correct channel, in order to format to json, there’s the Format before Publish feature that allows that.