Air Exchanger only when at home


#1

1) Give a description of the problem
My piston to trigger the air exchanger only when at home works well until my location mode is changed. Then I need to pause and resume to get it updated with the conditions

2) What is the expected behaviour?
Smart plug to work 10 minutes each hour, only on specific months, and only when location mode is Home

3) What is happening/not happening?
When location mode changes, I need to pause/resume to make the piston update

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

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)
14/11/2020 à 07:09:58 +60ms
+0ms ╔Received event [Chalet].time = 1605355799350 with a delay of -1290ms
+116ms ║RunTime Analysis CS > 22ms > PS > 41ms > PE > 53ms > CE
+118ms ║Runtime (37380 bytes) successfully initialized in 41ms (v0.3.110.20191009) (117ms)
+119ms ║╔Execution stage started
+145ms ║║Executed physical command [échangeur air].off() (15ms)
+146ms ║║Executed [échangeur air].off (17ms)
+148ms ║╚Execution stage complete. (29ms)
+150ms ║Setting up scheduled job for Sat, Nov 14 2020 @ 8:00:00 AM EST (in 3001.791s)
+157ms ╚Event processed successfully (157ms)
14/11/2020 à 06:59:59 +48ms
+159ms ╔Received event [Chalet].time = 1605355200000 with a delay of -952ms
+268ms ║RunTime Analysis CS > 177ms > PS > 30ms > PE > 61ms > CE
+270ms ║Runtime (37382 bytes) successfully initialized in 30ms (v0.3.110.20191009) (110ms)
+271ms ║╔Execution stage started
+281ms ║║Cancelling statement #2’s schedules…
+295ms ║║Executed physical command [échangeur air].on() (11ms)
+296ms ║║Executed [échangeur air].on (13ms)
+300ms ║║Executed virtual command [échangeur air].wait (1ms)
+301ms ║║Requesting a wake up for Sat, Nov 14 2020 @ 7:09:59 AM EST (in 600.0s)
+305ms ║╚Execution stage complete. (34ms)
+307ms ║Setting up scheduled job for Sat, Nov 14 2020 @ 7:09:59 AM EST (in 599.996s), with 1 more job pending
+315ms ╚Event processed successfully (315ms)


#2

Personally, I would drop the “ONLY WHEN”, and use a traditional IF block instead. Something like

Every hour at 0 past the hour
Do
   IF Location is Home
      and time is between X & Y
   Then
      Do cool stuff
   END IF
END EVERY

Note: It will not run when location changes, nor will it abort upon location change… but each hour it will check again to see if you are home, and respond appropriately. (IE: No need to pause & resume this one)