This object is in archive! 

Power meter (current_consumption) not triggering rule

Marius shared this idea 8 years ago
Under Consideration

I have a very simple rule that will not run. As far as I know, it should be possible for a meter to trigger a WHEN clause?


I am using a Fibaru wall plug to sense when my light is switched on. The light reports 130-140 watts in the zipabox event viewer.


I have also tried to use the power plugs WHEN ANY with a IF current_consumption > 50 inside it. It will not work either.


I can see the events in the event viewer.


Attached is my current rule. My other rules seems to work.

Replies (6)

photo
1

With the same device I use:


WHEN CURRENT_CONSUMPTION != 0

IF CURRENT_CONSUMPTION > 10


and it works.

Files: rule.png
photo
1

Thanks Carlo, I will check if I can use the same logic.


Since the device plugged into the wall plug is continously using a little more that 1W, I reckon a flood of events will be dispatched in the system, which may not be optimal..?


Do anybody else get this to work without a workaround?

photo
1

I tried the != 0 trick, and it works., thank you Carlo :)

photo
1

Try to use JOIN, otherwise your rule is executed continiously and takes system resources.

photo
1

Sander, that is also my consern.


If I use JOIN I will have to make some logic that prevents sending the pushover message more than once per a defined period. I could do that, but I like to keep my rules as 'clean' as possible :)


By using JOIN, my lamp makes the Fibaro wall plug execute the pushover-call multiple times , because even when the lamp looks to be stably on, it actually differs 3-4 times in watt-consumption within each minute. The zipabox pushed a message for each change in consumption when JOIN was on.


My sollution now is not using JOIN, but instead use WAIT 300. In this way, I get a push message every five minutes if the lamp is switched on again, or changes its consumption while on. The lamp has a built-in timer so that it switches itself off after 300s/5mins.

photo
1

Hi Marius, the behavior that you describe with JOIN is a bit strange because it's pourpose is the exactly opposite.


If you add JOIN at the beginning of the rule that rule may have just a running instance in any time, if the when clause is triggered another time the previous running rule stop it's exxecution and restart.

Otherwise if you omit JOIN every time the when clause is triggered a new rule start running. If that rule include a WAIT you may end in having more rules in parallel.


To clarify this point I attach two exemples.


With the first rule without JOIN if you switch ON and OFF multiple times the viirtual switch after 10 seconds you willl start receiving HTTP request and at the end you will receive as many HTTP requests as many times you toggled the virtual switch.


If you do the same thing with the second rule you will receive just a single HTTP request 10 seconds after the last toggle.

photo
1

Carlo, you are right. I probably forgot to sync my rule a couple of times, and misunderstood the behaviour. Yesteday I worked in the shed where the light and switch are, and I was spammed with messages on my phone. Even though I stated that I would like as clean rules as possible, I will have to make some logics with variables to get the desired functionality, I guess.


The functionality I want is very simple indeed:

If light goes on, send http request in an instant. Wait 3 minutes before sending a new one.

A very simple scenario, but I sure have used some time on it :)

photo
photo
1

thats a good solution, only when you change the timer in the lamp you have to remember to change the wait in the rule also.

You can also try to make optimize it with the BETWEEN operator puzzle an choose a good range of the power fluctuation in our IF statement.


On the other hand, it keeps strange that the WHEN is not triggerd on the Power meter values when they change and create an event.

Leave a Comment
 
Attach a file
Access denied