On openHAB restart updates/commands the restored state/current state of Items with expire metadata back to the Item to kick off the Expire timers again (Expire doesn’t get reset with restoreOnStartup).
If the expire has ignoreStateUpdates set to true a command will be sent. Otherwise an update will be sent.
This rule template has one property. When “Use Expire State” is checked, instead of using the Item’s current state to update the Item the state configured in the “expire” metadata is used, essentially initializing the Item to the expire state.
When ignoreStateUpdates is set to true, this property does nothing and the Item’s current state is commanded to the Item. This is a deliberate decision because this rule template shouldn’t cause things to happen during startup.
added property to select whether to update the Item to it’s current state or to the configured expire state
Version 0.1
initial release
Sponsorship
If you want to send a tip my way or sponsor my work you can through Sponsor @rkoshak on GitHub or PayPal. It won’t change what I contribute to OH but it might keep me in coffee or let me buy hardware to test out new things.
All things are possible. It shouldn’t be hard. I think I just need to add a boolean parameter and an if statement that pulls the state/command to send from the expire instead of the Item’s current state.
Edit:
The new 1.0 version of the rule supports this feature request. I’ve done some limited testing and didn’t find any bugs. Let me know if something doesn’t work.
If you can get the right openhab-js version working it should work. However notice that it also requires openhab-rules-tools, which uses openhab-js too so it should be fine as well.
I don’t remember if OH 3 had this option or not. But if you go to Settings → Community Marketplace there is an option to show unpublished entries. If enabled you should see every post in the marketplace, not just those with the published flag and versioning for your version of OH.
The usual warnings apply. An unpublished version or a version outside the ones listed may not work.