[UPDATED] Rule Machine with Triggers

@bravenel Got to say I really love this SmartApp! I use it now for all of my automation!

However I’m experiencing an issue where I create a Rule with an action to set dimmers to X, if I go back in to the same rule to change that value, then it wont let me change the value, I have to delete the rule and start again…

Also a potential feature request… I’m getting a little worried about the volume of rules I have and what would happen if something died and I lost all of the rules? Any idea if there is a way to backup and restore these rules? Having a look through the forums I don’t think anything exists and expect this is because it’s not possible!

We are looking at this now. But, I’m not optimistic. ST pretty much forces devices to be selected interactively by the user, as a security measure.

About your other issue with setting a dimmer, and then changing it, I haven’t seen that problem. Are you on Android?[quote=“Entityxenon, post:270, topic:31084”]
if I go back in to the same rule to change that value, then it wont let me change the value
[/quote]

What happens? I can change any of mine???

I’m on iPhone and running latest version of the code, I have the set based on movement, if movement is detected set to 15% on true and turn off after a 1 minute delay on false.

If I edit the value and it just returns back to the previous value when I press done on the iPhone keyboard, before I get to press the “done” at the rope of the screen, also if I remove the dimmer save and then re-add then the value is still there?

I’ve completely closed the app and relaunched? Can I get error reporting from the app?

I can’t reproduce anything like this.

About removing the dimmer, yea it will hang on to the previous value. I mixed feelings about that.

But, I would suggest that you remove this particular rule, and re-create it. Then report back what happens!

I’m having a bit of an issue with the initial setup and was unable to find any documentation on it.
I have setup rule machine and rules with the largest github code and left rules unpublished.
I can install the app but when I go to make a rule, after restarting the app, it doesn’t do anything. It hunks for a minute and never allows me to create a rule.
Am I missing something?

This sounds like there is something wrong with the apps in your IDE. I would recommend that you delete everything, and start over. Follow the instructions here:

Had already tried deleting and re-adding that didn’t resolve… So after a bit of trial and error… It appears it relates to having the same rule twice? I think…

So I have the exact same rule setup twice, however one it set to run only when the mode is “Night” and the other set to run in the other modes… I’ve quickly tried to add the mode as and additional condition to see if that helps but doesn’t appear to work… will take another look tomorrow to double check what I’m thinking, it’s later here in the UK…

Thanks @bravenel for all the help!

Having two rules with the same name will cause errors. The parent app (Rule Machine) uses the name of a rule to build data to support the app, indexed by rule name, hence the errors.

The rules themselves don’t have the same names, just the criteria inside them are the same. One is called “AUTO Hall Day” and the other “AUTO Hall Night”

1 Like

I tried reinstalling the app in the ide and no luck. It won’t let me create a new rule.

It’s hard to tell from here what you have done wrong. Please post a screenshot of your IDE My SmartApps page.

No idea what’s going on…

So have Version 1.6.5/1.6.8c according to the app…

Create new rule called "Hello"
Select Actions > Set these dimmers >
Select hue bulb “Living room bulb”, Track event dimmer? = N (untouched), To this level = 10
Done > Done

Saves OK

Go back in try changing to “20” press “Done”, closes and goes to previous screen no error and shows as “10”

If I change and press “Done” on the keyboard it stays on the same screen and reverts the value…

I did get an error on another error earlier on another test rule, when changing the value, but may be unrelated “Failed to save page: SelectActionsTrue”

Do you think it could relate to updating code versions and some hangover from a previous version?

I’ve also noticed that if I go in to IDE, bring up the test app there are two entries for dimLATrue = 10, no row for dimLBTrue, which I assume there should be? Is this perhaps causing the issue?

Are you on Android or iOS? It is most likely that the value was actually changed, just not displayed correctly on the higher page.

dimLBTrue has to do with the second selection of dimmers, so it missing is probably correct.

I’m on iOS…

I’ve had another play…

If I use a trigger dimLATrue appears only once in IDE and I can then change the value.

If I use a rule then dimLATrue has two entries in IDE and it wont let me amend the value in the app, shown below:

So remove that rule and start over with it. I don’t know how you managed what you did.

I get that every time I create a rule using “Set These Dimmers”… (Deleting makes no difference)

However don’t get the issue if I use “Set These Other Dimmers”, so I’ll just use that one instead, it’s a workaround I guess, but at least means I can change the values…

I am not able to reproduce this problem. I have many rules with dimmers being set, and I can change any of them. All are from Set these dimmers.

Cheers for your speedy responses, so I updated the code removing the below thinking perhaps it related to that portion of code as the only difference between A and B, created a new rule and the error didn’t appear, I then re-copied the full code and re-deployed and the error appears to have not replicated? Some bug in smart things maybe, but all working now?!

input "dimTrackTrue", "bool", title: "Track event dimmer?", required: false, submitOnChange: true if(dimTrackTrue) setActTrue("Track Dim: $dimATrue") else

Thanks again!

I’ve managed to replicate the issue, from what I thought was fixed, the issue appears to be triggered on the creation of a second rule which is the very similar, the I created the “Day” rule, movement sensor turns dimmer to 100% for 1 minute pending cancellation on false, the night rule is exactly the same but sets it to 10%, each of the rules only run in certain modes…

However removing the line I state above appears to fix the issue?

I published the rule app by accident. Is that going to be a problem? Is there any way to unpublish it without losing my rules?