I have a simple panel with two light switches that are also controlled by a group switch. The group switch state in the habpanel is not updating when I press it. These are in my kitchen, so I’ll call them K1, K2, and KG for the first, second and group switch. I tried debugging this in the browser, but quickly got lost when it got into vendor.js. The console message were useful though.
Case 1: Test K1 ON and OFF
Press the K1 switch: send K1 ON, update K1 state to ON, update KG state to ON
Press the K1 switch: send K1 OFF, update K1 state to OFF, update KG state to ON
Case 1 works as expected.
Case 2: Test K1 ON, then KG OFF
Press the K1 switch: send K1 ON, update K1 state to ON, update KG state to ON
Press the KG switch: send KG OFF, update K1 state to OFF
At this point, the K1 switch indicates OFF, but the KG switch incorrectly indicates ON. The actual light switches off as expected. The KG switch can not turn the lights on at this point, since its state is ON, when pressed it sends OFF.
Case 3: Turn on both lights with KG, then turn off K1 and K2
Press the KG switch: send KG ON, update K1 state to ON, update K2 state to ON
Press the K1 switch: send K1 OFF, update K1 state to OFF
Press the K2 switch: send K2 OFF, update K2 state to OFF
At this point KG is still ON.
In both case 2 and 3, KG’s state is not being updated, If I reload the panel, it sets the state correctly.
My items are defined as follows:
Switch kitchen_outer_lightsPower "Outer kitchen light" (gFF,LightsPwr,kitchen) {channel="mqtt:topic:mosquitt
o:kitchen_outer_lights:power"}
Switch kitchen_inner_lightsPower "Inner kitchen lights" (gFF,LightsPwr,kitchen) {channel="mqtt:topic:mosquitt
o:kitchen_inner_lights:power"}
Group:Switch:OR(ON,OFF) kitchen "Active lights [%d]"
I’m running OpenHab 2.5M5 on raspberry pi.
I can try debugging more, but I’ll need help. I OK with C++, python etc, but my web skills (javaScript, Java, Angular) are quite limited. Happy to learn more through!
Thanks,
Andy