Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expiration Timer on Groups never expires when Group State Changes due to an Item State change #1989

Closed
cweitkamp opened this issue Dec 22, 2020 · 4 comments · Fixed by #2009

Comments

@cweitkamp
Copy link
Contributor

cweitkamp commented Dec 22, 2020

It is now possible to set an expiration Timer on a Group Item. This timer expires if you send a command to the group or update its state. But the timer never expires when the Group State Changes due to an Item State change.

Group:Switch(ON,OFF) testGroup { expire="30s,command=OFF" }
Switch testSwitch (testGroup)
t2000 added a commit to t2000/openhab-core that referenced this issue Dec 26, 2020
Fixes openhab#1989

Signed-off-by: Stefan Triller <github@stefantriller.de>
@t2000
Copy link
Contributor

t2000 commented Dec 26, 2020

The reason for this is that the ExpireManager does not listen to GroupItemStateChangedEvents. I have a PR for this.

@t2000
Copy link
Contributor

t2000 commented Dec 26, 2020

And for the record, the above example is wrong. the function is missing in the group definition:

Group:Switch:OR(ON,OFF) testGroup { expire="30s,command=OFF" }
Switch testSwitch (testGroup)

With my fix, the group will expire as expected:

18:04:05.538 [eventexecutor-1] TRACE o.o.c.internal.items.ExpireManager:144 - Received 'ON' for item testSwitch
18:04:05.548 [eventexecutor-1] DEBUG o.o.core.common.ThreadPoolManager:159 - Created thread pool 'items' with size 5
18:04:05.554 [eventexecutor-1] TRACE o.o.c.internal.items.ExpireManager:144 - Received 'ON' for item testSwitch
18:04:05.555 [eventexecutor-1] TRACE o.o.c.internal.items.ExpireManager:144 - Received 'ON' for item testGroup
18:04:05.559 [eventexecutor-1] DEBUG o.o.c.internal.items.ExpireManager:159 - Item testGroup will expire (with 'OFF' command) in PT30S ms
18:04:32.479 [OH-common-5] DEBUG o.o.c.i.r.s.internal.SitemapResource:197 - Run clean SSE subscriptions job
18:04:36.381 [OH-common-1] DEBUG o.o.c.internal.items.ExpireManager:215 - Item testGroup received no command or update for PT30S - posting command 'OFF'
18:04:36.385 [eventexecutor-1] TRACE o.o.c.internal.items.ExpireManager:144 - Received 'OFF' for item testGroup
18:04:36.385 [eventexecutor-1] DEBUG o.o.c.internal.items.ExpireManager:154 - Item testGroup received 'OFF'; stopping any future expiration.
18:04:36.386 [eventexecutor-1] TRACE o.o.c.internal.items.ExpireManager:144 - Received 'OFF' for item testSwitch

@cweitkamp
Copy link
Contributor Author

And for the record, the above example is wrong.

Yes, that is correct. I wrote it.down in a second on my phone. All the better that you got it sorted. Thanks.

cweitkamp pushed a commit that referenced this issue Dec 26, 2020
Fixes #1989

Signed-off-by: Stefan Triller <github@stefantriller.de>
cweitkamp pushed a commit that referenced this issue Jan 10, 2021
Fixes #1989

Signed-off-by: Stefan Triller <github@stefantriller.de>
splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this issue Jul 11, 2023
Fixes openhab#1989

Signed-off-by: Stefan Triller <github@stefantriller.de>
GitOrigin-RevId: caaf1c7
@openhab-bot
Copy link
Collaborator

This issue has been mentioned on openHAB Community. There might be relevant details there:

https://community.openhab.org/t/grouipitem-with-expire-metadata/160635/3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants