Rule machine - as per the app developer, this app is no longer available for new installs, distribution, or support

@bravenel

I followed the instructions above, but when I pressed Done, I got the error message,
“An unexpected error occurred.”.

I assume I have waited too long since I posted that, and there is something else I need to do now that I’m missing.

Ideas?

There is a major new release of Rule Machine today, as I have suggested was coming. Version 1.5 of Rule, and Version 1.3 of Rule Machine.

Triggers are now fully integrated into Rules!

In the previous version of Rule Machine, you had the choice of creating either Rules or Triggers. That choice continues, but in a new form. Now, a Rule can have Triggers as part of its logic flow.

If you create a Rule that has Triggers, the Rule will ONLY be evaluated when one of the Triggers fires. Then, the Rule evaluation proceeds as before, testing the Conditions with the logic of the Rule. If the Rule is true, Actions for True are done and if false, Actions for False are done. The big difference with this option is that the Rule is evaluated upon a Trigger firing, and the previous Rule truth doesn’t matter in deciding to take the Actions.

If you create a Rule without any Triggers, which is exactly what Rules were before, they behave just as before. Every event in your system that affects the Conditions causes the Rule to be evaluated. As before, if the Rule becomes true after having been false, the Actions for True are done, and if it become false after having been true, the Actions for False are done. Only a change in Rule truth results in action.

Again:

  • A Rule with Triggers is evaluated when the Trigger fires, and Actions are taken based on rule truth.
  • A Rule without Triggers is evaluated when any Condition changes, and Actions are taken upon rule truth change.

To create a stand alone Trigger, simply omit Conditions (and by inference, the Rule). This will act just like the old Triggers.

Another way to understand it:

  • Triggers and Conditions are optional
  • Triggers omitted, is a Rule.
  • Conditions omitted, is a Trigger.
  • Having both means a Rule caused by a Trigger.

The More Options section at the bottom of the main page now allows the normal restrictions on the Rule running: Time of Day, Days of Week, and Mode. If a Rule is restricted or disabled, it will not evaluate the rule nor take actions.

New Automations are now possible

Here is a example of an automation that is now possible with Rule Machine:

Suppose I want the front porch light to turn on when someone arrives home after dark, and then to turn off 5 minutes later, unless it was already on, in which case don’t turn it off.

Triggers: anyone arrives; Conditions: porch light is off; Rule: porch light is off; Actions for true: turn on the light, turn off the light after 5. The rule is Time of Day restricted to only run between sunset and sunrise, in More Options. This could instead be done with an additional condition.

When someone arrives, the Trigger causes the rule to be evaluated. If the light is off, turn it on (with 5 minute delayed off); if it is on, do nothing.

Old Automations still work

If you already have Rules and Triggers defined, they will still work exactly the same way as before in the new version. The old ones cannot be extended to the new capability, but can be edited. To get a Rule with Triggers, one creates a new Rule.

How to Update

Install the new release of Rule from the Github file: https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/rule.src/rule.groovy. Save this in your IDE, but do not publish.

Install the new release of Rule Machine from the Github file: https://github.com/bravenel/Rule-Trigger/blob/master/smartapps/bravenel/rule-machine.src/rule-machine.groovy. Save in your IDE and Publish for me. This step is optional as only a cosmetic change was made.

As with any major release, bugs are certainly a possibility. Even with extensive testing, you may find something I broke. Please report these so I can fix them!!

7 Likes

Noticed with last version, and is still present with the update: when clicking ‘Done’ when in inside a Rule results in being kicked out of Rule Machine all together, back to the list of installed Smart Apps… on Android

I cannot reproduce this on my Android device running mobile app 2.0.5. When I click Done on the Rule main page, it takes me back to the Rule Machine page with the list of Rules I have.

I can second this as well. Smartlighting has also started doing this too. It has to be something with android on the back end. Mayb its only affecting certain versions of the android os, I’m on 5.0 with the latest version of the app.

1 Like

It does the same thing for me as @Toasty . On an LG G4 on 5.1

Clicking Done within a Rule acts the same as clicking Done on the main Rule Machine page, kicking you back to the SmartApps list. This occurs when edited existing Rules and creating new ones. Not a critical issue though.

EDIT: Pulled out the iPhone 5S and it does not do this

EDIT 2: Just noticed there is a 2.0.6 so that might be why… I’m on 2.0.6 for Android.

I’m on 2.0.6 also and I thought this was normal behavior until I read the posts above. :blush:

This is not an issue with rm, Android has been doing this for all smartapps since the 2.0.6 “update”

2 Likes

This is funny. I bought an Android tablet so I could see these issues with RM. But, such a noob, I don’t know how to update SmartThings on it. So I didn’t get 2.0.6. Oh well…

Other than being a PIA, this shouldn’t matter.

2 Likes

Agreed.
Just a minor annoyance. Nothing on your end though.

Thanks ST!

Not sure the cause, but I upgraded to the latest Rule code here while watching a movie, and got up to get something and one of my rules that was restricted to AWAY went off turning some things on. Went to the rule, the previously defined restriction was gone.

No biggie, but not sure if anyone else noticed something similar. I am going to check my mode restrictions on other rules, etc.

Edit: Seems the only other rule I had setup with a mode restriction also had the defined mode missing post upgrade.

Hmmm… Not sure…

if it helps, the ones that seemingly lost the mode restrictions were ‘Triggers’ previous to the upgrade…

I only have two such items, both appear to have lost that part of the config. Be glad to provide any information you may find helpful. Not sure it’s an issue though, since I am the only one pissing and moaning. :cold_sweat:

Thanks for clarifying. I was looking at Rules, and they work correctly. I will double check old Triggers… They look OK also. Hmmm. Not sure. I’m always forgetting to put restrictions in myself when I redo something…

@bravenel All of my mode restrictions were retained. I didn’t have the issue that @JH1 reported. I do have two triggers that give me an error though when I try to click on them to make an edit. “You are not authorized to perform the requested operation” This did not happen prior to the update. Live logging shows " java.lang.NullPointerException: Cannot invoke method size() on null object @ line 402" when trying to open the trigger.

That’s weird! I can’t get mine to fail that way. All of my old Triggers are fine, can be edited, etc.

Do you know what the trigger events were in the one that threw the line 402 error?

There are two. It looks like the commonality may be ‘Delay the rule action’
If I remember correctly they are
1).
Trigger: Mode changes to ‘Alarm Triggered’
Action: Press virtual buttion
Delay Rule action by 1 minute

Trigger: Mode changes to “Away Armed Pending”.
Action: Change mode to “Away Armed”, Turn off these switches after a delay (2 minutes)
Delay rule action by 1 minute

I sent you a Private Message. Please look at that…

I sent you the screen shot of one of the Triggers settings.

I found the bug and fixed it. Pushed the fix to Github…

Thanks for reporting the bug!!

That fixed it. Thanks

1 Like