If you are certain that the values shown at the bottom of the readme are precisely what’s in the messages then the author did not need to use REGEX in the Items. If the message contains nothing more than a numeric string, you don’t need REGEX to parse it. So I don’t understand why the author included it in the example.
Here’s another thing I don’t understand in the example. In openHAB’s MQTT binding, this >
means to publish (transmit) and this <
means to subscribe (receive). So the following means subscribe to the topic my:ventilation/control/VentSet
{mqtt="<[my:ventilation/control/VentSet:state:REGEX(([0-9-]+))]"}
However, the topic contains the word control
which implies it is used to control the thermostat (i.e. transmit commands to the thermostat). Synonyms for control
are command
and set
which are often used to identify topics that publish (transmit) a command to the thermostat. Yet here the author is using this topic to subscribe (receive). That doesn’t seem right to me.
Based on the symbols >
and <
here are the state topics (subscribe/receive) and the command topics (publish/transmit). Like I said, the topics containing the word control
are used to receive state information which seems odd to me.
State topics
my:ventilation/control/RunSet
my:ventilation/control/ModeSet
my:ventilation/control/VentSet
my:ventilation/control/TempSet
my:temp/T7_Inlet
my:temp/T8_Outdoor
Command topics
my:ventilation/RunSet
my:ventilation/ModeSet
my:ventilation/VentSet
my:ventilation/TempSet
I suggest you use an MQTT client to confirm which topics are used to receive messages (state topics) and which ones are used to transmit messages (command topics). After you have clarified their purpose, we can proceed to use them with MQTT HVAC.
I should point out that these openHAB mappings mean we will definitely have to use templates to convert the received operating mode and temperature values:
Selection item=nilanmode label="Funktion" mappings=[0= "Off", "1"="Heat", "2" = "Cool", 3 = "Auto", 4 = "Service"]
Selection item=nilantemp label="Temperatur" mappings=[1900="19", 2200="22", 2500="25"]
The operating mode called “Service” does not exist in MQTT HVAC. This mode will have to be mapped to one of the defined modes.