Need a little help with the RM rule

I had a rule bring my z-wave mesh to a halt earlier today.

I'm trying to send myself a notice if the home's power level is high when leaving the house.
Leaving the house is represented by the well pump's power feed being 'off', since we turn it off when we leave.

I want to have it only run if the well pump power is 'off', and don't want to test for the value more than a little, I have 2 seconds, while after the pump power is 'off'. I got a notification when the value was greater than 1000watts, the value I chose, which probably was because the fridge started up. I want to keep the test value on the low, more realistic side, like if a space heater was left on, or something.

My logic is probably wrong. Here are a couple snips of the rule and logs.
I have the test value set at 200 for test purposes.

that rule will trigger everytime your power meter gets an even over 200w which will be a lot!

I think I figured it out.
2 seconds was too short.
The Aeotec home energy monitor is set for 5 second intervals.
The first test failed, and the timer was never set back to zero, so it got larger and larger.

I'll increase the test time and have some kind of way to exit if it failes.

Just for testing.

you could try the notify app which also has certain restricution and automatically can set how often to notify you of the event without writing special logic.

There are several things wrong, apparently.
I'll puzzle it out.

If I'm reading your requirements right, then you want to:

If the pump is turned off and stays off for a short period (meaning you turned it off and walked away to leave) check the power usage and send a notification if it's above a certain value.

If that's right, then this should do it:

You'll obviously want to edit the 'stays' time for the trigger and the power value threshold to suite your purpose.

1 Like

Thanks!
That's a lot less convoluted than mine, plus it'll work, lol.
I'll have to test it as soon as this power outage is over, lolx2.

1 Like

This is the rule I think I'm going with.
The issue with yours is that the fridge will likey produce a very short surge at some point that I've seen almost at 1000W. Then I'd get a message.
This way I'm only testing for greater than 1000W for the 8 seconds after the well pump shuts off.
It seems to work and not bring down my z-wave mesh, lol.

Effectively, we're doing the same thing. Your condition around the amount of time since the switch was turned off will never evaluate false since the rule is going to run as soon as the switch is turned off.

My rule will only evaluate the power level once after the switch has been turned off for 10 seconds. Your rule will only evaluate the power level immediately after the switch turns off.

1 Like

Won't it continue to evaluate after 10 seconds, so that if power crosses the threshold, it'll kick off a notification?

I believe my rule won't be doing evaluating 8 seconds after the pump switch turns off.

That's my plan anyway, lol.

No. The rule runs whenever the trigger condition is met. It's a one time passthrough unless you add a repeat into the actions. Your rule will check the power as soon as the switch is turned off and alert if it's above 1000, then the rule ends. My example above will wait until the switch has been off for 10 seconds and then check the power one time before exiting.

Trigger:
"// The actions are run as soon as this condition is met"
Well Pump turns off

Action:
"//Set the variable to sensor value"
Set power to Home Energy Monitor power meter
"//Evaluate time since the switch was turned off and power level"
"//Time since turned off will be <1 second since the pump turning off is the trigger"
"//Check power once immediately"
IF(NOT Time since event: switch(off) on Well Pump exceeds 0:00:08 AND Variable power > 1000) THEN
	Notify stuff
END-IF
"//Rule exits"

So are you actually wanting the rule to check the power level a few times after the switch is turned off?

1 Like

If you want that say pump turns off and stays that way for x time.

No, just once, when leaving the house.
There is a 5 second refresh on the house energy monitoring system.

Perhaps I left and EndIf out originally.
Somehow the evaluation kept running.

I'll try yours too.

The original kept running because the trigger was the power level. So it would re-trigger every time the power meter reported a reading >200. Doesn't sound like that's what you want.

2 Likes

Works great.
More logical.
It's winner.
Thanks for indulging me.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.