Migrating from Smartthings to Openhab with MQTT solution

I’m doing a migration from ST. The goal for me is to keep all switches/dimmers/locks under control of both ST and OH. So wife and me can gradually adopt to the new GUI. Currently I’m using MQTT as a communication channel between ST and OpenHAB.

So far, with SmartThings MQTT Bridge and a custom build simulated switch and a modified SmartApp. I can control my zwave switches/outlets from both OH and Smartthings, witch Zwave devices physically bound to OH. (the provided device handler assume devices are physically bound to ST)

Now I’m working on some simulated Dimmer switch in ST to be able to receive level / switch states updates from OH, which can also send device command to OH through MQTT. I’m really new to this OH items definition, run into a problem:

Here is my OH item definition:

Dimmer ZW_Nook_Light "Nook Light" {channel="zwave:device:0d709550:node3:switch_dimmer", mqtt=">[mosquitto:openHAB/Nook Light/level/cmd:state:*:MAP(toST.map)], <[mosquitto:openHAB/Nook Light/levelCommand/state:command:*:MAP(fromST.map)]"}

What I want to achieve through the transformation is:
ON => on
OFF => off
any number => as is, e.g. 45 => 45

Not sure how to write my transform map file, I defined this in my toST.map:

The problem is: ON/OFF is converted to on/off (lower case) no problem. but any number is converted to empty string.
info: Incoming message from MQTT: openHAB/Nook Light/level/cmd =

How should I define a “default mapping” in the map file? say, preserve any value not defined explicitly as is …

Or, is there a transform function like “toLowercase”?

Thanks in advance.

I solved this problem with a JS mapping!

Now any action in OH will be updated to ST; and any command initiated in ST will be trigger action through OH, and update state back to ST.

Dimmer ZW_Nook_Light "Nook Light" {channel="zwave:device:0d709550:node3:switch_dimmer", mqtt=">[mosquitto:openHAB/Nook Light/level/cmd:state:*:JS(toST.js)],<[mosquitto:openHAB/Nook Light/levelCommand/state:command:JS(fromST.js)]"}


	return val.toLowerCase();


	return val.toUpperCase();