I do have a Z-Wave window sensor that delivers the following state messages:
AccessControl: Window/Door is open, arg 0000
AccessControl: Window/Door is closed, arg 0000
I would like to do a state transformation within an MQTT binding. However, I am struggling with the BLANKS and COLONS contained in the delivered states from the Z-Wave device. What is the correct syntax for the state transformation. I tried the following which is not working:
String og_bad_sensor_fenster “Bad [%s]” {mqtt="<[mosquitto:og/bad/sensor/fenster:state:closed:AccessControl: Window/Door is closed, arg 0000],<[mosquitto:og/bad/sensor/fenster:state:open:‘AccessControl: Window/Door is open, arg 0000’]"}
The match is based on a regular expression so why not use it as such?
.*closed.*
.*open.*
Frankly, if these are the only two messages that get published to this topic you should just use a regular expression transform and skip the matching regular expression.
The Z-Wave stick is put on a different RPi. Right now, I am sending MQTT messages from FHEM to OH2. My FHEM installation is somewhat complex and before moving Z-Wave, Homematic, EnOcean an 433Mhz cul completely to OH2, I thought using MQTT in order to set up the items in the first place might be a good idea to get a first impression of OH2 items, sitemaps, and rules.[quote=“rlkoshak, post:2, topic:30603”]
Frankly, if these are the only two messages that get published to this topic you should just use a regular expression transform and skip the matching regular expression.