Group state not updated after members update

It seems the state of the group that holds the target temperatures for the floors does not get updated with OH3; can someone shed some light on that? This is the relevant part of the items file:

Group:Number:AVG gHeatingTargetTemp (gHeating)
Number  BF_Target_Temp  "Pince célhőm. [%.1f °C]" (gHeatingTargetTemp)
Number  GF_Target_Temp  "Földszint célhőm. [%.1f °C]" (gHeatingTargetTemp)
Number  FF_Target_Temp  "Emelet célhőm. [%.1f °C]" (gHeatingTargetTemp)

This is how it used to work in OH2.5:

rule "Check heating actuators every 15 minutes"
when
    Time cron "* 0/15 * * * ? *" or
    Item gHeatingTargetTemp received update
then

And this is how it works with OH3:

rule "Check heating actuators every 15 minutes"
when
    Time cron "* 0/15 * * * ? *" or
    Item BF_Target_Temp received update or
    Item GF_Target_Temp received update or
    Item FF_Target_Temp received update
then

If I replace the 3 target temps with gHeatingTargetTemp, it doesn’t work. I set the values of the Target_Temp-s with Setpoint in the sitemap:

Setpoint item=GF_Target_Temp icon="heating" minValue=18.0 maxValue=25.0 step=0.5 visibility=[Heating_Mode_Auto==ON] 

This will only trigger when an update is sent directly to this Item. It will not trigger when its members are updated. This is how it works in both OH2 and OH3.

1 Like

Thanks but I can confirm it actually works like that in OH2 :slight_smile: unless you tell me I messed up the crontab definition and it runs more frequently than 15 minutes; while doing some debugging in OH3 I noticed I was getting log entries every second until I added the last * after the question mark.

I’ll try to make this clearer for you. When I said…

… I was referring to the new rule engine. The new rule engine has been around for a long time. It behaved this way in OH2 and the behavior has not changed in OH3.

The old rule engine behaved differently, but it is gone. Use…

Member of gHeatingTargetTemp received update

… or…

Item gHeatingTargetTemp changed
2 Likes

Thank you, I’ll check your solution and update the rule accordingly.

Please excuse me opening this topic again.
After switching to OH3, I just came across this topic, and I also noticed that the status of a group no longer changes. Is there a way to get this function again?

Example:

Group:Switch:OR (ON, OFF) gGroupTest "Test Group"
Switch gTestA "Test A [% s]" (gGroupTest)
Switch gTestB "Test B [% s]" (gGroupTest)

If a member of the group changes, the status of gGroupTest remains unchanged, in OH2 the status has changed according to the OR(ON, OFF).

Thanks very much!

Might just be a syntax error, unwanted space there.

Thank you for the incredibly quick response! I just checked your suggestion and the result stayed the same.

My sitemap file looks like this:

Switch item = gGroupTest
Group item = gGroupTest

Also in the log it is clear that the status of gGroupTest does not change.

21:44:09.810 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'gTestA' received command ON
21:44:09.811 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'gTestA' changed from OFF to ON
21:44:10.489 [INFO ] [openhab.event.ItemCommandEvent       ] - Item 'gTestB' received command ON
21:44:10.491 [INFO ] [openhab.event.ItemStateChangedEvent  ] - Item 'gTestB' changed from OFF to ON

Make sure your most recent edit of your xxx.items file has loaded (it will be in your openhab.log).
Use API Explorer to confirm membership relationships.

I see the following entry in the log:

22: 05: 24.219 [INFO] [del.core.internal.ModelRepositoryImpl] - Loading model 'model.items'

No further errors are displayed here.

In the API Explorer there are 4 entries relating to gGroupTest

  {
    "link": "http://localhost:8080/rest/items/gTestA",
    "state": "OFF",
    "stateDescription": {
      "pattern": "%s",
      "readOnly": false,
      "options": []
    },
    "editable": false,
    "type": "Switch",
    "name": "gTestA",
    "label": "Test A",
    "category": "man_3",
    "tags": [],
    "groupNames": [
      "gGroupTest"
    ]
  },
  {
    "link": "http://localhost:8080/rest/items/gTestB",
    "state": "OFF",
    "stateDescription": {
      "pattern": "%s",
      "readOnly": false,
      "options": []
    },
    "editable": false,
    "type": "Switch",
    "name": "gTestB",
    "label": "Test B",
    "category": "girl_4",
    "tags": [],
    "groupNames": [
      "gGroupTest"
    ]
  },
  {
    "members": [],
    "groupType": "Switch",
    "function": {
      "name": "AND",
      "params": [
        "ON",
        "OFF"
      ]
    },
    "link": "http://localhost:8080/rest/items/gGroupTest",
    "state": "ON",
    "editable": false,
    "type": "Group",
    "name": "gGroupTest",
    "label": "Test Gruppe",
    "category": "parents_2_3",
    "tags": [],
    "groupNames": []
  },

In the last entry no members of the group are shown, is this correct?

That’s not the Group function you showed us.

and this Group has a label

and it has a state - that means its function is working.

Have you defined the same Group Item in both model.items and via UI? Or perhaps in two xxx.items files?

That’s not the group function you showed us.

That’s right, in the meantime I’ve also tested the AND function, the same problem here as with OR.

and this group has a label

Also right, does that have any influence?

and it has a state - that means its function is working.

If I change the switches of the group, the status of the group does not change in the API Explorer either

Have you defined the same Group Item in both model.items and via UI? Or perhaps in two xxx.items files?

No, this group was only defined in the models.items file for test purposes.

I could test this arrangement via MainUI?

Furthermore, I have just tested a restart of openhab, nothing changes.

Furthermore, I just noticed the following:

In the case of a group created by text configuration, no aggregation function is displayed in the MainUI.

In the case of a group created by MainUI, the correct aggregation function is displayed in the MainUI. but this still does not work.

API Explorer:

  {
    "link": "http://localhost:8080/rest/items/MainUiTestB",
    "state": "ON",
    "editable": true,
    "type": "Switch",
    "name": "MainUiTestB",
    "label": "New Test B",
    "category": "",
    "tags": [],
    "groupNames": [
      "MainUiGroup"
    ]
  },
  {
    "link": "http://localhost:8080/rest/items/MainUiSwitchA",
    "state": "ON",
    "editable": true,
    "type": "Switch",
    "name": "MainUiSwitchA",
    "label": "New Test Switch A",
    "category": "",
    "tags": [],
    "groupNames": [
      "MainUiGroup"
    ]
  },
  {
    "members": [],
    "groupType": "Switch",
    "function": {
      "name": "AND",
      "params": [
        "ON",
        "OFF"
      ]
    },
    "link": "http://localhost:8080/rest/items/MainUiGroup",
    "state": "OFF",
    "editable": true,
    "type": "Group",
    "name": "MainUiGroup",
    "label": "New Test Group",
    "category": "",
    "tags": [],
    "groupNames": []
  },

The Group has a state, implying the function is working to some degree.
With no function, Group state is NULL.
With a broken function (like unsuitable members), Group state is UNDEF.

With AND(ON,OFF) and just two member Items both with state ON, we should expect Group state to be ON as well. So something is amiss here.

The members: [ ] field should be populated - example

so I guess that is at least associated with the problem.
EDIT - I believe the members[ ] field is populated on the fly by REST API, not hard coded in JSONDB, so that does suggest API is having trouble finding members too.

I cannot see anything else odd about your configuration.

OH version?

OH version?

I use the current Docker-Image, so “openhab/openhab:latest” → Stable: 3.1.0

Can you please try to recreate this mistake? It should appear both via text and in Ui configuration

I don’t have a functional OH3.1
It’s hard to imagine this is a general problem that no-one else has seen, but neither can I see how an individual installation could mess up this way.

(Note the original issue in this thread is about rule triggers, nothing like yours)

1 Like

Hello, after trying many times I was able to narrow down the problem.

If I remove all .rules and .things data, the group agregation works (changing the group status based on the members)

but as soon as I activate some things, the switching becomes slower and slower, Openhab takes several seconds to change the group status, the switch items themselves switch immediately. This can also be clearly seen in the console.

I have not yet been able to narrow the error down to certain things or bindings, this problem has so far occurred independently of the binding or thing.

Another important note: after a restart, the problem is fixed for a while (if only very few things are loaded) - with every minute the group aggregation slows down until it no longer works at some point. This error seems to have occurred elsewhere
See this post with very similar symptoms:

1 Like

Do you mean text file based rules and things or UI created rules and things?

Out of curiosity, when this is working … do you also get members [ ] field in the REST API view of the Group Item? Guessing something times out building that part when problem is present.

I should have remembered the delay issue, all the clues were there, like Group having a valid but “old” state.