Outgoing Value Transformation - simple changes

I’ve got some Tuya radiator valves setup here as MQTT devices which return “device/child_lock” as LOCKED or UNLOCKED

I want to define that as a switch

The problem is that the topic device/set/child_lock needs LOCK or UNLOCK

Does anyone know what the output transformation syntax is for this?
(as these are likely to become more commonly used it might need a FAQ)

Just use a map transformation with

ON=LOCK
OFF=UNLOCK

in the .map file. (Or the other way around if that’s how it’s set up)

MQTT switch type channels provide a “mini-map-transform” in the form of the on= and off= parameters. It’s in the docs.

1 Like