MQTT 2.4 configured in Item files

I’ve just upgraded to OpenHab 2.4 running on OpenHabian (rPi 3+) and I’ve had to remove the MQTT1 binding and look at using the MQTT 2 binding - probably about time!

I’ve managed to get most things working again but I’m having problems with my 433Mhz switchable sockets. I have another rPi monitoring a MQTT topic called rff_trx and it will broadcast over 433mhz any code sent via MQTT.

Within openHab I previously had this item configured to post to an OpenHab MQTT1 configured topic

Switch Socket_one       "Socket 1"  [Lighting]    {mqtt=">[mqtt:topic:cf9a9121:rff_trx:ON:1381717],>[mqtt:topic:cf9a9121:rff_trx:OFF:1381716]"}

I can’t work out how to get this working with the new MQTT2 binding. I have a working Broker thing (mqtt:broker:fb711156) and I’ve tested it. Is it possible to send two different codes from a single switch directly from the Items file?

I think you need outbound transformations for that, not available in MQTT binding 2.4

It’s not possible with 2.4 but there either transform is available in the 2.5 milestones. You could also apply a transform Profile. This is basically a map.

Another option is the latter milestone versions all you to define the mapping like this on the Channel definition itself, no need for the mapping transformation.

I don’t use .things files but in A aoerUI no it’s all there and pretty still explanatory.

Regrettably, profiles do not operate on outbound commands.

The channel’s on/off options offer simple transformation for switches, but not for outbound on 2.4