[SOLVED] What's wrong with this group def?

Hi there,

Just a quick question, I have the following Group definition and item:

Group all
Group windows (all)
Group:String:AND("ALARM", "MOTION") open_windows "Open Windows [(%d)]" <contact> (windows)                                                                                                                          
String ds2_status "Bad Fenster" (bd, windows) {channel="rfxcom:security1:sunflower:8154624:status"}   

If I open the window, it’s working fine, however the open_windows Group does not receive an update.
What’s wrong with this definition?

the windows group needs to defined as one of the item types to generate an event

I’m not sure why you would expect it to get an update. It has no members (that we can see).
It is not supposed to get updates in a “reverse” direction, i.e. being a member of some other group never passes updates from the “parent” group.
A group can only get updates based on the state of it’s own members.

Ah sorry guys - I mixed up the parameters when looking at another group definition.
I didn’t see that the Items defined in the jsondb had the group specified.

Thank you!

So this might be a gray area. What if I have a Group Item, let’s call it Child, that is a member of a parent Group, let’s call it Parent. Both Groups have a type and the types match.

If one sends a command to Parent, that command will be forwarded to Child. Autoupdate would be false since that is the default, so the Child’s state should get updated. But because Child is a Group, what does that update even mean? I’m not in a place to experiment with this right now, but it is one edge case where the behavior could be interesting.

I believe I’ve looked at that. autoupdate does nothing with a group, in the same way postUpdate does nothing with a group. I don’t know the mechanism, I guess autoupdate just aborts when Item type is Group.

However, sending a command to Parent group (autoupdate does nothing) will cascade the command to Child group. (autoupdate does nothing)
Child group in its turn cascades the command to its members.
Later, that may or may not cause state changes in those members via bindings or autoupdate or even rules.
At which point, Child group state will get recalculated from new member state(s).
And at that point, Parent group state will get recalculated from member states (including Child).

It remains the case that Parent state never affects Child state.

Let us imagine Parent has some other member that changes state. Parrnt state will be recalculated. Child state will not be recalculated - none of its members changed. This is a Good Thing :smiley:

1 Like