Notification when wattage goes above or below a certain amount

Greetings,

I have a very simple PLEG task , but I can not get my head around it.
A relais which senses the wattage

I made 2 triggers:
-wattage_below (below 10 watts)
-wattage_above (above 20 watts)

Initially I had just the conditions:
Wattage_above
wattage_below

actions: send notification

But I kept on recieving messages, I just want one message when the wattage is below or above the amount of watts.

Now I made these conditions, but does it make sense?

Conditions:
-wattage_below AND (!wattage_above ; wattage_below)
-wattage_above AND (!wattage_below ; wattage_above)

If I “translate” the first condition it says:
The condition will become true when wattage_below is true AND (first wattage above is false thereafter wattage_below is true)

Is this than correct?

Thanks,
Cor

Were the conditions set to repeat?

If you can post a status report, it may help us help you.

Ah … I noticed something else is going on. It seems like there are peak wattages , even when a connected device is switched off.

I need to make a condition where the wattage is at least 10 seconds above or below a certain amount. Let’s see if I can figure that out :o

Cor

No … I can not get it to work correctly.

It seems that the wattage peaks sometimes , although the computer is off.

What I want is this:

-A notification when the computer is switched on
-A notification when the computer is switched off

This can only be “read” by means of the wattage used , since the Qubino relais will always be on , the relais is just there for checking by wattage if the computer is on or off.

I made 2 triggers , one above 30 watts , one below 10 watts
( when the computer is on, the wattage is minimum 35 , and peaks to 60 with an average of 40)

I made 2 timers of 10 seconds , which are run by the 2 triggers.
-A_Computer_Timer_wattage_above
-A_Computer_Timer_wattage_below

and these 2 conditions to start the timers:
A_Computer_wattage_above
A_Computer_wattage_below

and these 2 conditions for a notification to run:
A_Computer_wattage_above AND ( A_Computer_wattage_above; !A_Computer_Timer_wattage_above )

A_Computer__wattage_below and ( A_Computer__wattage_below; !A_Computer_Timer_wattage_below)

4 actions:
2 for the timers to run:
2 for the notification to send

BUT; it doesn’t work , the computer has been off for example since last night , and I recieved about 7 messages that the computer is off . meaning , the condition “A_Computer__wattage_below and ( A_Computer__wattage_below; !
A_Computer_Timer_wattage_below)” was true for 7 times.

What am I doing wrong here? I do understand when there is a peak wattage, the wattage goes above 10 watts , timers is run , and that the condition “A_Computer__wattage_below and ( A_Computer__wattage_below; !
A_Computer_Timer_wattage_below)” becomes true … every time.

What should I do to recieve the notification only once.
Maybe something that the condition can only be true after the other condition has been true. Or maybe something completely different :-X

Thanks,
Cor

Anyone can help me with the correct condition?

I am struggling, I am gettign so many false notifiactions.

I am looking for something like:
computer_wattage_on AND The wattage has been above 30 watts for longer than 10 seconds AND computer_wattage_below was false before.

Thanks,
Cor

What you posted looks like a logic report. A status reports gives last true and last false timestamps and may give additional clues.

I have not used PLEG timers. I use the Countdown plug-in for the 2 timers I use.

You may want to add Vera Alerts to all your actions to test the logic. I have learned a lot from these when trying to learn PLEG. You expect one thing, get another from Vera Alerts, and you rethink your logic to get the expected result.

@ Don Phillips: Attached now a status report. Vera alerts I have removed from the actions, since all the notifications were driving me crazy. But as soon as the conditions have proper false and true status I will insert a vera alerts action again.

Timers I use quite a lot in my PLEG, I do not really want to install the countdown plugin , since I am running low on memory from my vera pls.

How would I make this condition:
computer_wattage_on AND The wattage has been above 30 watts for longer than 10 seconds AND computer_wattage_below was false before.

The Timer will run with when the computer_wattage_on is true.

But I am stuck with the how to insert this in a condition when?

Cor

Thanks for the status report. I did notice the triggers are changing status within milliseconds. Perhaps the sampling is too quick?

Sorry I cannot help with the complex condition looking at previous status. Hopefully some of the more advanced folks can provide some insight.

I would start by breaking the condition up into smaller conditions, define your Conditions such as cwattageabove30, c10sectimer and so on, then once you can see that they evaluate then you can start to combine them into 1 condition, although I would probably agree with Don in thinking the time period may be to small.
Can you extend the sampling time to perhaps 1 minute, check to see if it works, if so then you could start shaving some time off until it stops working correctly.

HIH