Crazy HVAC Rule when use .postUpdate

  • Platform information:

    • Hardware: Intel XEN VM/1GB RAM
    • OS: Deboam 9.2
    • Java Runtime Environment: Java™ SE Runtime Environment (build 1.8.0_45-b14)
    • openHAB version: openhab2-offline 2.0.0~b5
  • Issue of the topic:
    I have a rule for updating my KNX Heating Item (comfort/standby/night/frost) based on the HVAC status.
    If I use the rule just for logging the HVAC Status, everything works fine but after adding a .postUpdate for updating the Heating Item, it sends a standby to my Item/KNX GA, where it normaly should enable the last state of the Item (comfort).
    I think an example is better for understanding my problem:

Here is the rule i use. Just for logging, the postUpdate is commented out:

rule "r05hvac"
when
  Item R05_Heizung_Betriebsmodus_HVAC changed
then

logInfo("hkl-rule", "triggered")
  var set = 0
  if (R05_Heizung_Betriebsmodus_HVAC.state instanceof DecimalType) {
var value = R05_Heizung_Betriebsmodus_HVAC.state as DecimalType
if ((value.intValue().bitwiseAnd(0x08)) == 0x08) {
  set = 4
}
else if ((value.intValue().bitwiseAnd(0x04)) == 0x04) {
  set = 3
}
else if ((value.intValue().bitwiseAnd(0x02)) == 0x02) {
  set = 2
}
else if ((value.intValue().bitwiseAnd(0x01)) == 0x01) {
  set = 1
}
logInfo("hkl-rule", "set:" + set + " , recv:" + value)
//  R05_Heizung_Betriebsmodus.postUpdate(set)
end

As you can see, just log the value of set (1-4), based on hex HVAC state. .postUpdate ist disabled.

Here are the items:

Number R05_Heizung_Betriebsmodus “Modus” (gR05, gHeizung) { knx=“5.005:4/2/4” }
Number R05_Heizung_Betriebsmodus_HVAC (gR05, gHeizung) { knx="<5.005:4/2/2" }

There is an additional GA on my KNX actor for protection against freezing. When a window opens it’s set to true.
After opening HVAC is changing to 0x28 (freezing) and after closing to 0x21 (last state bevore opening > comfort).

Here are some logs from my KNX bus:

#,Zeit,Dienst,Flags ,Prio,Quell-Adresse,Quell-Name,Ziel-Adresse,Ziel-Name,Rout,Typ,DPT,Info
3,"13.12.2017 14:04:04,990",vom Bus,,Normal,0.1.1,Dummy,4/2/4,R.05 Betriebsmodus umschalten,5,Schreiben,5.* 8-Bit vorzeichenlos,$01 | 0 %
5,"13.12.2017 14:04:05,309",vom Bus,,Low,1.0.37,"AKH-0400.01 Heizungsaktor 4-fach, 2TE, 24/230VAC",4/2/2,R.05 Betriebsmodus Status,6,Schreiben,5.* 8-Bit vorzeichenlos,$21 | 13 %
8,"13.12.2017 14:04:32,808",zum Bus,,Low,0.1.2,-,5/2/7,R.05 Fenster1+2+3 geoeffnet,5,Schreiben,  1.002 Boolesch,$01 | Wahr
10,"13.12.2017 14:04:33,305",vom Bus,,Low,1.0.37,"AKH-0400.01 Heizungsaktor 4-fach, 2TE, 24/230VAC",4/2/4,R.05 Betriebsmodus umschalten,6,Schreiben,5.* 8-Bit vorzeichenlos,$04 | 2 %
11,"13.12.2017 14:04:33,336",vom Bus,,Low,1.0.37,"AKH-0400.01 Heizungsaktor 4-fach, 2TE, 24/230VAC",4/2/2,R.05 Betriebsmodus Status,6,Schreiben,5.* 8-Bit vorzeichenlos,$28 | 16 %
15,"13.12.2017 14:04:49,922",zum Bus,,Low,0.1.2,-,5/2/7,R.05 Fenster1+2+3 geoeffnet,5,Schreiben,  1.002 Boolesch,$00 | Falsch
19,"13.12.2017 14:04:53,303",vom Bus,,Low,1.0.37,"AKH-0400.01 Heizungsaktor 4-fach, 2TE, 24/230VAC",4/2/4,R.05 Betriebsmodus umschalten,6,Schreiben,5.* 8-Bit vorzeichenlos,$01 | 0 %
20,"13.12.2017 14:04:53,335",vom Bus,,Low,1.0.37,"AKH-0400.01 Heizungsaktor 4-fach, 2TE, 24/230VAC",4/2/2,R.05 Betriebsmodus Status,6,Schreiben,5.* 8-Bit vorzeichenlos,$21 | 13 %

and from Openhab:

==> /var/log/openhab2/events.log <==
2017-12-13 14:04:04.821 [ItemCommandEvent          ] - Item 'R05_Heizung_Betriebsmodus_HVAC' received command 33
2017-12-13 14:04:04.824 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus_HVAC changed from 34 to 33

==> /var/log/openhab2/openhab.log <==
2017-12-13 14:04:04.824 [INFO ] [ipse.smarthome.model.script.hkl-rule] - triggered
2017-12-13 14:04:04.827 [INFO ] [ipse.smarthome.model.script.hkl-rule] - set:1 , recv:33

==> /var/log/openhab2/events.log <==
2017-12-13 14:04:32.820 [ItemCommandEvent          ] - Item 'R05_Heizung_Betriebsmodus' received command 4
2017-12-13 14:04:32.821 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus changed from 1 to 4
2017-12-13 14:04:32.852 [ItemCommandEvent          ] - Item 'R05_Heizung_Betriebsmodus_HVAC' received command 40
2017-12-13 14:04:32.854 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus_HVAC changed from 33 to 40

==> /var/log/openhab2/openhab.log <==
2017-12-13 14:04:32.854 [INFO ] [ipse.smarthome.model.script.hkl-rule] - triggered
2017-12-13 14:04:32.855 [INFO ] [ipse.smarthome.model.script.hkl-rule] - set:4 , recv:40

==> /var/log/openhab2/events.log <==
2017-12-13 14:04:52.818 [ItemCommandEvent          ] - Item 'R05_Heizung_Betriebsmodus' received command 1
2017-12-13 14:04:52.819 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus changed from 4 to 1
2017-12-13 14:04:52.849 [ItemCommandEvent          ] - Item 'R05_Heizung_Betriebsmodus_HVAC' received command 33
2017-12-13 14:04:52.850 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus_HVAC changed from 40 to 33

==> /var/log/openhab2/openhab.log <==
2017-12-13 14:04:52.851 [INFO ] [ipse.smarthome.model.script.hkl-rule] - triggered
2017-12-13 14:04:52.854 [INFO ] [ipse.smarthome.model.script.hkl-rule] - set:1 , recv:33

When I enable the line “R05_Heizung_Betriebsmodus.postUpdate(set)”, the KNX actor sends a 0x22 after closing the window. Why???
I changed nothing. Just enabled the postUpdate Line.
Can anybody help me?

Here are the logs from my KNX Bus and Openhab with the .postUpdate Line:

KNX:

#,Zeit,Dienst,Flags ,Prio,Quell-Adresse,Quell-Name,Ziel-Adresse,Ziel-Name,Rout,Typ,DPT,Info
2,"13.12.2017 14:11:56,616",vom Bus,,Normal,0.1.1,Dummy,4/2/4,R.05 Betriebsmodus umschalten,5,Schreiben,5.* 8-Bit vorzeichenlos,$01 | 0 %
4,"13.12.2017 14:11:57,248",vom Bus,,Low,1.0.37,"AKH-0400.01 Heizungsaktor 4-fach, 2TE, 24/230VAC",4/2/2,R.05 Betriebsmodus Status,6,Schreiben,5.* 8-Bit vorzeichenlos,$21 | 13 %
5,"13.12.2017 14:11:57,258",vom Bus,,Low,0.1.1,Dummy,4/2/4,R.05 Betriebsmodus umschalten,5,Schreiben,5.* 8-Bit vorzeichenlos,$01 | 0 %
7,"13.12.2017 14:12:16,244",zum Bus,,Low,0.1.2,-,5/2/7,R.05 Fenster1+2+3 geoeffnet,5,Schreiben,  1.002 Boolesch,$01 | Wahr
9,"13.12.2017 14:12:17,246",vom Bus,,Low,1.0.37,"AKH-0400.01 Heizungsaktor 4-fach, 2TE, 24/230VAC",4/2/4,R.05 Betriebsmodus umschalten,6,Schreiben,5.* 8-Bit vorzeichenlos,$04 | 2 %
10,"13.12.2017 14:12:17,277",vom Bus,,Low,1.0.37,"AKH-0400.01 Heizungsaktor 4-fach, 2TE, 24/230VAC",4/2/2,R.05 Betriebsmodus Status,6,Schreiben,5.* 8-Bit vorzeichenlos,$28 | 16 %
11,"13.12.2017 14:12:17,286",vom Bus,,Low,0.1.1,Dummy,4/2/4,R.05 Betriebsmodus umschalten,5,Schreiben,5.* 8-Bit vorzeichenlos,$04 | 2 %
19,"13.12.2017 14:12:30,999",zum Bus,,Low,0.1.2,-,5/2/7,R.05 Fenster1+2+3 geoeffnet,5,Schreiben,  1.002 Boolesch,$00 | Falsch
22,"13.12.2017 14:12:33,244",vom Bus,,Low,1.0.37,"AKH-0400.01 Heizungsaktor 4-fach, 2TE, 24/230VAC",4/2/4,R.05 Betriebsmodus umschalten,6,Schreiben,5.* 8-Bit vorzeichenlos,$02 | 1 %
23,"13.12.2017 14:12:33,275",vom Bus,,Low,1.0.37,"AKH-0400.01 Heizungsaktor 4-fach, 2TE, 24/230VAC",4/2/2,R.05 Betriebsmodus Status,6,Schreiben,5.* 8-Bit vorzeichenlos,$22 | 13 %
24,"13.12.2017 14:12:33,285",vom Bus,,Low,0.1.1,Dummy,4/2/4,R.05 Betriebsmodus umschalten,5,Schreiben,5.* 8-Bit vorzeichenlos,$02 | 1 %

Openhab:

==> /var/log/openhab2/events.log <==
2017-12-13 14:11:56.766 [ItemCommandEvent          ] - Item 'R05_Heizung_Betriebsmodus_HVAC' received command 33
2017-12-13 14:11:56.768 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus_HVAC changed from 34 to 33

==> /var/log/openhab2/openhab.log <==
2017-12-13 14:11:56.769 [INFO ] [ipse.smarthome.model.script.hkl-rule] - triggered
2017-12-13 14:11:56.771 [INFO ] [ipse.smarthome.model.script.hkl-rule] - set:1 , recv:33

==> /var/log/openhab2/events.log <==
2017-12-13 14:11:56.773 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus changed from 2 to 1
2017-12-13 14:12:16.765 [ItemCommandEvent          ] - Item 'R05_Heizung_Betriebsmodus' received command 4
2017-12-13 14:12:16.765 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus changed from 1 to 4
2017-12-13 14:12:16.796 [ItemCommandEvent          ] - Item 'R05_Heizung_Betriebsmodus_HVAC' received command 40
2017-12-13 14:12:16.797 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus_HVAC changed from 33 to 40

==> /var/log/openhab2/openhab.log <==
2017-12-13 14:12:16.798 [INFO ] [ipse.smarthome.model.script.hkl-rule] - triggered
2017-12-13 14:12:16.800 [INFO ] [ipse.smarthome.model.script.hkl-rule] - set:4 , recv:40

==> /var/log/openhab2/events.log <==
2017-12-13 14:12:32.762 [ItemCommandEvent          ] - Item 'R05_Heizung_Betriebsmodus' received command 2
2017-12-13 14:12:32.764 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus changed from 4 to 2
2017-12-13 14:12:32.794 [ItemCommandEvent          ] - Item 'R05_Heizung_Betriebsmodus_HVAC' received command 34
2017-12-13 14:12:32.796 [ItemStateChangedEvent     ] - R05_Heizung_Betriebsmodus_HVAC changed from 40 to 34

==> /var/log/openhab2/openhab.log <==
2017-12-13 14:12:32.796 [INFO ] [ipse.smarthome.model.script.hkl-rule] - triggered
2017-12-13 14:12:32.798 [INFO ] [ipse.smarthome.model.script.hkl-rule] - set:2 , recv:34

Nobody with an idea? Or a hint?

This looks relevant

@rossko57 thanks for you fast reply.
That the KNX binding is sending back a command on the bus is a thing that I have allready learned.

But in my case, the actor (src physical adress in ETS is the one from the actor) is sending back 0x22 where it should 0x21.

Without the rule, the actor (?) behaves normal (sends 0x21).

Bear in mind that rule generated message will tell you what the “recv” value was BEFORE you do the postUpdate (send the device something new).
This is not a response to the postUpdate.

But why is the KNX actor behaving different with postUpdate?
Without postUpdate:

0x21 (comfort)
0x40 (freeze)
0x21 (comfort)

with postUpdate

0x21 (comfort)
0x40 (freeze)
0x22 (standby)

I don’t get it

I don’t know, but you will have sent different things to the device (via the postUpdate) so you probably need to look at how the HVAC is going to respond to those?