Power Consumption Monitor


#1

1) Give a description of the problem
Can’t seem to get this piston to fire upon “restoring”.

2) What is the expected behaviour?
If the assigned plugs have 0W power draw over an extended period of time (indicating a potential failure of the plugged in appliance), then notify me via SMS. If this occurs, and power consumption then returns, notify me of the restoration.

3) What is happening/not happening?
The restoration SMS is not detecting the state change and therefore not firing that portion of the piston when power consumption returns.

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

5) Attach logs after turning logging level to Full
2/22/2021, 8:20:59 PM +138ms
+1ms ╔Received event [Home].time = 1614043259802 with a delay of -664ms
+124ms ║RunTime Analysis CS > 58ms > PS > 7ms > PE > 59ms > CE
+126ms ║Runtime (40796 bytes) successfully initialized in 7ms (v0.3.113.20210203) (124ms)
+127ms ║╔Execution stage started
+151ms ║║Comparison (decimal) 107.155 is_equal_to (integer) 0 = false (1ms)
+153ms ║║Comparison (decimal) 100.237 is_equal_to (integer) 0 = false (1ms)
+155ms ║║Condition #3 evaluated false (19ms)
+156ms ║║Condition group #2 evaluated false (state did not change) (20ms)
+158ms ║║Cancelling statement #29’s schedules…
+164ms ║║Calculating (string) Garage freezers are functioning at + (string) Mon, Feb 22 2021 @ 8:20:59 PM EST >> (string) Garage freezers are functioning at Mon, Feb 22 2021 @ 8:20:59 PM EST
+167ms ║║Calculating (string) Garage freezers are functioning at Mon, Feb 22 2021 @ 8:20:59 PM EST + (string) >> (string) Garage freezers are functioning at Mon, Feb 22 2021 @ 8:20:59 PM EST
+169ms ║║Executed virtual command setState (1ms)
+175ms ║║Executed virtual command setVariable (4ms)
+181ms ║║Comparison (string) green changes_away_from (string) red = false (0ms)
+183ms ║║Condition #9 evaluated false (4ms)
+184ms ║║Condition group #8 evaluated false (state did not change) (6ms)
+187ms ║╚Execution stage complete. (59ms)
+188ms ║Setting up scheduled job for Mon, Feb 22 2021 @ 8:36:59 PM EST (in 960s)
+197ms ╚Event processed successfully (197ms)


#2

There are MANY ways to approach this. Here is my suggestion. I have not tested this.

Define
Boolean Power_Failure

IF Outlet 5 or Outlet 9 power stays less than 5W for 3 hours
  Then
    Send SMS "Possible freezer power failure"
    Set Power_Failure = true
END IF

Every 15 minutes
IF Outlet 5 and Outlet 9 power is greater than XX W
and
Power_Failure is true
  Then
    Send SMS "Freezer restored"
    Set Power_Failure = false
END IF

Where XX is somewhere near but below your average power reading for a freezer ( ? 100W).


#3

Thanks, will give this and a few other suggestions a shot over the next few days/week. Appreciated!


#5

@Pantheon, as you mentioned, many ways to do this. This one seems to have worked for me. Thanks for the insight you shared, appreciated.


#6

Just food for thought…
My power readings change often based on use and ambient temperature so…

may not behave as you expect. YMMV.