How to remove quotes on MQTT channel (Text)

I just figured out that mqtt text channels always include the quotes:

image

So in OH it appears as:

Question: How can I get rid of the quotes at the beginning and the end of the string?

I looked into incoming transformation but couldn’t it figure out

A simple REGEX should work.

REGEX:"(.*)"
1 Like

@rlkoshak Rich, send me your paypal - I definitely owe you some drinks! :slight_smile:

This one was super easy. Thanks are enough. Glad it’s working for you!

1 Like

Btw: Is it also possible to do a map transformation on the regex in one step or do I have to use the state metadata of the item instead?

You can chain transformations. If it’s a switch, there’s the “custom ON/OPEN value” and “custom OFF/CLOSED value” fields also.

1 Like