[Released] Basic Rules

Can we clarify -- is the Basic Rules app suppose to work with virtual switches? I've got a number of Basic Rules I setup on a new hub, many of which use a virtual switch. Most of the rules seem to execute fine, but one rule that turns off the virtual switch (based on motion detectors) crashed:
2021-04-26 10:56:45.032 am [error](http://192.168.1.64/installedapp/configure/6)java.lang.NullPointerException: null on line 1014 (doActions)
(the action was turning off the virtual switch)

Yes, it works with virtual switches. Could you show this rule, and also what build are you running?

Can you PM me your hub id? I'll take a look.

Hub build 2.2.6.140 (Rev C-7)

Basic Rule
When a:
Motion Sensor (3 selected)
Senses that: Motion has stoped and stayed inactive .. (20 mins)
Do this action: Turn off (virtual switch)
Nothing else set, except I defined my own rule name.

I sent @gopher.ny my Hub UID.

(rules) n00b question. Is it possible to speak the time of day? Can't seem to locate allowed variables. %time% just says "now". %timeofday% says "percent time of day percent." LOL

Also, any chance we'll see music devices aka Echo Speaks devices (volume control) in basic rules in addition to speech device?

I'll look into this.

3 Likes

Hi @bravenel, I've been playing with basic rule to move my simple RMs to there. Is there a plan to have multiple unique triggers in basic rule? i.e. 'When Device 1 Button 1 is pushed or Device 1 Button 1 is double tapped then this happens...' I have a few instances where I use multiple triggers for a simple turn off/on of a light. No big deal if not, all my RM rules are working fine, just asking. Thanks

Probably not. We want this app to be simple for beginners. Every additional feature is an additional place for someone to be confused.

OK, thanks for the info. It's a nice app BTW, thanks.

Is it possible to get some events from Basic Rules into Rule Machine? Especially "wait for motion has stopped and stayed inactive..." would be really helpful there.
Anothing thing, is it possible to add "Set level per mode" into Basic Rules? I see this one as basic functionality, as it's common to set dimmers to 100% during evening, but only let's say 5-15% during sleep time.
Thank you

You can already do this a multitude of ways in Rule Machine. Here is one:

Trigger event: Motion active

Actions to run:

Wait for event: Motion inactive
Wait for event: elapsed time --> 0:05:00
Log: "Motion has stayed inactive for 5 minutes. Do something now."

This may look confusing because it triggers on "motion active," but keep in mind that the primary purpose of a trigger is to make your actions run, and you can't get a "motion inactive" event without a "motion active" event first (though this does mean you'll need to wait for one of these the first time after you install this rule). Also, keep in mind that "Waits" are cancelled any time a rule re-triggers, which is why I've chosen that trigger here and used "Wait" over "Delay" for the timer--easier to not need to cancel anything.

I do see the possible appeal of somehow combining those first two actions into one (sort of a "wait for event plus elapsed time" thing, where the while thing would be cancelled as normal if both don't happen before re-triggering), but I could see that being confusing from both a UI and end user perspective, and it's only a few more clicks to get that other action with the same end result. Either way, not my call. :smiley:

2 Likes

Anyone have any luck with basic rule and valve?

Can't seem to get a rule to close/open a valve. Other capabilities working fine. Just valve.

I moved them back to RM for now until I have more time to play around.
Just want to see anyone having success with valve.

I'm trying out the Restrictions feature on a rule, and I notice two issues:

There doesn't seem to be a way to remove the restriction, once set? I'm using the "disabled by a switch" restriction.

And the red restriction identifier is not showing up next to the rule name, in the rules list,

You simply open where you setup the Restriction, and deselect the switch, so that no switch is selected.

The rules list page is not dynamic, so you may need to do a page refresh. Also, there is a small bug in Basic Rule with respect to the initialization of the restrictions. It may take one cycle of the switch that restricts turning on/off for it to show up (it will be restricted without doing this, but the display may be off). This bug will be fixed in the next release.

Ah, I was confused by how the list of switches looks like a radio button list -- which normally doesn't allow deselecting, only selecting. But this is some kind of hybrid radio-checkbox list. Cool!

I had refreshed, multiple times, and also used this rule multiple times. I'll try to check this again after the next release.

Thanks!

I went down a similar path. The thing that confused me a little the first time I did this was, when I deselected the restriction device, the only button choice was Cancel. I thought Cancel would navigate back without changing the restriction. I expected there to [also] be a Done button as there is when I add a restriction device.

Ah, that is a bug for sure. I will look into it. It should say Done.

Would it be possible to add the ability to Clone basic rules, please?

Yes, this is coming in 2.2.9 release. There will be ability to Export/Import/Clone all apps.

6 Likes

Hi @bravenel, can you also please allow a basic rule to set a dimmer level of 0. If I set a dimmer level to 0 the rule cannot be finished. When it's set to 1 or greater the rest of the rule creation appears with the optional stuff and the 'done' button. Thanks