All
I have a bunch of thermovalve (Thermotronic, z-wave) I control through a setpoint (allThermostatModes
), a group (gThermoStatMode
) and simple rules to switch between modes (off, economy, normal)
rule "Heat mode has changed"
when
Item allThermostatModes received command
then
val String ruleIdentifier = "Setting Heating System Mode"
logInfo(ruleIdentifier, "Heating system set to {} mode!", allThermostatModes.state)
gThermoStatMode.members.forEach[tv |
logInfo(ruleIdentifier, "Setting {} set to {} mode!", tv, allThermostatModes.state)
tv.sendCommand((allThermostatModes.state as Number).intValue)
]
end
Everything works OK since a year , each member directly map the operating mode into an int
value (0=Off, 1=Default, 11=Economy), no need to use any profile or transformation on the channel.
I have now added another thermovalve (same company, but DECT based), and the operation modes are Strings (ON/OFF/COMFORT/ECO/BOOST/WINDOW_OPEN).
Needless to say, the rule above cannot work.
To my understanding Channel Profile settings will modify the output of the channel ahead of passing it to the Item, but how can I remap back the Int
value from the rule back into the Item/thing?
I tried some “back-mapping” with “Command Options” but it did not seem to work.
I guess I could use some intermediate Item and rule to pass from integer to the string, but I wish there is a smarter way to do so.
For completeness, I use OH3.1 and I do not need to map all modes of the new thermovalve, I am happy if I can get the legacy one mapped.
Thanks for any hint!
Max