[SOLVED] Group state update (once again...)

Hi,

I have some strange behaviour with a goup-item and the corresponding group-state and found no solution on similar topics in this forum.

My setup:
Raspi3+, raspbian (9), java 8(181) and oh 2.3.0,
visual code (on a smb-connected debian maschine)

my problem:
group-state is only updated, when I update (re-save) the item-file in the vc-editor

My files…

Anwesenheit.items

Group:Contact gAnwesenheit_fb
Contact Peter       "Peter (Smartphone) [%s]"    (gAnwesenheit_fb)  {fritzboxtr064="maconline:..."}
Contact Regine    "Regine (Smartphone) [%s]"   (gAnwesenheit_fb)  {fritzboxtr064="maconline:..."}
Contact Lisa         "Lisa (Smartphone) [%s]"     (gAnwesenheit_fb)  {fritzboxtr064="maconline:..."}
Contact Lara        "Lara (Smartphone) [%s]"     (gAnwesenheit_fb)  {fritzboxtr064="maconline:..."}

Huttihaus.items

Group Home "Huttis Haus" <house>
...
Group:Contact:OR(OPEN, CLOSED) gAnwesenheit_fb "Ist jemand zu Hause [%s]" <light> (Home)

HuttiHaus.sitemap

sitemap HuttiHaus label="HuttiHaus" {
...
    Frame label="FritzBox" icon="network" {
        Group item=gfritzbox
        Group item=gAnwesenheit_fb
        Group item=gSpielwiese
    }
}

SummaryHome.rules

rule "Lampe"
when
    Time cron "0 * * ? * *" 
then
    if (gAnwesenheit_fb.state == OPEN)
    {
        logInfo("Abfrage","erster Block " +gAnwesenheit_fb.state)
    }
    else
    {
        logInfo("Abfrage","zweiter Block " +gAnwesenheit_fb.state)
    }
end

After raspi & oh started (boot) after some minutes and Peter & Regine are at home…

gAnwesenheit_fb

Then I re-save Huttihouse.items without any changes. After that the situation is like I would have expected
gAnwesenheit_fb2

rebooting does not solve the issue, because then the situation above starts again

… and I have no idea

Thanks for your help

regards
Peter

You configured gAnwesenheit_fb twice (in two different files). Remove the one without the OR function.

1 Like

Thanks for the quick reply.

Redundant configuration is perhaps a trace, but removing the suggested configuration results in a message, that gAnwesenheit_fb cannot be resolved in the shown SummaryHome.rules.

I am new to OH, coming from fhem I have to think new.

… but I will follow the double configuration hint.

Thanks again

… ok, I removed the gAnwesenheit_fb from my files and did the configuration in the UI - then the rule works!!!

This is a OH-behaviour I have to get familiar. Doing topics with UI AND textfiles is a bit strange.

But now it’s ok - Thanks

You needn’t do items config in UI. Read this.
Your problem was that you defined it twice.

When I removed the item-Definition as you requested, the item was not found in the rule and I got an error in the log. I think with the UI step, the item is then „global“ and therefor accessable everywhere.
I keep on going…

because you removed the only active definition. You would have needed to update the other file to make that definition there take its place.
Mixing UI and files isn’t recommended.

Ok, thanks
I will try that

don’t forget to delete the UI item first

Perhaps you had the group configured three times - in both files and PaperUI. The group/item names have to be unique.

I erased the UI definition and did it again in the .items files.
“Refreshing all the files” was the essential hint to to make the changes working.

Now everything works fine

Thx