Hello I’m new here from webcore. I’m trying to make my first crossover rule and I’m having a little bit of trouble and this seems like the proper forum to place it in as there’s not really a dedicated forum for help.
Webcore Piston:
The power fluctuates briefly to the washing machine so if there’s not stays time requirement in the beginning of the rule I will get constant false triggering.
Here is what I’m working with so far (sorry I’m new it would only let me put one picture in the post):
josh
September 13, 2022, 7:59am
3
Welcome to the community and thanks for posting!
You could use something like the following:
You can accomplish this with Variables. I usually split it up into two rules just to keep things clean.
Rule 1
Trigger:
Washing Machine - power changes and is less than 100
Flow :
IF $context.event.value < 5
THEN
Set Variable $isWashingPowerLow = true
ELSE
Set Variable $isWashingPowerLow = false
Notes
Trigger : The approach I’m using here is to have the rule trigger anytime the power changes within a range that we care about and then check if it’s above or below our threshold. Feel free to make the range much bigger if needed or you could just use something like changes and is not -999
if you just always want it to trigger and run through the flow.
Condition : In the flow, we’re using a context variable to grab the value that triggered the rule. This is an optimization to keep the rule execution fast as it doesn’t need to query for the current state and can instead using the triggering event value.You can select this under Variables: Context > Event > Device > Value
Rule 2
Trigger
$isWashingPowerLow stays true for 5 minutes
Flow
Send notification "The wash is done!"
Notes:
Now that we have a variable that indicates if the power is low or not, we can use that in other rules, for example to trigger whenever the power stays low for 5 minutes to indicate the end of a cycle.