Rule Machine® Introduction

rule_machine

#83

Many of us use https://pushover.net/ for messaging to overcome the 10 per day limit. There is a one time (NOT recurring) $5 cost for a Pushover account, but then you get 7,500 messages per month. There is a built in integration for Pushover in Hubitat.


#84

Excellent! Thank you!


#85

The ability to control all of your music players from one Rule is in the latest release: Hub Update 1.1.6


#86

HTTP Get was added to Rule Machine in the latest release: Hub Update 1.1.6


#87

As an alternative to the above solutions, if you've ever had SmartThings (and don't mind still using the app), you can also use this community-created Hubitat driver and SmartThings SmartApp together to route notifications to ST from Hubitat: Route Hubitat Notifications to SmartThings (App and Driver)

But in general, as suggested: by using notifications instead of text messages, you won't have to worry about the 10/day SMS limit. :slight_smile:


#88

Thanks for that suggestion. Appreciated.


#89

@bravenel. I am curious if there is currently a way to trigger a rm action directly from a driver or app?


#90

@bravenel have you considered allowing parameters to be set/passed to the custom command via rule versus hard coded in the custom command itself? I have a driver function that accepts an integer type input and am having to create duplicate custom commands for the multiple values and it would be nice if I could just pass that parameter from the rule itself.


#91

My "elaborate" WebCore rule that I'm looking to port ultimately targets a ceiling fan that takes speed as an integer 0-4. (Off to High, respectively.) The upstairs circulation isn't very good, and temperature differences are a challenge; we combat that with the ceiling fan in the stairwell to help even out temperatures through the house.

I have a WebCore rule that maps the HVAC state (off, fan, heat/cool) and the temperature difference between upstairs/downstairs (< 3 degrees, 3-5 degrees, 5+ degrees) each into the range 0-2, then passes the sum as the instruction to the fan.

Of course, since I can't get to the built-in Nest integration yet and the community-based one doesn't expose the actual running state of the HVAC, I have some antecedent roadblocks to overcome before I'm able to start attempting to compose rules. But to achieve something comparable, I'm not currently seeing anything simpler than the cross-product of all possible states.

Another one I currently have in WebCore controls in-room fans upstairs: The fans will get turned off when the upstairs/downstairs temperature difference is less than three degrees and any fan currently on has been on for at least an hour. I think I could achieve that with three rules:

  • Create an Action to turn off the fans if the difference is small enough (though I don't see that I can do a difference), with a repeat built in to keep checking until it's true. (And then stop running, one presumes.)
  • In a second Trigger, if one of the fans is turned on, pause the Action immediately.
  • In a third trigger, when one of the fans is turned on, wait one hour and un-pause the Action. Reset the pending action if the other fan is turned on

#92

Without seeing your specific pistons details, I'm thinking you could create virtual switches for thermostat operating state that are turned on and off by IFTTT.

Then, create 3 rules, one for each desired fan speed (low, med, high). The rule can be combinations of
conditions that would result in the fan being low, med, etc. It is effectively accounting for the cross-product like you said, but doing it in 3 rules instead of 9.

Example:
If
(
Thermostat Fan Only switch on
AND
Upstairs temp >= Downstairs temp + 5
AND
Upstairs temp <= Downstairs temp +3
)
OR
(
Thermostat off
AND
Upstairs temp > Downstairs temp + 5
)
OR
(
Whatever else, you get the idea
)
When true, set fans to medium (xx%)

Etc


#93

Here's an example to check and see if one temp sensor is within 2 degrees of another. Right now my front door is 68 degrees and office door is 72, so the rule is false.


#94

Post the piston


#95

Slightly broken, since the fan is already moved off SmartThings, but here it is:


#96

That's an interesting idea! Unfortunately, it appears that Nest's IFTTT integration doesn't expose the thermostat operating mode either, only temperature and Home/Away state.


#97

Is it possible to do a play track at a specific level when doing an action playing a URI track in ‘Control Music Player’ action? This is on Sonos. Ideally also play for specific duration would be perfect. Reason I ask is I’m copying over my good night piston from WebCoRE. In that I play a track with specific URI, set volume and set the piston to stop music after 2 hours


#98

I'm fairly new to Hubitat and am just now setting up some rules in Rule Machine. I have a very basic question. What is the difference between switches to turn on or off after a delay
and switches to turn on or off after a delay, pending cancellation?


#99

The on/off with cancellation means that if the rule truth changes during the delay period, the delayed action will be cancelled.

Suppose you want to turn off a light 2 minutes after motion stops, but not if motion is still active. Motion sensors may report inactive after 15 seconds. By using turn-off-after-a-delay-with-cancel, should the sensor report active again before the 2 minutes is up, it won't turn the light off. The next time the sensor reports inactive, the timer would start again. Only when it remains inactive for the full 2 minutes would the light turn off.

The other type of delay is just a simple delay. It's going to happen when the timer is up, irrespective.


#100

Thanks for the explanation.

This thread has helped get me started. Is there a resource that will help me take a deeper dive into Rule Machine?


#101

There are several. A simple search will pull them up.


#103

These really are helping me. I bookmarked them once I found them so I don't have to go searching for them again.

Then

I'm sure there are more, but i'm still figuring everything out and finding my way around my self.