Hello
I’ve setup my KNX HVAC modes using one channel and two items to manage my KNX HVAC modes. The item I use to manage it from the OpenHab Interface it’s configured as String and I have another item configured as Number to send the commands.
The Item configured as String has a a Default List Item Widget on Metadata and a stateDescription with the values in Options as
2=Standby
1=Comfort
4=Anti Congelacion
3=Noche
0=Automatico
This work as expected, as soon as I change values from the KNX the Item updates the value it shows, but if I try to change the value from the Item it sends the number as expected but the KNX value doesn’t change.
If I use the item with the number definition and input manually the value it changes as expected. To overcome this I’ve created a rule that monitors the string item and when it changes it sends a number to the number item.
configuration: {}
triggers:
- id: "1"
configuration:
itemName: Controlador_Estudio_Modo_Estudio
type: core.ItemStateChangeTrigger
conditions: []
actions:
- inputs: {}
id: "2"
configuration:
type: application/vnd.openhab.dsl.rule
script: |-
switch Controlador_Estudio_Modo_Estudio {
case Controlador_Estudio_Modo_Estudio.state.toString == '0' : {
Controlador_Estudio_Modo_Estudio_N.sendCommand(0)
logInfo("HVAC", "Seleccionado Automatico")
}
case Controlador_Estudio_Modo_Estudio.state.toString == '1' : {
Controlador_Estudio_Modo_Estudio_N.sendCommand(1)
logInfo("HVAC", "Seleccionado Comfort")
}
case Controlador_Estudio_Modo_Estudio.state.toString == '2' : {
Controlador_Estudio_Modo_Estudio_N.sendCommand(2)
logInfo("HVAC", "Seleccionado Standby")
}
case Controlador_Estudio_Modo_Estudio.state.toString == '3' : {
Controlador_Estudio_Modo_Estudio_N.sendCommand(3)
logInfo("HVAC", "Seleccionado Noche")
}
case Controlador_Estudio_Modo_Estudio.state.toString == '4' : {
Controlador_Estudio_Modo_Estudio_N.sendCommand(4)
logInfo("HVAC", "Anticongelacion") }
}
type: script.ScriptAction
This works as expected, but for me it doesn’t seem a clean solution to have two items associated to the same function to obtain the expected result. Any advice on this? Maybe I’m overengeering it?
Regarfs