I have read the very many posts on ‘how to allow a user-defined trigger’ time- or ephemeris based trigger for something, among others: this one:
(https://community.openhab.org/t/timers-and-datetime/141590)
I have - for example a swimming pool pump, which needs to run - say 3 times for 2 hours - per day in summer, and only 2 times 1 hour in winter.
Among the various possibilities, I settled for DateTime rule triggers, which I can (crudly) edit within a list item using a
listWidget="oh-input-item" [outline="true", clearButton="false", showTime="false",type="datetime-local", sendButton="true",validate="false"]
It’s not beautiful, but it works.
I then use the defined timer items as triggers for switching the pump on …
configuration: {}
triggers:
- id: "1"
configuration:
itemName: poolPump_On_1
timeOnly: true
type: timer.DateTimeTrigger
- id: "2"
configuration:
itemName: poolPump_On_2
timeOnly: true
type: timer.DateTimeTrigger
- id: "3"
configuration:
itemName: poolPump_On_3
timeOnly: true
type: timer.DateTimeTrigger
conditions: []
actions:
- inputs: {}
id: "4"
configuration:
command: ON
itemName: poolPump
type: core.ItemCommandAction
It’s not exactly elegant, but it works.
What really bothers me is, that the DateTime trigger items, don’t survive a reboot, i.e. the DateTime Items aren’t persisted and not even restored to the last value. I’m using rrdj4 and I really would hate to create a separate persistence strategy just for that.
Any thoughts on a better solution?