How to run my AC for at least 15 minutes, but check the conditions more frequently


#1

1) Give a description of the problem
I’d like my piston to run for at least 15 minutes, but not at 15 minute increments.

2) What is the expected behaviour?
If the temp is above 72 and there is motion for the AC for at least 15 minutes, then if motion stops or the temp is below 68 turn off the AC but ONLY if it has been 15 minutes.

3) What is happening/not happening?
It appears to be waiting for 15 minutes each time it executes.

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
6/14/2019, 4:08:27 PM +658ms
+1ms ╔Received event [Aeotec MultiSensor 6].motion = active with a delay of 93ms
+80ms ║RunTime Analysis CS > 19ms > PS > 33ms > PE > 29ms > CE
+83ms ║Runtime (40321 bytes) successfully initialized in 33ms (v0.3.10c.20190522) (81ms)
+84ms ║╔Execution stage started
+98ms ║║Comparison (decimal) 74.7 is_greater_than_or_equal_to (integer) 72 = true (2ms)
+100ms ║║Cancelling condition #4’s schedules…
+101ms ║║Condition #4 evaluated true (11ms)
+107ms ║║Comparison (enum) active is (string) active = true (2ms)
+109ms ║║Cancelling condition #12’s schedules…
+110ms ║║Condition #12 evaluated true (8ms)
+112ms ║║Cancelling condition #1’s schedules…
+113ms ║║Condition group #1 evaluated true (state changed) (23ms)
+116ms ║║Cancelling statement #2’s schedules…
+3815ms ║║Executed physical command [Pod Office].on() (3695ms)
+3816ms ║║Executed [Pod Office].on (3697ms)
+3824ms ║║Fan on
+3825ms ║║Executed virtual command [Pod Office].log (2ms)
+6450ms ║║Executed physical command [Pod Office].setThermostatMode([cool]) (2620ms)
+6451ms ║║Executed [Pod Office].setThermostatMode (2622ms)
+8521ms ║║Executed physical command [Pod Office].setCoolingSetpoint([66.0]) (2065ms)
+8522ms ║║Executed [Pod Office].setCoolingSetpoint (2068ms)
+8526ms ║║Executed virtual command [Pod Office].wait (1ms)
+8528ms ║║Requesting a wake up for Fri, Jun 14 2019 @ 4:23:36 PM PDT (in 900.0s)
+8533ms ║╚Execution stage complete. (8449ms)
+8535ms ║Setting up scheduled job for Fri, Jun 14 2019 @ 4:23:36 PM PDT (in 899.995s)
+8544ms ╚Event processed successfully (8544ms)
6/14/2019, 3:34:48 PM +44ms
+1ms ╔Received event [Home].time = 1560551689336 with a delay of -1293ms
+132ms ║RunTime Analysis CS > 25ms > PS > 66ms > PE > 42ms > CE
+136ms ║Runtime (40317 bytes) successfully initialized in 66ms (v0.3.10c.20190522) (133ms)
+137ms ║╔Execution stage started
+165ms ║║Cancelling condition #11’s schedules…
+167ms ║║Condition #11 evaluated true (3ms)
+170ms ║║Cancelling condition #20’s schedules…
+172ms ║║Condition group #20 evaluated true (state changed) (8ms)
+174ms ║║Cancelling condition #8’s schedules…
+175ms ║║Condition group #8 evaluated true (state changed) (13ms)
+180ms ║║Cancelling statement #9’s schedules…
+4056ms ║║Executed physical command [Pod Office].off() (3869ms)
+4058ms ║║Executed [Pod Office].off (3873ms)
+4075ms ║║Fan off
+4078ms ║║Executed virtual command [Pod Office].log (3ms)
+4086ms ║╚Execution stage complete. (3949ms)
+4090ms ╚Event processed successfully (4089ms)
6/14/2019, 3:19:49 PM +202ms
+1ms ╔Received event [Aeotec MultiSensor 6].motion = inactive with a delay of 217ms
+85ms ║RunTime Analysis CS > 20ms > PS > 37ms > PE > 28ms > CE
+87ms ║Runtime (40325 bytes) successfully initialized in 37ms (v0.3.10c.20190522) (85ms)
+89ms ║╔Execution stage started
+104ms ║║Comparison (decimal) 68.7 is_greater_than_or_equal_to (integer) 72 = false (2ms)
+106ms ║║Condition #4 evaluated false (10ms)
+107ms ║║Condition group #1 evaluated false (state did not change) (12ms)
+110ms ║║Cancelling statement #16’s schedules…
+117ms ║║Less than 72 or no motion
+119ms ║║Executed virtual command log (1ms)
+131ms ║║Comparison (enum) inactive stays (string) inactive = true (2ms)
+134ms ║║Adding a timed trigger schedule for condition 11
+137ms ║║Condition #11 evaluated false (14ms)
+147ms ║║Comparison (decimal) 68.7 is_less_than_or_equal_to (integer) 68 = false (2ms)
+148ms ║║Condition #21 evaluated false (10ms)
+150ms ║║Condition group #20 evaluated false (state did not change) (26ms)
+151ms ║║Condition group #8 evaluated false (state did not change) (29ms)
+154ms ║╚Execution stage complete. (65ms)
+156ms ║Setting up scheduled job for Fri, Jun 14 2019 @ 3:34:49 PM PDT (in 899.979s)
+168ms ╚Event processed successfully (168ms)


#2

I blieve the problem is,
you have 2 conditions and priston is firing multiple times.
Meaning,
your temp just turned 72 (Conditions is TRUE)
Your motions is active (Condition is TRUE)
Piston executed
Wait coundown started…

but as long as conditions are still TRUE in your enviroment, the piston needs to execute AGAIN.

Maybe something like this would help…
Lets say you want to keep the room around 70.

IF Temp rises to or above 70 (TRIGGER)
and 
IF The motion sensor is active (CONDITION)
THEN
DO TURN ON the AC

IF TEMP Drops below to or 69 (Trigger)
OR
IF the motion sensor is INACTIVE (CONDITION)
THEN
Turn OFF AC

#3

Try this:


The execution is divided into three Ifs, each with a trigger to make them execute when the most likely condition changes. I added the ACisON variable so that the off triggers and conditions only proceed if the AC was turned on by this piston. (Dueling pistons are no fun.)
I suppose one could combine all the off conditions together as:

If ACisON is true and
    Motion 1 stays inactive for 15 minutes
  or
    Thermostat drops below  68F
     and
     ThermostatOperatingState stays cooling for 15 minutes
Then...

But I find that the more convoluted the logic gets, the harder it is to follow when you’re trying to figure out what you did a year from now. It would only make sense to do if the With Thermostat Do code was significantly longer.


#4

Thank you your reply, it helped me understand webcore better.


#5

This seems to be working perfectly, thank you!

I’m shocked how well importing worked!