[UPDATED] Rule Machine with Triggers

Thanks! I’ll report if it happens again.

I think there is a lack of robustness in Rule Machine when it comes to malformed rules, and backing out of things that are incomplete. It wants to show you what you entered on the main page, and evidently can step on a crack. This is very difficult to track down, because there isn’t enough evidence to go on.

If it does happen again, please try to take screenshots of whatever you can, like right as soon as it throws the error.

1 Like

I just pushed a 1 line update that should protect against this failure. There was only 1 variable unguarded in that code, but it’s not unguarded now!

2 Likes

@bravenel I have a rule that is setup to automatically lock my doors after they have been unlocked after 5 minute. However, I am noticing in the logs:

Clear
c2fa6ba2-3001-4da8-927d-3ea047eb081e 3:38:45 PM: error java.lang.NullPointerException: Cannot invoke method getAt() on null object @ line 1092
c2fa6ba2-3001-4da8-927d-3ea047eb081e 3:33:45 PM: info Delayed by 5 minutes
c2fa6ba2-3001-4da8-927d-3ea047eb081e 3:33:45 PM: info Automatically Lock The Doors!: Front Door Lock lock unlocked

Never mind @bravenel. That was an old trigger that carried over before you combined apps. I delete that rule and re-created and now it’s working.

I would appreciate any help from the community.

I have a motion detector that turns lights on with motion - I use a Smart Lighting switch for this. However, when a particular person is present, I want to be able to disable that motion detector turning on a light.

Is there any way to do this with the Rules Machine? Or any other way to have a motion detector only not turn on lights when a particular person is present (and when that person is not present, the motion detector still turns on the lights).

Thanks!!!

This could be done in Rule Machine. Give it a spin :slight_smile:

Thanks - but that answer doesn’t really help. My question was how to do it in Rules Machine if that is possible at all.

What I need is to turn OFF a Smart LIghting rule that turns lights on when a motion is detected - but when a particular person is present and there is motion, the Smart Light rule to turn on a light does NOT work and the light will NOT be turned on when that person is present. Any suggestions to essentially disable a smart light rule when a particular person is present?

I believe @bravenel has posted previously that he doesn’t have a way to integrate a Rule machine rule or trigger with existing other Smart Apps…

The proposed solution wholly in Rule Machine would do the trick, but wouldn’t run locally on a v2 hub, like Smart Lighting does.

Frankly, the only things I use Smart Lighting for are very simplistic automations with only a single condition… Even then, it’s not a guarantee of success. I just had a Smart Lighting rule with one condition (lux value) fail on me today. The light was supposed to go off after the lux value got above 150. I was standing in the room with the lux value reading of 1000 and the light was burning brightly… :frowning:

I do appreciate your suggestions and efforts. I’ll just have to figure out some other way of doing this if I can.

ST is always a challenge!

Gawd I feel dumb. I want to set up a rule that changes mode only after the door has been open for 10 minutes. If the door closes Before the 10 minutes, I want the action canceled. How do you delay an action?

You can set up a rule that has door open as its condition, sets the mode, and delays the entire rule for 10 minutes. If, at the end of 10 minutes, the door is still open, the mode changes. If during the interim the door closes, the rule will go false, which cancels the delayed mode change.

Ah. So there’s no need for a trigger with conditions?

Also, how do you use the “Complex Rule Input”?

BTW: nice work on this app. Are taking donations for this work? This is seriously a huge gain for smartThings. I feel you should get some type of compensation for this. NICE JOB!

Complex rule input is for a case where you have something A AND (B OR C). The parenthesized sub-rule is “complex rule”.

No, I’m not. Please pay it forward…

Bruce I’m using the rule machine to warn the garage door has been left open for a period of time. After a time period it sends a push message, ideally I would like to start the rule evaluation again so it checks again in the same period. It looks like you can’t cause the same rule to reevaluate, is what I’m looking to do potentially possible?

By the way this is great work

When you use “delay the effect of this rule”, you are postponing the rule evaluation until the end of that period. However, if you add a trigger for door open, then you know that the entire thing was set in motion by the door opening. It will still delay evaluating the rule, at which point if the door is still open, it sends the message. However, should the door close during the interim, the second evaluation would not happen, cancelled by the change of rule truth.

1 Like

I just installed Rule Machine and Rules. However, whenever i open Rule Machine and click on Create new Rule i get:
An unexpected error has occured… (btw… aren’t all errors unexpected?)

Im using the V2 Hub from UK.

Ok, so I’m looking for this behaviour perhaps you can suggest the way to do it.

The garage door is opened, so a contact sensor is opened. I want to know it was left open say after 30 minutes, so I get a push message saying the garage is open. (That works today with Rule machine) If the garage is left open I want to receive another reminder in 30 minutes again and that is repeated until the garage door is shut. In an ideal world it only repeats a certain number of times but that might be a step too far.

What are your thoughts?