Trying to create a repeating rule but I can't figure out what i'm missing in the rule

Hello guys,

I built a DIY pool water heater for my pool. I had this working without the repeating rule but it would just allow the water to be lukewarm coming back into the pool and not hot. so I wanted to create a rule where it will turn off every 10 mins giving the water in the line time to get hot and then once it's turned on the water will be hot coming into the pool.

I can't figure out why the rule isn't getting trigged. in the screenshot I understand it wouldn't get triggered because it didn't meet my AND, but when it does meet my AND statement of weathericon contains partlycloudy or clear or sunny. it's not turning it on because when I check the logs, there's nothing for my pool pump showing.

So I want someone to look over the rule and tell me what I could be missing.

Event to be triggered based on time
The Action is If temp is greater than X and weathericon contains 1 of the 3 "sunny, clear or partly cloudy to turn on the outlet and to repeat this action 54 times every 9 mins and I'm assuming by telling it to repeat 54 times. it will then turn off the pool heater and stop repeating actions.

If i'm wrong, can anyone show me what i'm missing. Thanks.
image

My interpretation is that once a day, at 10:59 you check the weather. If it's one of the 3 conditions, the heater turns on. If not, wait til tomorrow.

Is that the intent?

If it ever does come on, you will turn it off 54 times at 9 min intervals. On once, off 54 times.

What is the point of even attempting to repeat 54 times? It will stop repeating as soon as it hits Stop Repeating Actions.

It didn't for me. I created a similar Rule using virtual devices to mimic time (10:59) and weather. It turns on the "heater switch" and then repeats turning it off. (I went with 15 times, at 9 second intervals.) All the Rule's logs are on...

It just blows right past the stop.

Initially I started it with the "weather" switch off, and it correctly does nothing.

Then I turned on the "weather" switch, toggled "Time switch" and off it went til the repeat got to zero.

OK, I'll look at the code for that. It should stop the repeat. The repeat would have to be stopable for it to be stopped by Stop Repeat Actions.

It's Rule 4.1 because that's what the original looked like to me.

I can try it with v5

(I renamed the virtuals to better mimic the original)
Screen Shot 2021-08-14 at 11.50.37 AM

You left off 'stopable'. Try that.

Very odd.. I know absolutely that I did click Stopable. Didn't stick, but yes, that's exactly what was wrong. :smiley:

When I created the v5 Rule (before you found the flaw), it sticks:

Screen Shot 2021-08-14 at 12.09.11 PM

The bottom line is that your Rule doesn't seem to be implementing the intent behind your words. If the sun isn't out at exactly 10:59, but is at 11:02, that water is going to get very hot and go nowhere. Then even if the sun was out, the pool heater only comes On for a second or less. (As fast as RM can go from On and into the Repeat and shut it off.)

In my test, it was On for just a few milliseconds:

app:23 2021-08-14 12:08:59.360 pm info Action:         Off: PoolHeater
app:23 2021-08-14 12:08:59.293 pm info Pool Heater Automation 5: Repeating Actions 15 times
app:23 2021-08-14 12:08:59.257 pm info Action:     On: PoolHeater

360 - 257 = 103 ms or one tenth of a second.

Perhaps something like this is what you want??

Screen Shot 2021-08-14 at 3.42.31 PM

I've used virtual switches to allow it to be tested. I condensed all of your weather options to a single virtual switch too. Your original work on both time and weather seems ok, but in a non-ideal place within the Rule, IF.. IF what I think you want to do matches the picture in my head. :slight_smile: Also I used seconds not minutes... because I wanted the test to be speedy. But I set the Loop time and the delay for Off time to be 50%. I dunno if 9 mins of Off time is enough to heat the water but thats just ratio math. :slight_smile:

I have a repeat loop that gets triggered daily, once.. at 10:59. Each loop will test for the weather and if it's one of the sunnys, it will turn on the Pool Heater. It then turns Off the Pool Heater after a delay.

Although the repeat is stoppable, nothing in this rule stops it. You could have something external (a button, switch or another Rule) do that for you.

The logs are:

And they show that when Weather is not sunny, the loop skips and just waits for the next loop pass.

You got it, I don't want it coming on if the temp is too cold or there's no sun.

Why the 54 times? Well this is why I posted it here to get help. I was told by someone who said they had the same setup when I asked this question several months back here in a different post, so I just ran with it, I figured that person knew better than me since they had something similar setup to what I was trying to accomplish.

54 times 9 minutes is 8 hours... so.. 11am to 7pm that Rule will run, daily. However, the math is wrong if you're trying to have the Pool Heater on for 9 mins then shut off for ??? 50% ? 100% ?

If it takes 9 minutes to cool off the heater below some temp. Then how long does it take for the water to heat up again? 4 mins? 9 mins? 18 mins? Whatever it is, you add them ( On time + Off time ) together to get a Cycle Time. Divide the Total Time it needs to run each day by the Cycle time and you have the Loop Counter value along with the Cycle Time. Then the Delay time is your heat up time aka heater off time.

1 Like

Ok understood. I didn't think about that and now that it was explained, I understand it was off.