MQTT MAP device expects 0 or 1 but sending on or off

Recently migrated to OpenHab 3.0.2. My MQTT devices expect the command to be a 0 or 1 not on or off. In the previous version I had my items setup like this.

Switch pond_heater “Pond Heater” (all) [ “Lighting” ] {mqtt=">[broker:/PondCont/gpio/12:command:on:1],>[broker:/PondCont/gpio/12:command:off:0]"}

Switch pond_lamp “Pond Lamp” (all) [ “Lighting” ] {mqtt=">[broker:/PondCont/gpio/05:command:on:1],>[broker:/PondCont/gpio/05:command:off:0]"}

That worked great but in 3.1 its sending ON or OFF

I have created a new item with a MAP profile and a map file with this per the example

cat …/transform/bin.map

key=value
1=ON
0=OFF
ON=1
OFF=0
=default

After this it still sends ON or OFF I also tried adding various combinations of 1=ON, 0=OFF to the channel configuration in the GUI and still getting on or of sent to the topic.

openHAB 3.0.2 Mosquito broker PI 4.

You are using MQTT Binding V1 syntax, which OH3 can no longer use. You must move over to using the OH2/3 MQTT syntax. See this to convert:

If this is not the case please show us your Thing and Item configurations.

1 Like

Thank you that seemed to work.

HI
Do you mean need to add - on=“i-am-on”, off="i-am-off?