Attribute Value Less Than X for Y Mins


#1

Hi,

I have some new TP-Link Energy Monitoring Smart Plugs (model HS110) and I am polling the current power usage for these plugs every minute thanks to the driver developed by @djgutheinz. I have setup a HE RM rule to monitor the power being used by my washing machine and to have a notification sent to my phone when it drops below 10w. After a relatively successful couple of loads of washing, it would appear the machine can dip below this on occassion throughout a wash cycle when moving between the different phases of washing, rinsing, spinning, etc.

Does anyone have any tips for being able to tell when a device attribute has stayed below a threshold for a period of time, e.g. in my case, the current power consumption of the smart plug is below 10w for 3 minutes?

Thanks,
Simon


#2

There is a community app that will do this without rule machine. Search for "Better Laundry Monitor". It has the options to count the cycles like you want.

Otherwise maybe use private boolean? I have a similar example in another thread but the short version is:

Trigger: Washing Machine Outlet CHANGED
Action:

  • IF power level of washing machine > 10
  • THEN set private boolean to TRUE
  • ELSE IF power level of washing machine < 0.5
  • THEN set private boolean to FALSE
  • END IF

I did this in a separate rule first, then gave the second rule permission to use this private boolean output. You would probably want to add some delays (I think immediately after the first THEN?) , that would take care of most of the cycling.

Couple links that may help. The first is my private boolean rule, the second link explains the delays and cancels better than I can.


#3

You do not need to use private boolean for this. It is actually much easier than that.

Triggers:  Power changes.

Action:
If Power > 10 W
        Cancel Delayed Actions
Else 
        Delay actions for X mins
         Execute rest of rule
End-If

That's all you need to do.


#4

Thanks for the tips @neonturbo and @Ryan780.

I'm probably leaning towards the "better laundry monitor" or some variation at this stage, I think the simpler power change and delay option may still fire if the power fluctuates below my 10W threshold. I'll have to do a few tests to work out what suits my setup.

Thanks,
Simon


#5

For those interested... I ended up using the better laundry monitor and so far so good.