In OH 3.4, no. But keep in mind you can use a for loop block and get access to the i
variable you can use to create the timer names.
In OH 4 there’s openHAB Rules Tools [4.1.0.0;4.9.9.9] which includes a looping timer. However, even then “backs down to every few hours” isn’t going to be supported by that block. To meet these requirements in Blockly you’ll have to do it all yourself I think.
You need to:
- create the timer (no repreat or for loop), we just need the one, set it to run immediately or in 0 seconds or what ever is supported
- the “do” part of the timer needs to see if the conditions are still such that the email needs to be sent. If so
a. send the email
b. see how long we’ve been sending alerts and based on that calculate when to send the next email
c. use that calculated time from 2b to reschedule the timer created in 1
If the conditions are no longer such that alerts should be sent, do nothing and the Timer will stop rescheduling itself.
You might be able to use Open Reminder [3.3.0;3.4.9) or Threshold Alert [3.2.0;3.4.9) to handle this. Probably Open Reminder for this use case. Then all the looping and timers and stuff is handled for you and all you need to do is write some code that sends the email. However, I don’t think you can access the passed in values in Blockly in 3.4 so you’ll have to code it in JS.