OH3 - Group State delayed for item members

Thanks @rossko57 .

I did another test and added three new test items and a new test group.

The state change event was fired the first two times when I toggled the group switch immediately as it should be.

Then I changed a item member

  • in the first test it took 40sec for the group item to change the state.
  • in the second test it took 20sec

Hopefully a Core Maintainer read this discussion - not sure whom to contact to report this problem.
@michaeljoos already opened an issue for this on GitHub.

2021-04-10 09:56:52.926 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'gTest' received command ON
2021-04-10 09:56:52.926 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test_2' received command ON
2021-04-10 09:56:52.926 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test_3' received command ON
2021-04-10 09:56:52.926 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test_1' received command ON
2021-04-10 09:56:52.927 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_2' changed from NULL to ON
2021-04-10 09:56:52.927 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_3' changed from NULL to ON
2021-04-10 09:56:52.927 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_1' changed from NULL to ON
2021-04-10 09:56:52.927 [INFO ] [hab.event.GroupItemStateChangedEvent] - Item 'gTest' changed from NULL to ON through Test_2
2021-04-10 09:57:00.457 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'gTest' received command OFF
2021-04-10 09:57:00.457 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test_2' received command OFF
2021-04-10 09:57:00.457 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test_3' received command OFF
2021-04-10 09:57:00.457 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test_1' received command OFF
2021-04-10 09:57:00.461 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_2' changed from ON to OFF
2021-04-10 09:57:00.461 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_3' changed from ON to OFF
2021-04-10 09:57:00.462 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_1' changed from ON to OFF
2021-04-10 09:57:00.462 [INFO ] [hab.event.GroupItemStateChangedEvent] - Item 'gTest' changed from ON to OFF through Test_3
2021-04-10 09:57:06.394 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test_2' received command ON
2021-04-10 09:57:06.394 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_2' changed from OFF to ON
2021-04-10 09:57:06.394 [INFO ] [hab.event.GroupItemStateChangedEvent] - Item 'gTest' changed from OFF to ON through Test_2
2021-04-10 09:57:12.362 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test_2' received command OFF
2021-04-10 09:57:12.363 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_2' changed from ON to OFF
2021-04-10 09:57:55.240 [INFO ] [hab.event.GroupItemStateChangedEvent] - Item 'gTest' changed from ON to OFF through Test_2
2021-04-10 09:58:35.454 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Test_3' received command ON
2021-04-10 09:58:35.454 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_3' changed from OFF to ON
2021-04-10 09:58:54.091 [INFO ] [hab.event.GroupItemStateChangedEvent] - Item 'gTest' changed from OFF to ON through Test_3
{
  "members": [
    {
      "link": "http://192.168.5.22:8192/rest/items/gTest",
      "state": "OFF",
      "type": "Switch",
      "name": "Test_2",
      "label": "",
      "category": "",
      "tags": [
        "Point"
      ],
      "groupNames": [
        "gTest"
      ]
    },
    {
      "link": "http://192.168.5.22:8192/rest/items/gTest",
      "state": "ON",
      "type": "Switch",
      "name": "Test_3",
      "label": "",
      "category": "",
      "tags": [
        "Point"
      ],
      "groupNames": [
        "gTest"
      ]
    },
    {
      "link": "http://192.168.5.22:8192/rest/items/gTest",
      "state": "OFF",
      "type": "Switch",
      "name": "Test_1",
      "label": "",
      "category": "",
      "tags": [
        "Point"
      ],
      "groupNames": [
        "gTest"
      ]
    }
  ],
  "groupType": "Switch",
  "function": {
    "name": "OR",
    "params": [
      "ON",
      "OFF"
    ]
  },
  "link": "http://192.168.5.22:8192/rest/items/gTest",
  "state": "OFF",
  "editable": true,
  "type": "Group",
  "name": "gTest",
  "label": "Test Group",
  "category": "",
  "tags": [
    "Switch"
  ],
  "groupNames": []
}

It seems that this is a performance issue. At least in my setup.
Because of fears for power failure / data loss I always have disabled ZRAM in my system with approx 700 items. CPU-Load with that configuration was all the time between 1.5 and 2.5 (Raspi 4 4GB and 8GB). Now with ZRAM enabled CPU-Load is between 0.1 and 0.3 (!!) and Group Items always working without any delay. And to avoid Power/Data-Loss I bought a Zendure X6 with UPS-Functionality. Quite expensive but it works perfect!

→ RRD4j persistence is the default in OH3 and set to every change/every minute and it is from perfomance point of view (and SD-Card) most probably not the best solution to write ±700 Items all the time to SD-Card.

The time between CommandEvent and state change has increased significantly - currently the state is not changing anymore at all (or maybe I have to be very patient waiting for severals days :frowning: )

Docker performance seems not to be the issue - OH3 in general respond fast.

top - 17:05:28 up 15 days, 20:06,  0 users,  load average: 3.71, 3.83, 3.49
Tasks:   4 total,   1 running,   3 sleeping,   0 stopped,   0 zombie
%Cpu(s):  3.0 us,  4.5 sy,  0.0 ni, 68.6 id, 23.9 wa,  0.0 hi,  0.0 si,  0.0 st
MiB Mem :   7924.5 total,    354.1 free,   5324.4 used,   2246.0 buff/cache
MiB Swap:  23967.2 total,  23103.9 free,    863.4 used.   1904.8 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                                                     
   96 openhab   20   0 6366520   2.3g   4748 S   0.7  29.7 270:52.46 java                                                                                                        
    1 openhab   20   0    2284     12      0 S   0.0   0.0   0:07.48 tini                                                                                                        
17590 root      20   0    6796   3444   2992 S   0.0   0.0   0:00.00 bash                                                                                                        
17597 root      20   0   10924   3444   2968 R   0.0   0.0   0:00.01 top 

Who from Main Contributor could support to trace this issue?

@rossko57 any idea?

1 Like

No idea. You can’t direct volunteers to be interested.