Hello everyone hopefully i put this post in the correct area. I was unsure where it would fit best.
Im trying to do a simple automation and i really need some help . I had made a virtual contact sensor within hubitat. im trying to use when energy meter as the trigger when engery goes above xx watts put the virtual contact to open when engery falls below xx watts put virtual contact to closed. I tired doing this in rule machine but i failed horribly.
My goal
So i have the virtual contact sensor in amazon alexa when the contact sensor is closed alexa will play an announcement. I have the alexa part done i just need the hubitat automation.
There are a couple of different ways you could set this up. Ultimately, it depends if you want one rule or two. Personally, I would use two rules and it would look something like this:
Rule 1
Required Expression:
Private Boolean is True
Trigger:
Energy is above XX Watt
Actions:
Set Private Boolean of this rule to False
Set Private Boolean of 2nd rule to True
Set Virtual Contact to Open
Rule 2
Required Expression:
Private Boolean is True
Trigger
Energy Watt is below XX
Action
Set Private Boolean of this rule to False
Set Private Boolean of Rule 1 to True
Set Virtual Contact to closed
The Private Boolean is used so that your rule only runs once rather than every time you get a Watt reading above or below your desired amount.
That makes sense by looking at your triggers. The contact opens if the power level increases by over 280. The contact closes if the power level is greater than 8. 280 is greater than 8. I think the contact closing should be less than 8?
Yes for some reason when i start the dryer it goes to open then it immediately goes to closed . However there is no way the watts could be less then 8 . So im confused
That's not what your trigger says. The trigger is saying the Watt value is > than 8. You need to switch it around so that the trigger is Watt value is < 8.
We have all been there! @Johnnyvaneddie has a good idea as well.
Required Expression
Private Boolean is True
Trigger
Power Level is greater than 8
Action
Set Private Boolean to False
Set Virtual Contact to Open
Wait for Event: Power Level is less than 8
Set Virtual Contact to Close
Set Private Boolean to True
A Private Boolean is just a simple variable (true/false) that is unique to each rule. A lot of folks will utilize it as a way of making sure a rule only runs once until complete. Basically, every time you get an energy reading, your rule will be evaluated. If you want it to only run once, a Private Boolean is a way of limiting it.
@JB10 so im trying to do the same thing with the washer , however the washer will sit for 45 seconds or so at 1 watt . So i need to have a rule that says if washer drops to under 3 watts and stays there for 2 minutes then close virtual contacts . Would you mind explaining how to write that rule in RM
It already has most, if not all of the options you are trying to create in rules
The other added bonus from installing package manager will be the ability to find and install other usefull apps.
Not to disuade you from playing with Rule Machine, especially if you are just trying to feel it out and learn it. But, if you want the switches on, etc, with a lot of the logic already figured out, the app has already debugged most of the isses.
Hey thanks for the suggestion.However i'm already using better laundry .
Im using RM for a virtual contact sensor that i have in alexa routines then the sensor closes alexa makes an announcement on all my amazon echos throughout the house . Unfortunately better laundry couldnt do these automations