Group Contact logic not working properly

Hi together,

I have encouraged a problem with my (rudimentary) presence detection.
The idea was to have a item Group, which sets a presence state if any of our phones is conected to our wifi.
wifi connection is getting observed from the fritz!box tr064 binding.

Items are configured this way:

Group:Contact:OR(CLOSED,OPEN) someoneIsPresent "Jmd. ist zu Hause" <presence>
// Fritz!Box Data
Contact cFboxJeromeMacOnline	"Presence (Jerome) [MAP(presence.map):%s]"	<presence_jerome>	(someoneIsPresent, FritzBoxData)	{fritzboxtr064="maconline:MA-CA-DR-ES-S0-01" }
Contact cFboxLisaMacOnline      "Presence (Lisa) [MAP(presence.map):%s]"	<presence_lisa> 	(someoneIsPresent, FritzBoxData)	{fritzboxtr064="maconline:MA-CA-DR-ES-S0-02" }

Presence.map only formats the texts for the ui.

No here’s the problem:
While the single contact items are updating, the group item wont work properly and i have no idea why.
Sometimes it shows “present” when someone is present in real and sometimes not.

On the left side you can see that both devices are present now, but the Group contact displays “Niemand ist anwesend” (engl. “Nobody is present”).

For my understanding

Group:Contact:OR(CLOSED,OPEN)

should change to closed if at least one device (and its regarding item) of the Group is present/closed.
But i cant confirm this behaviour in my installation currently.
Maybe i am understanding something wrong here.

I could work with rules ofc to handle those two present states and update a different item manually,
but since this is not working i first want to figure out why this is happening.

Thanks for your help and feedback in advance.

Perhaps the first step is to inspect event logs, to see if the Group and associated Items are updating as expected, or if you are looking at display issue (a delay perhaps)

Thanks for your reply. :slight_smile:

Yep i thought about that already, but waited for a chance while we are coming home anyway.
Maybe i am able to get some logs later.

with my apologies if too basic of a suggestion, did you try to refresh your sitemap?
My group items do not refresh automatically if I have the browser in the background or my computer is off (screensaver, sleep mode, etc); a refresh however always updates.

Hehe you’re welcome. :smiley:

Of course the suggestion is not to basic, since i have provided no information regarding to it yet.

The sitemap was opened freshly on two chrome instances parallel to make that screenshot.
I tried reloading the sitemap yesterday, before posting here.
So thanks for that suggestion, but unfortunately that’s not the problem.

I think that i had similar problems with an average temperature value and recognized a delay there, but the presence items behavior looks a bit more “strange” to me currently.

I use switches rather than contacts, but my group is defined using the AND function. The group is ON if any of the phones in the group are ON:

// Group used to detect presence in the house
Group:Switch:AND(OFF, ON) homePresence "Occupied [(%d)]" <present>

I think my “contact” solution is a bit confusing for me now^^

I have checked the logs:

15:26:45.915 [INFO] [GroupItemStateChangedEvent] - someoneIsPresent changed from OPEN to CLOSED through cFboxLisaMacOnline
15:26:45.916 [INFO] [ItemStateChangedEvent] - cFboxLisaMacOnline changed from OPEN to CLOSED
15:26:50.738 [INFO] [ItemStateChangedEvent] - cFboxLisaMacOnline changed from CLOSED to OPEN
15:26:50.741 [INFO] [GroupItemStateChangedEvent] - someoneIsPresent changed from CLOSED to OPEN through cFboxLisaMacOnline
15:27:23.540 [INFO] [GroupItemStateChangedEvent] - someoneIsPresent changed from OPEN to CLOSED through cFboxLisaMacOnline
15:27:23.549 [INFO] [ItemStateChangedEvent] - cFboxLisaMacOnline changed from OPEN to CLOSED
15:27:34.134 [INFO] [ItemStateChangedEvent] - cFboxLisaMacOnline changed from CLOSED to OPEN
15:27:34.137 [INFO] [GroupItemStateChangedEvent] - someoneIsPresent changed from CLOSED to OPEN through cFboxLisaMacOnline
15:27:39.339 [INFO] [ItemStateChangedEvent] - cFboxLisaMacOnline changed from OPEN to CLOSED
15:27:39.339 [INFO] [GroupItemStateChangedEvent] - someoneIsPresent changed from OPEN to CLOSED through cFboxLisaMacOnline
15:27:55.623 [INFO] [ItemStateChangedEvent] - cFboxLisaMacOnline changed from CLOSED to OPEN
15:27:55.626 [INFO] [GroupItemStateChangedEvent] - someoneIsPresent changed from CLOSED to OPEN through cFboxLisaMacOnline
15:28:08.594 [INFO] [ItemStateChangedEvent] - cFboxJeromeMacOnline changed from OPEN to CLOSED
15:28:08.606 [INFO] [GroupItemStateChangedEvent] - someoneIsPresent changed from OPEN to CLOSED through cFboxJeromeMacOnline
15:28:26.906 [INFO] [ItemStateChangedEvent] - cFboxJeromeMacOnline changed from CLOSED to OPEN
15:28:26.907 [INFO] [GroupItemStateChangedEvent] - someoneIsPresent changed from CLOSED to OPEN through cFboxJeromeMacOnline
15:28:28.460 [INFO] [ItemStateChangedEvent] - cFboxLisaMacOnline changed from OPEN to CLOSED
15:28:28.463 [INFO] [GroupItemStateChangedEvent] - someoneIsPresent changed from OPEN to CLOSED through cFboxLisaMacOnline
15:29:00.518 [INFO] [ItemStateChangedEvent] - cFboxLisaMacOnline changed from CLOSED to OPEN
15:29:00.524 [INFO] [GroupItemStateChangedEvent] - someoneIsPresent changed from CLOSED to OPEN through cFboxLisaMacOnline

It is obvious that the group logic is working fine here, since the updates of the group item are following immediately.
So there has to be a problem with my personal way of the implementation or the logic is different to the behavior that i expected. :smiley:
Or the sitemap is configured wrong.

I will try to evaluate it and share the results here.
(Maybe i will switch to a “switch” (hehe) solution too, like @MikeJMajor is using)
Thanks to everyone who tried to help until this point. :slight_smile: