Attempting my first do while piston and it isn't quite working.
Goal: have a heater cycle on and off while the temp is below a certain measurement. Have the heater turned off once the temp climbs above a certain measurement.
What IS working:
After I get it going it is cycling as desired
What is NOT working:
Once created (while the temp was below the trigger) I had to hit 'test' on the piston to get it to start cycling.
Once the temp went above the threshold for the cycle, it continued to cycle
Once the temp went above the threshold to turn off, it did not appear to execute the action
Just my 2 cents here, but I do not ever control a heater with an unreliable on/off. Webcore functions well, but not 100%. I do not trust webcore to turn off a heater. Are you using a smart switch with a dumb heater? Another step that can fail. JMHO
I think about this a little differently. Here is one I copied and adapted from my hot water recirculator. I don't use a loop. Instead, it only goes on if it's been off for set time.
I would also add presence/mode conditions to this. Like, only turn it on if the mode is not Away.
I usually add everything at the top as variables to make testing and changes quicker. You should be able to test this by importing it and changing your two devices at the top.
This is a bit wording but you can cut it down.
I use these a lot for temp control. @Pantheon is right about trust. I have a piston that is a Heater Watchdog to kill/notify me of errant heating. I also use a heater with a temp dial so that is physically set to just above my max limits and taped off.
There are two situations in which you want the heater to turn on (cooled down or has been off for a set time while cool.
There are two situations in which you want the heater to turn off (warmed up or has been on for a set time).
The example below is not tested. I just created trigger conditions to match the above description. The variables might be overkill but it helps to follow what is happening in the anonymized snapshot.