Help with Rule Machine

UPDATE: solved with exit rule and a second resume if statement.

Still willing to hear others suggestions though.

Hey guys and gals,

I need some assistance; I am coming from WebCore and was able to achieve this with that. I have been working on different methods for a week now and still cant get it to work.

What I am trying to do

I am trying to get my Ring camera once detects motion depending on the mode to send it from TTS to my google devices. This part I was able to do through virtual devices and hub link.

The problem
I dont want it to broadcast when my wife goes out to smoke so I want it to end the rule but since the triggers reset the rule on motion or front door open its resetting and completing the first IF statement.

Any suggestions?

IF (Ring Motion active(F) AND
Front Door Sensor closed(T) AND
NOT Mode in Evening, Night(T) [FALSE]) THEN
Set VarLivingRoom to Living room volume
Set Volume on Office speaker, Kitchen Wifi, Living room to 100
Delay 0:00:01
Speak on Office speaker, Kitchen Wifi, Living room: 'Ring Has Detected Motion'
On: Door Alarm
Delay 0:00:03
Set Volume on Office speaker, Kitchen Wifi, Living room to VarLivingRoom(50)

ELSE-IF (Ring Motion active(F) AND
Front Door Sensor closed(T) AND
Mode is Evening(F) [FALSE]) THEN
Set VarLivingRoom to Living room volume
Set Volume on Office speaker, Living room to 80
Delay 0:00:01
Speak on Office speaker, Living room: 'Ring Has Detected Motion'
On: Door Alarm
Delay 0:00:03
Set Volume on Office speaker, Living room to VarLivingRoom(50)

ELSE-IF (Ring Motion(off) is on(F) AND
Front Door Sensor closed(T) AND
Mode is Night(F) OR
Living Room Light(on) is off(F) AND
Mode is Night(F) AND
Front Door Sensor closed(T) [FALSE]) THEN
Speak on Office speaker: 'Ring Has Detected Motion'
Delay 0:00:03
On: Night: Door Alarm
Delay 0:00:03

ELSE-IF (Front Door Sensor open(F) [FALSE]) THEN
Wait for condition: Front Door Sensor closed TRUE --> timeout: 0:05:00
Delay 0:00:45
Wait for condition: Front Door Sensor open FALSE --> timeout: 0:10:00
Off: Outside Light
END-IF

How do you know your wife has gone out to smoke and it isn't just regular motion? How are you distinguishing between the two instances?

I can tell you, a rule this long just to do a TTS announcement...if all your rules end up this complicated your hub is going to be brought down to a crawl very quickly. This isn't SmartThings where you have unlimited cloud computing power to process your pistons. You have to be a little more selective and surgical. We don't want the Rube Goldberg method, we wanna be clean and efficient.

2 Likes

Because I can physically see her open the door to go smoke.

That's unfortunate to hear is there a way I can use a local server to send the functions and rules to the hub to take the load off?

My plan is home automation not just something that I can control with a app on my phone or I would have stuck with smartthings.

I currently have 20 motion sensors
Another 10 door sensors
20 switches/lights
Planning on getting locks and other sensors including going to automate my on site office building that will add probably 20 to 30 more different devices.

So if hubitat cant handle complex rules do you have a suggestion of a hub or system that will?

I want 100% automation with no user input.

But how will the hub know that? You'rte asking the system to do something for you. The system has to have a way of knowing the difference between the two events, right?

1 Like

That's what the ending part of the rule would be

If the door is open then end

ELSE-IF (Front Door Sensor open(F) [FALSE]) THEN
Wait for condition: Front Door Sensor closed TRUE --> timeout: 0:05:00
Delay 0:00:45
Wait for condition: Front Door Sensor open FALSE --> timeout: 0:10:00
Off: Outside Light
END-IF

Yes...but what is the trigger for the rule? In order for the rule to be effective, you have to think about it in terms of what the trigger event will be. If you are triggering on the motion sensor being active, that only works if the motion sensor is trigger after the front door and if the front door is left open when your wife goes outside.

And the rule isn't working, correct? That's why you posted, correct? So, I don't understand why you say "but this part of the rule". The rule isn't working.

Another thing that you are forgetting is that the rule will re-trigger if motion goes active again after a timeout. So, if your wife isn't moving constantly enough to trip the motion sensor the whole time she is outside, the sensor will trip again while the door is closed causing actions to not follow that part of the rule. The only reliable way to do that is to have something that is indelible until your wife comes back in. Something that doesn't rely on the sequence of events to know that condition is true.

1 Like

So how would I accomplish this?

You have to tell me. How would you know that your wife has gone out for a cigarette? Does she turn on a light inside the house first? Does she press a button? Do you have a smart lock? The number of possibilities is endless. Otherwise you could just live with the announcement and put a timeout into the rule to only get the announcement once every 6 minutes. So, you would only get it once when she goes outside.

By the front door sensor being opened like I currently have it. That's the only way I could think of.

The motion sensor is what gives me the alerts that there is motion.

I want the rule to pause tts if the front door opens then to wait for the door to be opened again and resume if it is closed the 2nd time.

Since this rule is over complicated would it be better to break the rule up into day evening and night then have the front door sensor to pause those rules and wait for the conditions for it to pause those rules?

Spilt it into 4 different rules seems to work.

I will be looking for other local solutions then hubitat ones that can handle complex else if statements on a local server.

Thank you for your help

Marking this as solved

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.