I realized there’s something I want to integrate in my Smart Home setup: Resettable countdown timers for certain tasks. Each timer should be given a task name and amount of days until this task should be done. It should alert me if the counter is 0 and I should be able to reset it every time (even if non-zero) to its initial value.
Let me give you an example: I need to descale several items in my household (coffee maker, washing machine etc.) on a regular basis. Each items needs to be descaled on a different interval. Whenever I have descaled an item I want to reset the timer and be notified when it need to be descaled again.
How would I proceed to realize this in way it
can be reused, so I don’t need copy & paste the code & configuration over and over again but only need to define the different name & interval
I think for a daily countdown I would do decrement with rule, not expire.
But the design principle there of separating command from state you should find useful.
Obviously the counter Items would need persist/restore.
In addition to the recommendations already made, I would recommend using the proper tool for the job. Just create a reminder in what ever calendar app you may use or personal assistant or the like. When ever I give the dogs their flea and worm treatments I say “Hey google, remind me to apply flea treatment in 90 days” or “hey google, remind my to give worm treatment in 30 days.” Alexa has similar capabilities as do most calendars I’ve used (Google Calendar, Outlook, NextCloud), just without the voice commands.
openHAB is pretty much capable of doing anything, but that doesn’t mean it’s good at everything. When it comes to sending a reminder like this, there are likely other tools that are much better suited to the task.