That is correct.
@ysc I can confirm your observations. Did it myself in a test setup. This leaded me to another question I wanted to test: Which event will we see when we have a group containing only one member:
Group:Switch:OR(ON,OFF) gTESTSWITCHES1 "Test Switches 1"
Switch testSwitch1 "Test Switch 1" (gTESTSWITCHES1)
Initial situation: state of Switch and Group are both ON.
1st try: Sending OFF to Switch:
openhab> smarthome:send testSwitch1 OFF
Command has been sent successfully.
event: message
data: {"topic":"smarthome/items/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"OFF\",\"oldType\":\"OnOff\",\"oldValue\":\"ON\"}","type":"ItemStateChangedEvent"}
event: message
data: {"topic":"smarthome/items/gTESTSWITCHES1/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"OFF\",\"oldType\":\"OnOff\",\"oldValue\":\"ON\"}","type":"GroupItemStateChangedEvent"}
working
2nd try: Sending ON to Switch:
openhab> smarthome:send testSwitch1 ON
Command has been sent successfully.
event: message
data: {"topic":"smarthome/items/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"ON\",\"oldType\":\"OnOff\",\"oldValue\":\"OFF\"}","type":"ItemStateChangedEvent"}
event: message
data: {"topic":"smarthome/items/gTESTSWITCHES1/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"ON\",\"oldType\":\"OnOff\",\"oldValue\":\"OFF\"}","type":"GroupItemStateChangedEvent"}
again working
3rd try: Sending OFF to Group:
openhab> smarthome:send gTESTSWITCHES1 OFF
Command has been sent successfully.
event: message
data: {"topic":"smarthome/items/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"OFF\",\"oldType\":\"OnOff\",\"oldValue\":\"ON\"}","type":"ItemStateChangedEvent"}
Outch, failing - GroupItemStateChangedEvent is missing.
4th try: Sending ON to Group:
openhab> smarthome:send gTESTSWITCHES1 ON
Command has been sent successfully.
event: message
data: {"topic":"smarthome/items/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"ON\",\"oldType\":\"OnOff\",\"oldValue\":\"OFF\"}","type":"ItemStateChangedEvent"}
Outch, again failing - GroupItemStateChangedEvent is missing.
I did the same tests with a group containing two members. Ping me if you ate interested in the results. // EDIT: I added them below. They reflect your findings.
Summary
Group:Switch:OR(ON,OFF) gTESTSWITCHES2 "Test Switches 2"
Switch testSwitch1 "Test Switch 1" (gTESTSWITCHES2)
Switch testSwitch2 "Test Switch 2" (gTESTSWITCHES2)
Initial situation: state of both Switches and Group are ON.
1st try: Sending OFF to Switch 1 and Switch 2:
openhab> smarthome:send testSwitch1 OFF
Command has been sent successfully.
event: message
data: {"topic":"smarthome/items/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"OFF\",\"oldType\":\"OnOff\",\"oldValue\":\"ON\"}","type":"ItemStateChangedEvent"}
openhab> smarthome:send testSwitch2 OFF
Command has been sent successfully.
event: message
data: {"topic":"smarthome/items/testSwitch2/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"OFF\",\"oldType\":\"OnOff\",\"oldValue\":\"ON\"}","type":"ItemStateChangedEvent"}
event: message
data: {"topic":"smarthome/items/gTESTSWITCHES2/testSwitch2/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"OFF\",\"oldType\":\"OnOff\",\"oldValue\":\"ON\"}","type":"GroupItemStateChangedEvent"}
working
2nd try: Sending ON to Switch 1 and Switch 2:
openhab> smarthome:send testSwitch1 ON
Command has been sent successfully.
data: {"topic":"smarthome/items/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"ON\",\"oldType\":\"OnOff\",\"oldValue\":\"OFF\"}","type":"ItemStateChangedEvent"}
event: message
data: {"topic":"smarthome/items/gTESTSWITCHES2/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"ON\",\"oldType\":\"OnOff\",\"oldValue\":\"OFF\"}","type":"GroupItemStateChangedEvent"}
openhab> smarthome:send testSwitch2 ON
Command has been sent successfully.
event: message
data: {"topic":"smarthome/items/testSwitch2/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"ON\",\"oldType\":\"OnOff\",\"oldValue\":\"OFF\"}","type":"ItemStateChangedEvent"}
working
3rd try: Sending OFF to Group:
openhab> smarthome:send gTESTSWITCHES2 OFF
Command has been sent successfully.
event: message
data: {"topic":"smarthome/items/gTESTSWITCHES2/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"ON\",\"oldType\":\"OnOff\",\"oldValue\":\"OFF\"}","type":"GroupItemStateChangedEvent"}
event: message
data: {"topic":"smarthome/items/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"OFF\",\"oldType\":\"OnOff\",\"oldValue\":\"ON\"}","type":"ItemStateChangedEvent"}
event: message
data: {"topic":"smarthome/items/gTESTSWITCHES2/testSwitch2/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"OFF\",\"oldType\":\"OnOff\",\"oldValue\":\"ON\"}","type":"GroupItemStateChangedEvent"}
event: message
data: {"topic":"smarthome/items/testSwitch2/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"OFF\",\"oldType\":\"OnOff\",\"oldValue\":\"ON\"}","type":"ItemStateChangedEvent"}
Outch - two GroupItemStateChangedEvents, one seem to be absolutely wrong - conurrency issue???
4th try: Sending ON to Group:
openhab> smarthome:send gTESTSWITCHES2 ON
Command has been sent successfully.
event: message
data: {"topic":"smarthome/items/testSwitch1/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"ON\",\"oldType\":\"OnOff\",\"oldValue\":\"OFF\"}","type":"ItemStateChangedEvent"}
event: message
data: {"topic":"smarthome/items/testSwitch2/statechanged","payload":"{\"type\":\"OnOff\",\"value\":\"ON\",\"oldType\":\"OnOff\",\"oldValue\":\"OFF\"}","type":"ItemStateChangedEvent"}
Outch - no GroupItemStateChangedEvent at all
IIRC the unit tests only handle updateState() on items. sendCommand() on groups is NOT covered!
Conclusion: First of all forget about my suggestion to trigger an ItemStateChangedEvent. We do not need it. There is something wrong with the calculation at which time a GroupItemStateChangedEvent will be emitted. Lets open an issue on GitHub · Where software is built.