-
-
Notifications
You must be signed in to change notification settings - Fork 428
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
Introduce "expire" functionality for item states #1620
Comments
Shouldn't be a problem if it's regular metadata. Note that the UI doesn't use |
Yes it does to me. Since it's used by many it would be nice to see a compatible OH3 implementation. 🙂 |
I'm sure looking at the original binding code would be useful, but just in case it's helpful you can see my Jython rules version at https://github.com/rkoshak/openhab-rules-tools/blob/main/time_utils/automation/lib/python/community/time_utils.py. What might be of particular use is the One thing that came up when I wrote the rules version of expire is how NULL and UNDEF states are handled with String Items. The 1.x binding basically makes it impossible to set a String Item to the String "NULL" or "UNDEF". To handle that case I had to add the ability to put the String in single quotes. For example NOTE: When I wrote my expire rules it was mostly as a challenge to myself to see if I could do it and under the assumption that what ever you folks implement in the core would not be compatible with the 1.x binding config. I intended it to be a bridge. Since what you are proposing will be compatible, I'll deprecate my version when OH 3 comes out and eventually archive the rules. I'm really glad the Profiles approach was abandoned. It simply does not support enough of the use cases that people use it for. |
I'll try to have a go at implementing this. @rkoshak Yes, I'd plan to look at the 1.x binding code, so thanks for mentioning its shortcomings. Using single quotes for exceptions in String items sounds pretty sensible. I'll make sure that using |
Yes, I agree. It makes sense. With respect to backward compatibility it will be nice to see your implementation for it. |
Can we assign this to you and put it in progress if you are working on it @kaikreuzer (openhab/openhab-addons#8407 (comment))? |
Yes sir! |
Expire is widely used and used in a lot of different contexts and I think it fully makes sense to keep the syntax compatible with the 1.x binding to ease upgrade path. While expire is being worked on, I wanted to understand and raise a discussion around if there is something to be done architecturally at this time support what I view as a highly common use case that while you can execute it presently with expire and a set of rules, it is a bit harder than it could be. General use case: Specific use case: There are multiple ways of handling this currently, some involves timers being created and reset, others involve creating of dummy objects with expire tied to them and then rules setting or resetting the switch. While all of these work, they are potentially more complicated than they need to be for a common automation. Proposal:
I understand this would require a change to the rules engine, the questions I posing here are:
|
So your wanting what I would call a “debounce” feature. Would be handy to stop a doorbell triggering multiple times if a PIR sensor is Flipping back and forth. |
I support @boc-tothefuture proposal as an add-on. But expire binding works with grouped switches and I'm using this, so I also need the expire 1.0 functionality. |
What is the prio for the work on this, @kaikreuzer? I'm really thrilled by all the new fancy stuff in the OH3 milestones, but unfortunately I'm completely dependent on the expire functionality in my environment. |
@DanielMalmgren It's my top prio. Unfortunately, I have some time and health issues right now. I'd hope to get a first version ready for milestone 3. |
@kaikreuzer |
@rkoshak I have added support for this with 93a8510
@boc-tothefuture I understand your suggestion and thought about if there's anything the expire feature could address about it, but didn't feel it is directly linked - I have hence not considered it in #1803. |
Now that this is implemented and available in the OH3 snapshot 2019, it would be great to have to have some heavy-expiry-users test it to make sure it works as expected before releasing it soon with M3! |
And documentation on use? I am not a heavy user but use it 2 or 3 places. |
See above: "This would essentially also mean that item files of users stay fully compatible" |
I'm planning to work on metadata in the near future so I'll include it in that PR. |
Disallow standalone widgets to be selected for list items (close openhab#536). Allow slight alterations to the default widgets suggested by the system without reconfiguring it completely: if the metadata value is blank, assume the default system-suggested widget is to be used and merge the config found in the metadata. Closes openhab#534 (since now only the iconUseState option has to be set to enable dynamic icons for Number items and similar). Change the metadata namespace selection menu to only display the metadata which is set in the metadata menu, and use an action sheet to add more. This also paves the way for user-defined namespaces. Move the metadata order out of the item edition card in the Model page, into its own section. Add metadata editor for the expire namespace (openhab/openhab-core#1620). Reorder the sections of the item details page in a more logical manner (semantic classification below the tags that define it). Signed-off-by: Yannick Schaus <github@schaus.net>
Disallow standalone widgets to be selected for list items (close #536). Allow slight alterations to the default widgets suggested by the system without reconfiguring it completely: if the metadata value is blank, assume the default system-suggested widget is to be used and merge the config found in the metadata. Closes #534 (since now only the iconUseState option has to be set to enable dynamic icons for Number items and similar). Change the metadata namespace selection menu to only display the metadata which is set in the metadata menu, and use an action sheet to add more. This also paves the way for user-defined namespaces. Move the metadata order out of the item edition card in the Model page, into its own section. Add metadata editor for the expire namespace (openhab/openhab-core#1620). Reorder the sections of the item details page in a more logical manner (semantic classification below the tags that define it). Signed-off-by: Yannick Schaus <github@schaus.net>
FYI: Proposed a dedicated debounce profile here: #2172 |
* Added expire functionality as core framework feature Closes openhab#1620 Signed-off-by: Kai Kreuzer <kai@openhab.org> GitOrigin-RevId: 63ec434
Since openHAB 1.x bindings are incompatible with openHAB 3 and there is a substantial user base that has the 1.x expire binding in use, we should introduce a replacement for this functionality.
#744 was a first try to do so, but doing it as a profile has too many constraints.
As commented in #744 (comment), my suggestion would be to natively support the functionality in the core framework, similar to the "autoupdate". This would essentially also mean that item files of users stay fully compatible as the configuration could just be like:
Internally, this will just be a metadata provider with a specific namespace ("expire"), so reading and writing this information would directly be possible through the existing REST API as well.
@openhab/core-maintainers Would that make sense to you?
@ghys Is this something that could also be easily supported by the UI then? The most tricky part is probably the syntax of the expire configuration, but if that isn't a big issue to parse, I'd tend to stick to it for compatibility reasons.
The text was updated successfully, but these errors were encountered: