[Released] Basic Rules

Basic Rules

We are pleased to introduce a new automation app: Basic Rules. Basic Rule offers an easy to understand app for those just getting started with home automation. At the same time it offers features that experienced users will find handy.

Each Basic Rule you create takes this form: When X Do Y. When some specific event happens in your system perform an action. The types of events that can trigger a Basic Rule include these:

  • Time of day, with Sunrise and Sunset options
  • Motion, Contact, Presence, Acceleration or Vibration sensors
  • Water - Leak, Smoke or Carbon Monoxide detectors
  • Temperature, Humidity or Illuminance sensors
  • Switch on/off, Button pressed, or Mode changes

The types of actions that a Basic Rule can perform in response include these:

  • Turn switches on/off/toggle, set dimmer level, set color or color temperature
  • Lock/unlock locks, open/close valves or push a button
  • Send notifications or speak messages, set the Mode

In order to keep things easy Basic Rule will only offer choices for triggers (X) and actions (Y) for the actual devices you have installed in your Hubitat Elevation system.

Here is an example of a simple Basic Rule:

Easy Automations

Often just having a device trigger an action as shown above isn't quite what is needed. Perhaps we want a message sent if a door has opened and been left open. Basic Rule makes this sort of thing very easy:

The best way to learn what Basic Rule can do is to play around with it, see what you can create!

More Devices for X

Throughout Basic Rule allows you to select multiple devices for When a .... This can be very handy when a number of things might be needed to cause an action. Taking our example just above, but adding two or more contact sensors makes for a more robust rule to let us know a door has been left open. Plus, Basic Rule can even tell us which one was left open!

In each case with multiple devices, Basic Rule offers obvious choices, but not all choices. Needing more choices would push you into a more complex app, such as Rule Machine. So Basic Rule offers these hopefully obvious multiple device options:

  • Any motion sensor active; All motion sensors inactive
  • Any contact sensor open; All contact sensors closed
  • Any vibration sensor active; All vibration sensors inactive
  • Any presence sensor arrives; All presence sensors leave
  • Any switch turns on; All switches turn off

For temperature, humidity and illuminance sensors each will trigger if any sensor is greater than or less than the selected value.

Here is the doors left open rule with multiple contact sensors:

Note the %device% in the message. This indicates to fill in the name of the device that last triggered the Basic Rule. You can also use %value% to fill in the last event value (e.g. the last temperature if the trigger was temperature sensor below 32°), %date% and %time% to fill in when the event occurred.

More Actions for Y

Because you may want more than one thing to happen when a Basic Rule runs, you can easily add more actions. Any action you have in Basic Rule can be changed by directly editing it, or removed by hitting the Delete button. Building on the Any Door Left Open rule from above, we can add another action quite easily. Notice that we get a summary of the Basic Rule at the top of the page:

There is an action called Wait that simply introduces some delay in the subsequent actions being run for a selected number of minutes.

Wait Until ...

Next to the "Add another action" button is "Add Wait until ..." button. This option opens up the possibility of the rule waiting for another event before proceeding to run additional actions. With this option a rule can both turns on the lights in response to an event, and also turn them off later when another event occurs. Below is a modification of the Doors Open rule that turns off the lights after all of the doors have closed. Both Wait for minutes and Wait Until are cancelled if the rule is triggered again by it's primary trigger.

Restrictions

Suppose we only want the Any Door Left Open rule to run at night time. We can add a Restriction that determines those time or circumstances in which the Basic Rule will run.

The available Restrictions include:

  • Only between two times
  • Only on certain days of the week
  • Only when mode is one of a selected list of mode
  • Only when illuminance is greater or less than a selected value
  • Only when not disabled by a switch being on or off

When a Basic Rule is restricted, Restricted in red will appear next to the rules name, both in the app and on the Apps list.

There are options to change the Basic Rule name if you don't like the automatically created name, and to turn on logging to see each step the rule takes when it runs in Logs.

20 Likes

Congrats guys on making this App available which I'm sure will make the on-boarding of new users much easier.

image

:frowning:

Would be nice for it to just set the name entry invalid and not let you click done instead of erroring out making you have to redo the rule. Alternatively, just strip the characters beyond 255.

Valid complaint. Did that happen with the automatic name? We had the same problem with Simple Automation Rule, and fixed it there. Can do the same here.

1 Like

The automatic name clips everything after the first action but I'd rather have the whole rule in the name where possible. In this example it would fit. Typing in a manual name longer than the 255 char limit is what triggers the error.

image

Something like this

image

OK. It's not going to allow names over 255 no matter what; this is a platform limitation. And the fix is simply to truncate whatever the name is.

Is the assumption correct that there is no significant improvement in Hubitat efficiency/performance by replacing a Simple Automation Rule with a Basic Rule?

No meaningful difference is my guess. I think you guys overthink this "efficiency/performance" thing.

3 Likes

We definitely do.

I'm fine with that. I would just like names under 255 to not get clipped at the knees after the first action.

The app design is that the rule name is the trigger and first action. There is no clipping at the knees going on.

Any chance we could get the ability for Basic Rule to open/close virtual contacts?

Would be cool to use this as a way to "if any contact is open for more than 5 minutes, open a virtual contact", etc.

No. Use RM. Even with RM you need a Custom Action.

Or, create a virtual contact driver that includes switch capability. You could control the contact state with the switch.

1 Like

That's fine! RM is just a lot more clicking to say "if any of these open, do this", etc. =)

I'm gonna try a Virtual Switch and see what we see. =)

Thanks!

There appears to be a bug in basic rules.


Even though I click OK to remove basic rules from my hub.

It does not get removed, It's appears to be permanent even though I don't want it.

It is auto-installed for new users. We will look into being able to delete it. It is harmless other than annoying you.

This is actually a C-5 hub way before basic rules was created, nor was ever added to my UI, it only popped up when deleting everything. Just figured it was a bug having a remove button that doesn't actually do what it's supposed to.

The new C-7 came installed and was able to delete it off of it.

It only is installed when there is nothing else installed on the hub, automatically. Once there is anything else, it can be removed.

That would be appreciated so that this could go away.