Controlling Fan Heater - by temperature and timer


1) Give a description of the problem
Not sure how to get heater to stay on for 30 minutes or until temperature reaches certain value

2) What is the expected behaviour?
I’d like the heater to come on if the temperature of motion sensor 4 <= 22 degrees, then either stay on for 30 minutes or until the temperature of motion sensor 4 is >=24 degrees, which ever comes first

3) What is happening/not happening?
No idea how to code testing for either of 2 conditions to be met turn the heater off

**4) Post a Green Snapshot of the piston![image|45x37]

5) Attach logs after turning logging level to Full
3/10/2019, 20:30:11 +939ms
+1ms ╔Received event [My home].test = 1570131011937 with a delay of 2ms
+92ms ║RunTime Analysis CS > 24ms > PS > 44ms > PE > 23ms > CE
+95ms ║Runtime (37337 bytes) successfully initialized in 44ms (v0.3.10e.20190628) (90ms)
+96ms ║╔Execution stage started
+116ms ║║Comparison (time) 73812043 is_between (time) 21600000 … (time) 64800000 = false (10ms)
+119ms ║║Condition #2 evaluated false (15ms)
+129ms ║║Cancelling statement #2’s schedules…
+137ms ║║Requesting time schedule wake up at Fri, Oct 4 2019 @ 6:00:00 AM BST
+150ms ║║Condition group #1 evaluated false (state did not change) (48ms)
+185ms ║╚Execution stage complete. (89ms)
+195ms ║Setting up scheduled job for Fri, Oct 4 2019 @ 6:00:00 AM BST (in 34187.867s)
+206ms ╚Event processed successfully (206ms)


Hi, Try adding another condition to turn off if the temperature is reached. The triggering of this will cancel the existing wait & off commands


Thanks Paul

Could you give me a bit more help, where to put this condition?

Brain not working properly, lost my dad on monday.




Hi Andy,

Sorry to hear about your Dad.

You can put the new condition after the exiting If block (after line 29)

The way webcore works is that the whole piston executes top to bottom whenever any of the triggers is met. You’ll see a lightning bolt next to these (as on lines 18 & 20) It takes some getting used to if you’re used to another programming language. So when the temp is reached, the whole piston will run, but the first if will be false, the wait will have been cancelled and the second if will be executed to turn the switch off


Great, thanks Paul, got it working now!