Cycling my hotwater pump based on energy meter and motion


#1

1) Give a description of the problem
Motion triggers seem to expire when motion stops

2) What is the expected behaviour?
I’d like to when motion is seen, press a button via a Zooz multirelay, and repeat every 15 minutes for a period of time.

3) What is happening/not happening?
It presses the button once, and then while in “wait” motion stops and it stops the piston all together

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

5) Attach logs after turning logging level to Full
11/3/2020, 11:48:34 AM +243ms
+1ms ╔Received event [Motion Living Room].motion = inactive with a delay of 35ms
+65ms ║RunTime Analysis CS > 13ms > PS > 39ms > PE > 13ms > CE
+67ms ║Runtime (37061 bytes) successfully initialized in 39ms (v0.3.110.20191009) (65ms)
+68ms ║╔Execution stage started
+74ms ║║Comparison (enum) inactive changes_to (string) active = false (0ms)
+76ms ║║Cancelling condition #2’s schedules…
+77ms ║║Condition #2 evaluated false (4ms)
+78ms ║║Cancelling condition #1’s schedules…
+78ms ║║Condition group #1 evaluated false (state changed) (7ms)
+80ms ║╚Execution stage complete. (12ms)
+81ms ╚Event processed successfully (81ms)
11/3/2020, 11:48:18 AM +113ms
+1ms ╔Received event [Motion Living Room].motion = active with a delay of 24ms
+61ms ║RunTime Analysis CS > 13ms > PS > 38ms > PE > 11ms > CE
+63ms ║Runtime (37066 bytes) successfully initialized in 38ms (v0.3.110.20191009) (62ms)
+64ms ║╔Execution stage started
+72ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+73ms ║║Cancelling condition #2’s schedules…
+74ms ║║Condition #2 evaluated true (5ms)
+75ms ║║Cancelling condition #1’s schedules…
+76ms ║║Condition group #1 evaluated true (state changed) (8ms)
+78ms ║║Cancelling statement #3’s schedules…
+195ms ║║Executed physical command [Hot Button].on() (113ms)
+197ms ║║Executed [Hot Button].on (115ms)
+200ms ║║Executed virtual command [Hot Button].wait (0ms)
+202ms ║║Requesting a wake up for Tue, Nov 3 2020 @ 11:49:18 AM PST (in 60.0s)
+207ms ║╚Execution stage complete. (143ms)
+209ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 11:49:18 AM PST (in 59.995s)
+219ms ╚Event processed successfully (219ms)

Thanks for help!


#2

Set TCP (Task Cancellation Policy) to “Never” on your WITH.


#3

What is your ultimate goal? What is the hot water pump for and why do you need to press the button multiple times?


#4
11/3/2020, 12:07:45 PM +116ms
+1ms ╔Received event [Motion Living Room].motion = inactive with a delay of 29ms
+62ms ║RunTime Analysis CS > 13ms > PS > 38ms > PE > 11ms > CE
+64ms ║Runtime (37054 bytes) successfully initialized in 38ms (v0.3.110.20191009) (62ms)
+65ms ║╔Execution stage started
+72ms ║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+74ms ║║Cancelling condition #2's schedules...
+74ms ║║Condition #2 evaluated false (5ms)
+75ms ║║Cancelling condition #1's schedules...
+76ms ║║Condition group #1 evaluated false (state changed) (7ms)
+79ms ║╚Execution stage complete. (13ms)
+80ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 12:08:29 PM PST (in 44.176s)
+89ms ╚Event processed successfully (89ms)
11/3/2020, 12:07:29 PM +230ms
+1ms ╔Received event [Motion Living Room].motion = active with a delay of 38ms
+79ms ║RunTime Analysis CS > 14ms > PS > 49ms > PE > 16ms > CE
+82ms ║Runtime (37059 bytes) successfully initialized in 49ms (v0.3.110.20191009) (79ms)
+83ms ║╔Execution stage started
+89ms ║║Comparison (enum) active changes_to (string) active = true (0ms)
+91ms ║║Cancelling condition #2's schedules...
+92ms ║║Condition #2 evaluated true (5ms)
+92ms ║║Cancelling condition #1's schedules...
+93ms ║║Condition group #1 evaluated true (state changed) (7ms)
+95ms ║║Cancelling statement #3's schedules...
+135ms ║║Executed physical command [Hot Button].on() (36ms)
+136ms ║║Executed [Hot Button].on (38ms)
+139ms ║║Executed virtual command [Hot Button].wait (0ms)
+140ms ║║Requesting a wake up for Tue, Nov 3 2020 @ 12:08:29 PM PST (in 60.0s)
+144ms ║╚Execution stage complete. (62ms)
+145ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 12:08:29 PM PST (in 59.996s)
+153ms ╚Event processed successfully (152ms)

Still Canceled itself when motion stopped OR maybe its restarting each motion event? it is possible once it gets passed the IF it will stay locked into the WITH without restarting?


#5

Its a Navien water heater, its got the option to run the pump every 15 minutes 24 hours a day.
I dont want that, so it also has the option to have a “hot button” which is basically a door bell, and it will run the pump once when you press the button.

So I want to keep the water cycled and hot only when I enter the laundry room, so I want to either trigger it via a motion device or from a vibration sensor on the machine itself.

But I figure four 15 minutes cycles should keep the line hot for a wash load


#6

11/3/2020, 12:18:45 PM +160ms
+1ms ╔Received event [Motion Living Room].motion = inactive with a delay of 30ms
+68ms ║RunTime Analysis CS > 14ms > PS > 42ms > PE > 13ms > CE
+70ms ║Runtime (37062 bytes) successfully initialized in 42ms (v0.3.110.20191009) (69ms)
+71ms ║╔Execution stage started
+77ms ║║Comparison (enum) inactive changes_to (string) active = false (0ms)
+79ms ║║Cancelling condition #2’s schedules…
+80ms ║║Condition #2 evaluated false (4ms)
+80ms ║║Cancelling condition #1’s schedules…
+81ms ║║Condition group #1 evaluated false (state changed) (7ms)
+83ms ║╚Execution stage complete. (12ms)
+85ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 12:32:43 PM PST (in 838.596s)
+95ms ╚Event processed successfully (95ms)
11/3/2020, 12:17:43 PM +717ms
+1ms ╔Received event [Motion Living Room].motion = active with a delay of 31ms
+62ms ║RunTime Analysis CS > 12ms > PS > 38ms > PE > 12ms > CE
+65ms ║Runtime (37067 bytes) successfully initialized in 38ms (v0.3.110.20191009) (63ms)
+66ms ║╔Execution stage started
+73ms ║║Comparison (enum) active changes_to (string) active = true (0ms)
+74ms ║║Cancelling condition #2’s schedules…
+75ms ║║Condition #2 evaluated true (5ms)
+76ms ║║Cancelling condition #1’s schedules…
+77ms ║║Condition group #1 evaluated true (state changed) (8ms)
+79ms ║║Cancelling statement #3’s schedules…
+116ms ║║Executed physical command [Hot Button].on() (34ms)
+117ms ║║Executed [Hot Button].on (36ms)
+121ms ║║Executed virtual command [Hot Button].wait (0ms)
+122ms ║║Requesting a wake up for Tue, Nov 3 2020 @ 12:32:43 PM PST (in 900.0s)
+127ms ║╚Execution stage complete. (62ms)
+128ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 12:32:43 PM PST (in 899.995s)
+136ms ╚Event processed successfully (135ms)
11/3/2020, 12:16:34 PM +28ms
+0ms ╔Received event [Ventura].time = 1604434595953 with a delay of -1926ms
+77ms ║RunTime Analysis CS > 15ms > PS > 46ms > PE > 17ms > CE
+79ms ║Runtime (37064 bytes) successfully initialized in 46ms (v0.3.110.20191009) (78ms)
+80ms ║╔Execution stage started
+81ms ║╚Execution stage complete. (1ms)
+82ms ╚Event processed successfully (82ms)

Still restarting on a new event


#7

Yes, if your motion sensor is triggered again before it completes your WAITS, then you will have problems as your piston will run from top to bottom again. And your TCP does not need to be set on the IF.

EDIT: you can use a variable to monitor your pump status.

Try this…keep in mind that it will have to cycle once to set the variable.


#8

Ok, so is there a work around? Because the TCP on the WITH doesnt seem to change the behavior


#9
11/3/2020, 1:32:52 PM +209ms
+1ms ╔Received event [Motion Living Room].motion = inactive with a delay of 31ms
+68ms ║RunTime Analysis CS > 14ms > PS > 40ms > PE > 14ms > CE
+71ms ║Runtime (38220 bytes) successfully initialized in 40ms (v0.3.110.20191009) (69ms)
+72ms ║╔Execution stage started
+79ms ║║Comparison (enum) inactive changes_to (string) active = false (0ms)
+80ms ║║Cancelling condition #2's schedules...
+81ms ║║Condition #2 evaluated false (5ms)
+82ms ║║Cancelling condition #1's schedules...
+83ms ║║Condition group #1 evaluated false (state changed) (7ms)
+85ms ║║Cancelling statement #16's schedules...
+89ms ║║Executed virtual command setVariable (2ms)
+92ms ║╚Execution stage complete. (21ms)
+93ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 1:35:34 PM PST (in 161.89s)
+104ms ╚Event processed successfully (104ms)
11/3/2020, 1:32:33 PM +807ms
+1ms ╔Received event [Motion Living Room].motion = active with a delay of 33ms
+79ms ║RunTime Analysis CS > 17ms > PS > 48ms > PE > 15ms > CE
+81ms ║Runtime (38224 bytes) successfully initialized in 48ms (v0.3.110.20191009) (79ms)
+82ms ║╔Execution stage started
+90ms ║║Comparison (enum) active changes_to (string) active = true (0ms)
+92ms ║║Cancelling condition #2's schedules...
+93ms ║║Condition #2 evaluated true (6ms)
+97ms ║║Comparison (boolean) true is (boolean) true = true (1ms)
+99ms ║║Condition #13 evaluated true (5ms)
+100ms ║║Cancelling condition #1's schedules...
+101ms ║║Condition group #1 evaluated true (state changed) (13ms)
+103ms ║║Cancelling statement #14's schedules...
+108ms ║║Executed virtual command setVariable (3ms)
+111ms ║║Cancelling statement #3's schedules...
+379ms ║║Executed physical command [Hot Button].on() (264ms)
+380ms ║║Executed [Hot Button].on (266ms)
+383ms ║║Executed virtual command [Hot Button].wait (0ms)
+385ms ║║Requesting a wake up for Tue, Nov 3 2020 @ 1:35:34 PM PST (in 180.0s)
+388ms ║╚Execution stage complete. (306ms)
+390ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 1:35:34 PM PST (in 179.996s)
+398ms ╚Event processed successfully (398ms)
11/3/2020, 1:32:17 PM +82ms
+1ms ╔Received event [Motion Living Room].motion = inactive with a delay of 30ms
+65ms ║RunTime Analysis CS > 14ms > PS > 39ms > PE > 13ms > CE
+67ms ║Runtime (38220 bytes) successfully initialized in 39ms (v0.3.110.20191009) (66ms)
+68ms ║╔Execution stage started
+75ms ║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+76ms ║║Cancelling condition #2's schedules...
+77ms ║║Condition #2 evaluated false (5ms)
+78ms ║║Cancelling condition #1's schedules...
+79ms ║║Condition group #1 evaluated false (state changed) (7ms)
+82ms ║║Cancelling statement #16's schedules...
+86ms ║║Executed virtual command setVariable (2ms)
+89ms ║╚Execution stage complete. (20ms)
+90ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 1:35:00 PM PST (in 163.096s)
+99ms ╚Event processed successfully (99ms)
11/3/2020, 1:31:59 PM +891ms
+1ms ╔Received event [Motion Living Room].motion = active with a delay of 33ms
+70ms ║RunTime Analysis CS > 14ms > PS > 44ms > PE > 12ms > CE
+72ms ║Runtime (38224 bytes) successfully initialized in 44ms (v0.3.110.20191009) (70ms)
+73ms ║╔Execution stage started
+80ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+81ms ║║Cancelling condition #2's schedules...
+82ms ║║Condition #2 evaluated true (5ms)
+86ms ║║Comparison (boolean) true is (boolean) true = true (1ms)
+87ms ║║Condition #13 evaluated true (4ms)
+88ms ║║Cancelling condition #1's schedules...
+89ms ║║Condition group #1 evaluated true (state changed) (11ms)
+91ms ║║Cancelling statement #14's schedules...
+95ms ║║Executed virtual command setVariable (2ms)
+97ms ║║Cancelling statement #3's schedules...
+370ms ║║Executed physical command [Hot Button].on() (269ms)
+371ms ║║Executed [Hot Button].on (271ms)
+374ms ║║Executed virtual command [Hot Button].wait (1ms)
+375ms ║║Requesting a wake up for Tue, Nov 3 2020 @ 1:35:00 PM PST (in 180.0s)
+379ms ║╚Execution stage complete. (306ms)
+380ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 1:35:00 PM PST (in 179.996s)
+388ms ╚Event processed successfully (388ms)
11/3/2020, 1:31:10 PM +573ms
+1ms ╔Received event [Motion Living Room].motion = inactive with a delay of 39ms
+67ms ║RunTime Analysis CS > 14ms > PS > 41ms > PE > 12ms > CE
+69ms ║Runtime (38220 bytes) successfully initialized in 41ms (v0.3.110.20191009) (67ms)
+70ms ║╔Execution stage started
+77ms ║║Comparison (enum) inactive changes_to (string) active = false (1ms)
+78ms ║║Cancelling condition #2's schedules...
+79ms ║║Condition #2 evaluated false (5ms)
+80ms ║║Cancelling condition #1's schedules...
+81ms ║║Condition group #1 evaluated false (state changed) (7ms)
+83ms ║║Cancelling statement #16's schedules...
+88ms ║║Executed virtual command setVariable (2ms)
+90ms ║╚Execution stage complete. (20ms)
+92ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 1:33:52 PM PST (in 161.693s)
+101ms ╚Event processed successfully (101ms)
11/3/2020, 1:30:52 PM +233ms
+1ms ╔Received event [Motion Living Room].motion = active with a delay of 27ms
+58ms ║RunTime Analysis CS > 12ms > PS > 36ms > PE > 10ms > CE
+60ms ║Runtime (38224 bytes) successfully initialized in 36ms (v0.3.110.20191009) (58ms)
+61ms ║╔Execution stage started
+68ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+69ms ║║Cancelling condition #2's schedules...
+70ms ║║Condition #2 evaluated true (5ms)
+74ms ║║Comparison (boolean) true is (boolean) true = true (2ms)
+75ms ║║Condition #13 evaluated true (4ms)
+76ms ║║Cancelling condition #1's schedules...
+77ms ║║Condition group #1 evaluated true (state changed) (12ms)
+79ms ║║Cancelling statement #14's schedules...
+83ms ║║Executed virtual command setVariable (2ms)
+86ms ║║Cancelling statement #3's schedules...
+119ms ║║Executed physical command [Hot Button].on() (29ms)
+120ms ║║Executed [Hot Button].on (31ms)
+122ms ║║Executed virtual command [Hot Button].wait (0ms)
+124ms ║║Requesting a wake up for Tue, Nov 3 2020 @ 1:33:52 PM PST (in 180.0s)
+127ms ║╚Execution stage complete. (66ms)
+129ms ║Setting up scheduled job for Tue, Nov 3 2020 @ 1:33:52 PM PST (in 179.996s)
+138ms ╚Event processed successfully (138ms)

Still not making it past the motion stopped, and reseting when motion starts again


#10

Yes, the same for my tests too. I’m missing something…


#11

This kinda works, but still resets on new motion event:

similar and also doesn’t work:


#12

What about something like this? You should only have to change the three variables at the top to test this out.


#13

it seems to be running kinda randomly… but looks promising will continue to test and see what its doing

Thanks
EDIT: So this mostly does work, but I have some random On commands outside of the interval… kinda hard to figure out why


#14

I’ve written code just like this many times before, but I cannot get this to work. I am still working on it.


#15

Not sure why I had to do it this way but I think this works. I’m sure I am missing something here and someone will chime in.


#16

Why not using a single WAIT, for 4 minutes?
And using a motion sensor for something like this is very tricky…


#17

Testing this now on the second relay to see how it compares. Thanks for taking the time to mess with this.


#18

I was just using WAIT for my first attempt, but it would reset the clock on new motion events.

I assume a vibration sensor would have the same issues as a motion sensor, but if I just set up a button to fire it, I am sure my wife will forget to press it before running the machines, so I am trying to make it automatic somehow


#19

You are welcome. That is why many of us are here.


#20

Is your other piston paused? I can’t tell you how many times I create a piston to test an idea and forget to pause the other one so things appear to turn on and off randomly. lol