Monitor and Alert on Power Failure


#1

1) Give a description of the problem
I have been playing with this for a couple of months, and tried using some of the pistons I have found here with no luck. I can get notifications, but something (s) are missing. I am using SmartThings Hub, with Zooz ZEN15 Power Switch. Would like to alert when/if freezer power goes out so that I don’t loose food. I understand that ST hub only captures the power monitor at different intervals, and that a power failure only keeps a given power variable ie (Watts) as if it is still reporting to the ST hub.

2) What is the expected behaviour?
After much thought this is what I would like to see happen.

  1. The piston will poll ST/Zooz once per hour (top of hour)
  2. If after 4 consecutive polls/hours the W have not changed (or other power variable if that is better)
  3. Initiate notification via text/email/push

3) What is happening/not happening?
For testing purposes I have it currently set at 15 minute polling, and I get notifications but it is sending regardless of change in power variables.

**4)

5) Attach logs after turning logging level to Full
8/21/2019, 4:29:39 PM +750ms
+123ms +Stopping piston…
+195ms +Piston successfully stopped (73ms)
8/21/2019, 4:29:39 PM +515ms
+119ms +Stopping piston…
+217ms +Piston successfully stopped (98ms)
8/21/2019, 4:29:39 PM +750ms
+123ms +Stopping piston…
+195ms +Piston successfully stopped (73ms)
8/21/2019, 4:29:39 PM +515ms
+119ms +Stopping piston…
+217ms +Piston successfully stopped (98ms)
8/21/2019, 4:29:39 PM +750ms
+123ms +Stopping piston…
+195ms +Piston successfully stopped (73ms)
8/21/2019, 4:29:39 PM +515ms
+119ms +Stopping piston…
+217ms +Piston successfully stopped (98ms)
8/21/2019, 4:29:10 PM +834ms
+2ms +Received event [Zooz Freezer].power = 104.03 with a delay of 96ms
+119ms ¦RunTime Analysis CS > 21ms > PS > 24ms > PE > 73ms > CE
+122ms ¦Runtime (38785 bytes) successfully initialized in 24ms (v0.3.10c.20190522) (119ms)
+123ms ¦+Execution stage started
+130ms ¦+Execution stage complete. (8ms)
+132ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 83.365s)
+145ms +Event processed successfully (144ms)
8/21/2019, 4:28:40 PM +551ms
+2ms +Received event [Zooz Freezer].power = 104.34 with a delay of 111ms
+100ms ¦RunTime Analysis CS > 24ms > PS > 26ms > PE > 49ms > CE
+102ms ¦Runtime (38786 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (100ms)
+104ms ¦+Execution stage started
+109ms ¦+Execution stage complete. (6ms)
+111ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 113.669s)
+123ms +Event processed successfully (122ms)
8/21/2019, 4:28:10 PM +966ms
+2ms +Received event [Zooz Freezer].power = 104.24 with a delay of 222ms
+102ms ¦RunTime Analysis CS > 23ms > PS > 27ms > PE > 52ms > CE
+105ms ¦Runtime (38786 bytes) successfully initialized in 27ms (v0.3.10c.20190522) (101ms)
+106ms ¦+Execution stage started
+148ms ¦+Execution stage complete. (43ms)
+150ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 143.214s)
+165ms +Event processed successfully (165ms)
8/21/2019, 4:27:40 PM +855ms
+2ms +Received event [Zooz Freezer].power = 104.55 with a delay of 110ms
+101ms ¦RunTime Analysis CS > 22ms > PS > 28ms > PE > 51ms > CE
+105ms ¦Runtime (38786 bytes) successfully initialized in 28ms (v0.3.10c.20190522) (101ms)
+106ms ¦+Execution stage started
+144ms ¦+Execution stage complete. (38ms)
+146ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 173.33s)
+172ms +Event processed successfully (172ms)
8/21/2019, 4:27:11 PM +171ms
+1ms +Received event [Zooz Freezer].power = 104.86 with a delay of 189ms
+103ms ¦RunTime Analysis CS > 23ms > PS > 26ms > PE > 54ms > CE
+106ms ¦Runtime (38786 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (103ms)
+107ms ¦+Execution stage started
+112ms ¦+Execution stage complete. (6ms)
+114ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 203.046s)
+124ms +Event processed successfully (124ms)
8/21/2019, 4:26:41 PM +990ms
+2ms +Received event [Zooz Freezer].power = 104.76 with a delay of 1264ms
+125ms ¦RunTime Analysis CS > 28ms > PS > 27ms > PE > 70ms > CE
+127ms ¦Runtime (38787 bytes) successfully initialized in 27ms (v0.3.10c.20190522) (122ms)
+129ms ¦+Execution stage started
+198ms ¦+Execution stage complete. (70ms)
+206ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 232.135s)
+218ms +Event processed successfully (218ms)
8/21/2019, 4:26:10 PM +779ms
+2ms +Received event [Zooz Freezer].power = 104.86 with a delay of 233ms
+107ms ¦RunTime Analysis CS > 23ms > PS > 27ms > PE > 57ms > CE
+110ms ¦Runtime (38786 bytes) successfully initialized in 27ms (v0.3.10c.20190522) (108ms)
+111ms ¦+Execution stage started
+145ms ¦+Execution stage complete. (34ms)
+147ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 263.405s)
+158ms +Event processed successfully (158ms)
8/21/2019, 4:25:40 PM +828ms
+1ms +Received event [Zooz Freezer].power = 105.35 with a delay of 270ms
+99ms ¦RunTime Analysis CS > 21ms > PS > 25ms > PE > 54ms > CE
+102ms ¦Runtime (38785 bytes) successfully initialized in 25ms (v0.3.10c.20190522) (99ms)
+103ms ¦+Execution stage started
+108ms ¦+Execution stage complete. (6ms)
+110ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 293.393s)
+122ms +Event processed successfully (122ms)
8/21/2019, 4:25:11 PM +902ms
+3ms +Received event [Zooz Freezer].power = 105.66 with a delay of 1360ms
+112ms ¦RunTime Analysis CS > 25ms > PS > 23ms > PE > 65ms > CE
+115ms ¦Runtime (38787 bytes) successfully initialized in 23ms (v0.3.10c.20190522) (110ms)
+116ms ¦+Execution stage started
+177ms ¦+Execution stage complete. (62ms)
+184ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 322.245s)
+194ms +Event processed successfully (194ms)
8/21/2019, 4:24:41 PM +59ms
+2ms +Received event [Zooz Freezer].power = 105.35 with a delay of 239ms
+109ms ¦RunTime Analysis CS > 31ms > PS > 27ms > PE > 50ms > CE
+111ms ¦Runtime (38786 bytes) successfully initialized in 27ms (v0.3.10c.20190522) (109ms)
+112ms ¦+Execution stage started
+136ms ¦+Execution stage complete. (24ms)
+138ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 353.134s)
+150ms +Event processed successfully (150ms)
8/21/2019, 4:24:10 PM +944ms
+1ms +Received event [Zooz Freezer].power = 105.45 with a delay of 201ms
+107ms ¦RunTime Analysis CS > 24ms > PS > 28ms > PE > 56ms > CE
+110ms ¦Runtime (38786 bytes) successfully initialized in 28ms (v0.3.10c.20190522) (108ms)
+111ms ¦+Execution stage started
+149ms ¦+Execution stage complete. (38ms)
+151ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 383.236s)
+163ms +Event processed successfully (163ms)
8/21/2019, 4:23:40 PM +856ms
+2ms +Received event [Zooz Freezer].power = 105.76 with a delay of 113ms
+111ms ¦RunTime Analysis CS > 23ms > PS > 34ms > PE > 53ms > CE
+114ms ¦Runtime (38786 bytes) successfully initialized in 34ms (v0.3.10c.20190522) (112ms)
+116ms ¦+Execution stage started
+150ms ¦+Execution stage complete. (35ms)
+152ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 413.323s)
+173ms +Event processed successfully (172ms)
8/21/2019, 4:23:03 PM +221ms
+3ms +Received event [Zooz Freezer].power = 105.87 with a delay of 1378ms
+132ms ¦RunTime Analysis CS > 29ms > PS > 28ms > PE > 75ms > CE
+135ms ¦Runtime (38787 bytes) successfully initialized in 28ms (v0.3.10c.20190522) (129ms)
+136ms ¦+Execution stage started
+241ms ¦+Execution stage complete. (106ms)
+253ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 450.858s)
+267ms +Event processed successfully (267ms)
8/21/2019, 4:22:40 PM +651ms
+1ms +Received event [Zooz Freezer].power = 105.76 with a delay of 116ms
+104ms ¦RunTime Analysis CS > 23ms > PS > 26ms > PE > 55ms > CE
+106ms ¦Runtime (38786 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (104ms)
+107ms ¦+Execution stage started
+154ms ¦+Execution stage complete. (47ms)
+155ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 473.524s)
+168ms +Event processed successfully (168ms)
8/21/2019, 4:22:11 PM +109ms
+1ms +Received event [Zooz Freezer].power = 105.66 with a delay of 104ms
+96ms ¦RunTime Analysis CS > 20ms > PS > 25ms > PE > 50ms > CE
+98ms ¦Runtime (38785 bytes) successfully initialized in 25ms (v0.3.10c.20190522) (96ms)
+99ms ¦+Execution stage started
+104ms ¦+Execution stage complete. (5ms)
+105ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 503.116s)
+119ms +Event processed successfully (119ms)
8/21/2019, 4:21:40 PM +651ms
+2ms +Received event [Zooz Freezer].power = 106.08 with a delay of 114ms
+96ms ¦RunTime Analysis CS > 21ms > PS > 24ms > PE > 50ms > CE
+99ms ¦Runtime (38785 bytes) successfully initialized in 24ms (v0.3.10c.20190522) (97ms)
+101ms ¦+Execution stage started
+135ms ¦+Execution stage complete. (35ms)
+137ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 533.543s)
+147ms +Event processed successfully (147ms)
8/21/2019, 4:20:41 PM +31ms
+2ms +Received event [Zooz Freezer].power = 105.76 with a delay of 100ms
+101ms ¦RunTime Analysis CS > 23ms > PS > 24ms > PE > 54ms > CE
+104ms ¦Runtime (38786 bytes) successfully initialized in 24ms (v0.3.10c.20190522) (101ms)
+105ms ¦+Execution stage started
+110ms ¦+Execution stage complete. (6ms)
+112ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 593.188s)
+123ms +Event processed successfully (123ms)
8/21/2019, 4:20:12 PM +199ms
+1ms +Received event [Zooz Freezer].power = 105.35 with a delay of 233ms
+100ms ¦RunTime Analysis CS > 21ms > PS > 24ms > PE > 54ms > CE
+102ms ¦Runtime (38786 bytes) successfully initialized in 24ms (v0.3.10c.20190522) (100ms)
+103ms ¦+Execution stage started
+109ms ¦+Execution stage complete. (6ms)
+110ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 622.021s)
+121ms +Event processed successfully (121ms)
8/21/2019, 4:19:40 PM +984ms
+1ms +Received event [Zooz Freezer].power = 104.86 with a delay of 227ms
+109ms ¦RunTime Analysis CS > 30ms > PS > 28ms > PE > 51ms > CE
+111ms ¦Runtime (38786 bytes) successfully initialized in 28ms (v0.3.10c.20190522) (109ms)
+112ms ¦+Execution stage started
+145ms ¦+Execution stage complete. (33ms)
+146ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 653.2s)
+160ms +Event processed successfully (160ms)
8/21/2019, 4:19:10 PM +849ms
+2ms +Received event [Zooz Freezer].power = 105.66 with a delay of 110ms
+107ms ¦RunTime Analysis CS > 24ms > PS > 27ms > PE > 55ms > CE
+110ms ¦Runtime (38786 bytes) successfully initialized in 27ms (v0.3.10c.20190522) (106ms)
+111ms ¦+Execution stage started
+149ms ¦+Execution stage complete. (39ms)
+151ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 683.331s)
+177ms +Event processed successfully (177ms)
8/21/2019, 4:18:40 PM +745ms
+1ms +Received event [Zooz Freezer].power = 105.76 with a delay of 104ms
+102ms ¦RunTime Analysis CS > 25ms > PS > 27ms > PE > 51ms > CE
+105ms ¦Runtime (38786 bytes) successfully initialized in 27ms (v0.3.10c.20190522) (102ms)
+106ms ¦+Execution stage started
+167ms ¦+Execution stage complete. (62ms)
+176ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 713.411s)
+190ms +Event processed successfully (189ms)
8/21/2019, 4:18:10 PM +904ms
+1ms +Received event [Zooz Freezer].power = 112.48 with a delay of 212ms
+108ms ¦RunTime Analysis CS > 25ms > PS > 29ms > PE > 55ms > CE
+111ms ¦Runtime (38786 bytes) successfully initialized in 29ms (v0.3.10c.20190522) (108ms)
+112ms ¦+Execution stage started
+163ms ¦+Execution stage complete. (51ms)
+165ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 743.262s)
+178ms +Event processed successfully (179ms)
8/21/2019, 4:17:40 PM +749ms
+1ms +Received event [Zooz Freezer].power = 128.05 with a delay of 101ms
+98ms ¦RunTime Analysis CS > 24ms > PS > 25ms > PE > 49ms > CE
+101ms ¦Runtime (38785 bytes) successfully initialized in 25ms (v0.3.10c.20190522) (99ms)
+102ms ¦+Execution stage started
+134ms ¦+Execution stage complete. (33ms)
+135ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 773.446s)
+148ms +Event processed successfully (147ms)
8/21/2019, 4:17:27 PM +435ms
+2ms +Received event [Zooz Freezer].power = 125.31 with a delay of 94ms
+104ms ¦RunTime Analysis CS > 25ms > PS > 26ms > PE > 52ms > CE
+106ms ¦Runtime (38785 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (104ms)
+107ms ¦+Execution stage started
+164ms ¦+Execution stage complete. (57ms)
+165ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 786.73s)
+178ms +Event processed successfully (178ms)
8/21/2019, 4:17:20 PM +456ms
+1ms +Received event [Zooz Freezer].power = 113.83 with a delay of 123ms
+115ms ¦RunTime Analysis CS > 26ms > PS > 31ms > PE > 58ms > CE
+118ms ¦Runtime (38786 bytes) successfully initialized in 31ms (v0.3.10c.20190522) (115ms)
+119ms ¦+Execution stage started
+185ms ¦+Execution stage complete. (67ms)
+195ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 793.681s)
+209ms +Event processed successfully (209ms)
8/21/2019, 4:17:17 PM +427ms
+2ms +Received event [Zooz Freezer].power = 98.23 with a delay of 95ms
+107ms ¦RunTime Analysis CS > 23ms > PS > 26ms > PE > 57ms > CE
+109ms ¦Runtime (38784 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (107ms)
+110ms ¦+Execution stage started
+135ms ¦+Execution stage complete. (24ms)
+136ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 796.767s)
+150ms +Event processed successfully (150ms)
8/21/2019, 4:17:16 PM +433ms
+1ms +Received event [Zooz Freezer].power = 756.33 with a delay of 99ms
+96ms ¦RunTime Analysis CS > 22ms > PS > 24ms > PE > 51ms > CE
+99ms ¦Runtime (38784 bytes) successfully initialized in 24ms (v0.3.10c.20190522) (95ms)
+100ms ¦+Execution stage started
+132ms ¦+Execution stage complete. (33ms)
+134ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 797.764s)
+146ms +Event processed successfully (145ms)
8/21/2019, 4:17:12 PM +440ms
+1ms +Received event [Zooz Freezer].power = 4.11 with a delay of 106ms
+104ms ¦RunTime Analysis CS > 25ms > PS > 27ms > PE > 51ms > CE
+106ms ¦Runtime (38784 bytes) successfully initialized in 27ms (v0.3.10c.20190522) (104ms)
+107ms ¦+Execution stage started
+118ms ¦+Execution stage complete. (11ms)
+121ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 801.771s)
+137ms +Event processed successfully (137ms)
8/21/2019, 4:15:33 PM +61ms
+1ms +Received event [Starry Night].time = 1566429334330 with a delay of -1269ms
+345ms ¦RunTime Analysis CS > 225ms > PS > 38ms > PE > 81ms > CE
+348ms ¦Runtime (38795 bytes) successfully initialized in 38ms (v0.3.10c.20190522) (347ms)
+350ms ¦+Execution stage started
+452ms ¦¦Comparison (decimal) 0.0 did_not_change = true (34ms)
+454ms ¦¦Condition #5 evaluated true (43ms)
+456ms ¦¦Condition group #2 evaluated true (state did not change) (45ms)
+462ms ¦¦Comparison (integer) 1 is_less_than (integer) 3 = true (1ms)
+463ms ¦¦Condition #10 evaluated true (5ms)
+464ms ¦¦Condition group #8 evaluated true (state did not change) (7ms)
+467ms ¦¦Cancelling statement #3’s schedules…
+483ms ¦¦Executed virtual command sendSMSNotification (10ms)
+543ms ¦¦Executed virtual command sendPushNotification (55ms)
+696ms ¦¦Executed virtual command sendEmail (148ms)
+704ms ¦¦Calculating (integer) 1 + (integer) 1 >> (integer) 2
+710ms ¦¦Executed virtual command setVariable (3ms)
+726ms ¦+Execution stage complete. (377ms)
+735ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:30:34 PM PDT (in 900.535s)
+745ms +Event processed successfully (744ms)
8/21/2019, 4:00:46 PM +131ms
+31ms +Received event [Starry Night].time = 1566428434330 with a delay of 11800ms
+477ms ¦RunTime Analysis CS > 149ms > PS > 86ms > PE > 242ms > CE
+480ms ¦Runtime (38803 bytes) successfully initialized in 86ms (v0.3.10c.20190522) (416ms)
+482ms ¦+Execution stage started
+1582ms ¦¦Comparison (decimal) 0.0 did_not_change = true (476ms)
+1584ms ¦¦Cancelling condition #5’s schedules…
+1585ms ¦¦Condition #5 evaluated true (491ms)
+1586ms ¦¦Cancelling condition #2’s schedules…
+1587ms ¦¦Condition group #2 evaluated true (state changed) (494ms)
+1596ms ¦¦Comparison (integer) 0 is_less_than (integer) 3 = true (2ms)
+1598ms ¦¦Cancelling condition #10’s schedules…
+1599ms ¦¦Condition #10 evaluated true (8ms)
+1601ms ¦¦Cancelling condition #8’s schedules…
+1602ms ¦¦Condition group #8 evaluated true (state changed) (11ms)
+1604ms ¦¦Cancelling statement #3’s schedules…
+2127ms ¦¦Executed virtual command sendSMSNotification (432ms)
+2180ms ¦¦Executed virtual command sendPushNotification (47ms)
+2994ms ¦¦Executed virtual command sendEmail (807ms)
+3001ms ¦¦Calculating (integer) 0 + (integer) 1 >> (integer) 1
+3009ms ¦¦Executed virtual command setVariable (4ms)
+3476ms ¦+Execution stage complete. (2995ms)
+3809ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:15:34 PM PDT (in 884.419s)
+3818ms +Event processed successfully (3818ms)
8/21/2019, 3:54:24 PM +67ms
+3ms +Received event [Zooz Freezer].power = 0 with a delay of 1730ms
+127ms ¦RunTime Analysis CS > 31ms > PS > 28ms > PE > 68ms > CE
+130ms ¦Runtime (38788 bytes) successfully initialized in 28ms (v0.3.10c.20190522) (124ms)
+131ms ¦+Execution stage started
+204ms ¦+Execution stage complete. (74ms)
+213ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 370.051s)
+227ms +Event processed successfully (226ms)
8/21/2019, 3:54:10 PM +642ms
+1ms +Received event [Zooz Freezer].power = 96.56 with a delay of 105ms
+100ms ¦RunTime Analysis CS > 22ms > PS > 26ms > PE > 53ms > CE
+102ms ¦Runtime (38791 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (100ms)
+103ms ¦+Execution stage started
+122ms ¦+Execution stage complete. (19ms)
+124ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 383.565s)
+136ms +Event processed successfully (137ms)
8/21/2019, 3:53:40 PM +883ms
+2ms +Received event [Zooz Freezer].power = 96.94 with a delay of 225ms
+98ms ¦RunTime Analysis CS > 23ms > PS > 25ms > PE > 50ms > CE
+101ms ¦Runtime (38790 bytes) successfully initialized in 25ms (v0.3.10c.20190522) (99ms)
+102ms ¦+Execution stage started
+120ms ¦+Execution stage complete. (18ms)
+122ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 413.325s)
+137ms +Event processed successfully (137ms)
8/21/2019, 3:53:10 PM +640ms
+1ms +Received event [Zooz Freezer].power = 96.36 with a delay of 101ms
+95ms ¦RunTime Analysis CS > 20ms > PS > 25ms > PE > 51ms > CE
+98ms ¦Runtime (38790 bytes) successfully initialized in 25ms (v0.3.10c.20190522) (96ms)
+99ms ¦+Execution stage started
+105ms ¦+Execution stage complete. (5ms)
+106ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 443.585s)
+117ms +Event processed successfully (117ms)
8/21/2019, 3:52:40 PM +589ms
+1ms +Received event [Zooz Freezer].power = 97.23 with a delay of 99ms
+103ms ¦RunTime Analysis CS > 23ms > PS > 29ms > PE > 52ms > CE
+106ms ¦Runtime (38790 bytes) successfully initialized in 29ms (v0.3.10c.20190522) (103ms)
+107ms ¦+Execution stage started
+113ms ¦+Execution stage complete. (7ms)
+114ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 473.627s)
+127ms +Event processed successfully (127ms)
8/21/2019, 3:52:11 PM +735ms
+1ms +Received event [Zooz Freezer].power = 97.04 with a delay of 113ms
+105ms ¦RunTime Analysis CS > 21ms > PS > 26ms > PE > 57ms > CE
+107ms ¦Runtime (38791 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (105ms)
+108ms ¦+Execution stage started
+114ms ¦+Execution stage complete. (6ms)
+116ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 502.48s)
+127ms +Event processed successfully (127ms)
8/21/2019, 3:51:40 PM +828ms
+2ms +Received event [Zooz Freezer].power = 97.13 with a delay of 96ms
+97ms ¦RunTime Analysis CS > 22ms > PS > 25ms > PE > 49ms > CE
+99ms ¦Runtime (38789 bytes) successfully initialized in 25ms (v0.3.10c.20190522) (97ms)
+100ms ¦+Execution stage started
+105ms ¦+Execution stage complete. (6ms)
+106ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 533.396s)
+118ms +Event processed successfully (118ms)
8/21/2019, 3:51:10 PM +652ms
+1ms +Received event [Zooz Freezer].power = 97.04 with a delay of 102ms
+99ms ¦RunTime Analysis CS > 20ms > PS > 25ms > PE > 54ms > CE
+102ms ¦Runtime (38790 bytes) successfully initialized in 25ms (v0.3.10c.20190522) (99ms)
+103ms ¦+Execution stage started
+108ms ¦+Execution stage complete. (6ms)
+110ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 563.569s)
+121ms +Event processed successfully (120ms)
8/21/2019, 3:50:40 PM +647ms
+1ms +Received event [Zooz Freezer].power = 97.13 with a delay of 210ms
+116ms ¦RunTime Analysis CS > 32ms > PS > 31ms > PE > 53ms > CE
+118ms ¦Runtime (38791 bytes) successfully initialized in 31ms (v0.3.10c.20190522) (116ms)
+120ms ¦+Execution stage started
+164ms ¦+Execution stage complete. (45ms)
+166ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 593.518s)
+177ms +Event processed successfully (177ms)
8/21/2019, 3:50:10 PM +635ms
+1ms +Received event [Zooz Freezer].power = 97.04 with a delay of 197ms
+108ms ¦RunTime Analysis CS > 22ms > PS > 26ms > PE > 60ms > CE
+111ms ¦Runtime (38791 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (109ms)
+112ms ¦+Execution stage started
+117ms ¦+Execution stage complete. (6ms)
+119ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 623.577s)
+131ms +Event processed successfully (131ms)
8/21/2019, 3:49:40 PM +754ms
+2ms +Received event [Zooz Freezer].power = 97.71 with a delay of 210ms
+120ms ¦RunTime Analysis CS > 21ms > PS > 26ms > PE > 73ms > CE
+123ms ¦Runtime (38791 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (121ms)
+124ms ¦+Execution stage started
+133ms ¦+Execution stage complete. (9ms)
+136ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 653.44s)
+148ms +Event processed successfully (148ms)
8/21/2019, 3:49:11 PM +16ms
+1ms +Received event [Zooz Freezer].power = 97.13 with a delay of 191ms
+103ms ¦RunTime Analysis CS > 21ms > PS > 28ms > PE > 54ms > CE
+105ms ¦Runtime (38791 bytes) successfully initialized in 28ms (v0.3.10c.20190522) (103ms)
+106ms ¦+Execution stage started
+112ms ¦+Execution stage complete. (6ms)
+114ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 683.201s)
+133ms +Event processed successfully (133ms)
8/21/2019, 3:48:40 PM +740ms
+2ms +Received event [Zooz Freezer].power = 97.42 with a delay of 101ms
+107ms ¦RunTime Analysis CS > 23ms > PS > 26ms > PE > 57ms > CE
+109ms ¦Runtime (38791 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (107ms)
+110ms ¦+Execution stage started
+116ms ¦+Execution stage complete. (6ms)
+118ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 713.473s)
+128ms +Event processed successfully (128ms)
8/21/2019, 3:47:40 PM +740ms
+2ms +Received event [Zooz Freezer].power = 97.33 with a delay of 217ms
+97ms ¦RunTime Analysis CS > 22ms > PS > 26ms > PE > 48ms > CE
+99ms ¦Runtime (38790 bytes) successfully initialized in 26ms (v0.3.10c.20190522) (97ms)
+100ms ¦+Execution stage started
+106ms ¦+Execution stage complete. (6ms)
+107ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 773.483s)
+120ms +Event processed successfully (120ms)
8/21/2019, 3:47:10 PM +991ms
+2ms +Received event [Zooz Freezer].power = 97.42 with a delay of 108ms
+108ms ¦RunTime Analysis CS > 24ms > PS > 28ms > PE > 56ms > CE
+111ms ¦Runtime (38791 bytes) successfully initialized in 28ms (v0.3.10c.20190522) (107ms)
+112ms ¦+Execution stage started
+149ms ¦+Execution stage complete. (37ms)
+150ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 803.189s)
+163ms +Event processed successfully (163ms)
8/21/2019, 3:46:40 PM +534ms
+1ms +Received event [Zooz Freezer].power = 97.71 with a delay of 99ms
+105ms ¦RunTime Analysis CS > 22ms > PS > 25ms > PE > 59ms > CE
+108ms ¦Runtime (38790 bytes) successfully initialized in 25ms (v0.3.10c.20190522) (105ms)
+109ms ¦+Execution stage started
+142ms ¦+Execution stage complete. (34ms)
+144ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 833.653s)
+157ms +Event processed successfully (157ms)
8/21/2019, 3:46:10 PM +667ms
+1ms +Received event [Zooz Freezer].power = 97.62 with a delay of 231ms
+103ms ¦RunTime Analysis CS > 22ms > PS > 29ms > PE > 52ms > CE
+105ms ¦Runtime (38791 bytes) successfully initialized in 29ms (v0.3.10c.20190522) (103ms)
+106ms ¦+Execution stage started
+114ms ¦+Execution stage complete. (8ms)
+116ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 863.548s)
+127ms +Event processed successfully (127ms)
8/21/2019, 3:45:42 PM +192ms
+3ms +Received event [Zooz Freezer].power = 97.71 with a delay of 1383ms
+133ms ¦RunTime Analysis CS > 31ms > PS > 29ms > PE > 73ms > CE
+136ms ¦Runtime (38792 bytes) successfully initialized in 29ms (v0.3.10c.20190522) (131ms)
+137ms ¦+Execution stage started
+232ms ¦+Execution stage complete. (96ms)
+242ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 891.898s)
+255ms +Event processed successfully (254ms)
8/21/2019, 3:45:34 PM +768ms
+2ms +Received event [Starry Night].time = 1566427534330 with a delay of 436ms
+181ms ¦RunTime Analysis CS > 51ms > PS > 51ms > PE > 81ms > CE
+185ms ¦Runtime (38797 bytes) successfully initialized in 51ms (v0.3.10c.20190522) (178ms)
+186ms ¦+Execution stage started
+313ms ¦¦Comparison (decimal) 97.84 did_not_change = false (41ms)
+315ms ¦¦Condition #5 evaluated false (53ms)
+316ms ¦¦Condition group #2 evaluated false (state did not change) (56ms)
+319ms ¦¦Cancelling statement #6’s schedules…
+340ms ¦¦Executed virtual command setVariable (5ms)
+378ms ¦+Execution stage complete. (192ms)
+410ms ¦Setting up scheduled job for Wed, Aug 21 2019 @ 4:00:34 PM PDT (in 899.153s)
+420ms +Event processed successfully (421ms)


#2

Hi,

I’m not sure on all your logic, however, if the power has failed, on the next invocation of your piston, wouldn’t the power level have not changed? i.e its still failed, so you’d reset the counter?

Are you testing for just failure of the freezer itself (power on socked goes to 0) or a general powercut?


#3

Also, keep in mind if the power is out, the the ST hub cannot do anything whatsoever…
(it cannot see or control any devices)


For what it’s worth, it is fairly easy to detect when the power comes back on though…


#4

Thank you, I should have mentioned that the freezer is in the garage on dedicated circuit. I do get ST notifications, and others, if all house power goes out, so that is not overly concerning. Previously, the freezer power went out and I was unaware for 3-4 days until I happened to open the freezer for something.


#5

Is your ST hub on that dedicated circuit?


#6

Paul,
I should have been more concise. Specifically, if the breaker for the freezer pops (it’s dedicated) is what I am aiming for. From what I can tell when something like that happens ST just reads the “last power state” and then it stay like that until power comes back on. I have tested this by plugging the ZOOZ in, and then adding something like a laptop to the ZOOZ. After about 15 minutes, or so, of different power reading on the ST, I unplug the ZOOZ. At that moment ST then continues to read the last power readings that were reported, and it continues to show as the ZOOZ as being “ON”. So my thought is that if the power reading remains exactly the same for X amount of readings, then theoretically there could be something wrong w/ my freezer circuit breaker.


#7

No, ST is not on dedicated circuit, but it is on battery. Really the only way I know when ST is offline is if the whole house goes down and I lose internet, then I get a ST Offline message. What I am trying to do is figure out when the circuit breaker for the freezer pops, and the reading sent from ZOOZ to ST stops changing. I just replied to Paul with more specifics.
Thank you for being engaged.


#8

Ah ok. Cool. The reason I was asking is because when the whole house looses power, the ST notifications you receive are 100% cloud-based… Meaning that none of your devices can report anything unless they are also on batteries… (assuming the modem is as well)


Back to your issue at hand… Untested, but this should work:

(I changed your condition to a trigger, so the forced subscription is not required)


#9

Thank you very much, I will give it a try this evening when I get home and I will let you know how it goes.


#10

That did not work. Apparently ST has updated the app, so now it continues to show the last known power info, however the app shows it as “unavailable”, but still shows it as being “ON”. When testing I just unplugged it to simulate an outage, and as soon as I did that the piston stopped getting any updates in the log, what soever. As soon as it came back online (plugged it in) the piston started getting updates in the log.
Another question is that the polling seems to be about every 3-10 seconds, is that normal/needed? I am going to try and figure out if the piston can alert on “unavailable” but not seeing it yet.


#11

I am assuming that you left it unplugged for (at least) the duration plus 5 minutes?


Subscribing to power changes technically happens many many times each second. I think SmartThings has limiting blocks in place to reduce that a bit.

Perhaps a better approach is something like this:

define
   decimal {powerNow} = (not set)
   decimal {powerPrev} = (not set)
end define

execute
   Every hour
      Set variable {powerPrev} = {powerNow}
      Wait 1 second
      Set variable {powerNow} = Outlet 1's power
      IF {power} = {powerPrev}
         Then Send SMS "Twice in a row, the power was "{power}
      END IF
   END EVERY
end execute

This method totally removes power as the trigger, and should work 98% of the time. (unless the power just happens to be identical twice in a row. Then you may occasionally get a false alert)

It is possible to expand this so three hours must all be the same before you get an alert, but it will complexify the piston


#12

Thank you I will give it a shot over the weekend. Also, yes I left it unplugged for 30 minutes during the test. What would really be nice is to create a piston that is able to read when ST shows a device as unavailable. I am playing with “devicewatch-devicestatus” and “healthstatus” to see if that will give any results. I’ll let you know how it all goes.
Thanks again for your help on this.


#13

I wonder if this old thread would help with your current project…


#14

Thank you - I was out of town over the weekend, but will give it a shot in the next couple of days.


#15

That old thread seems to have done the trick. I had to make some modifications, but from what I can tell it is working. The next thing I have to do is figure out why ST shows the ZOOZ as “Inactive” but not offline. I have 2 total ZOOZ one for a freezer and one for a refrigerator. They both seem to show as “inactive” in regards to power readings, however you can still turn them on/off. I suppose as long as it doesn’t go “UNAVAILABLE/OFFLINE” then I am good to go. Marking this as solved. Greatly appreciate you assistance!


#16

Glad to be able to help… :sunglasses:

Perhaps you can post your modified piston in case others come along later looking for a similar alert…


#17


#18

Thanks for sharing!