Delay trigger in case state changes for door sensor

I recently purchased a smartthings and regret that I did due to the severe limitations!

I want to create an automation so that if my door is opened and stays open for 60 seconds that the outlet that my AC unit is plugged into will be turned off.

If the door is closed before the 60 seconds though I want the automation to cancel. This was a failed attempt with smartrules which would never execute on smartthings. Also many of the z-wave devices are cloud only on smartthings which drives me nuts when internet issues arise.

Welcome to Hubitat!

That's trivial in Hubitat's Rule Machine... :wink:

Here an example...

1 Like

https://drive.google.com/file/d/1XxUIoGw7YNRLpyj7W8B6brzPp8wogJxU/view?usp=sharing

You may want to Be careful with your rule. If your door is opened and closed 5 times within 15 minutes (each over a minute in length), then your AC could be damaged.

Home automation is great until something g gets broken :wink:

1 Like

Are you writing a rule for Hubitat? That interface doesn't look like Rule Machine to me.

That looks like the 3rd party iOS SmartRules application. Obviously that’s not going to work in Hubitat.

Have you bought a Hubitat Elevation hub yet to replace your ST hub yet?

The picture I included in the link was just to give an example. I have since removed that program that did not work and gave me grief for more than 2 hours staring at plugs and wondering if they were going to turn off! :grin:

I have also ordered my Hubitat which will be delivered by Amazon tomorrow.

I appreciate the concern with regards to the AC. I can also increase it to 5 Min. The door is to my office in my yard and is not opened very often. The problem is when one of my kids opens it and then leaves it open.

Thank you everyone for the support!

1 Like

You can also add a notification to that. This would allow you to receive either a text, Pushever to your phone or to the speaking device of your choice (some additional work may be involved).

1 Like

So I created a rule. Besides the times which I shortened for testing does this look correct?

If door is open for a set amount of time turn off Outlet. If door is closed turn outlet back on.2019-07-01%2022_13_16-Office%20AC%20%5Btrue%5D

Looks reasonable to me.

You don't have a cancel on truth change for the true delay. This means us the door is open and switch is off, you close the door and reopen it immediately, the switch will turn on 10 seconds later and be on for 50 seconds.

Ryan thank you for responding. Not sure what you mean as I am new to this process.

My experience is as such with this setup.

If I open the door for a few seconds and then close, the zen15 does not shut off.
If I open the door for more than 1 minute the Zen15 does shut off after 1 minute.
If I close the door the zen15 turns back on after 10 second delay.

And that is not what you want to have happen?

What I am saying is, if you want the device to stay off when you momentarily CLOSE the door, you also need a cancel on truth change for the 10 second wait for the true part of your rule. Without the added cancel, if the door was open and your zen 15 was off and you momentarily close the door and reopen it, after 10 seconds the zen15 would turn on, even though the door was open. Then 50 seconds later it would shut off again. But it would turn on and then off it the door was open and momentarily closed, If you add a cancel to the delay on the truth change for the True action (turning it on) that will prevent that from happening.

2 Likes

ok thanks I need time to digest this. :grin: Thanks for the explanation. This is my first real home automation experience so I have never had to deal with this logic or scenarios.

I got it now! Thank you!

2 Likes

So do I have to delete the automation and re-create from scratch? Having issues trying to edit.

Could not figure out how to edit existing so recreated.2019-07-02%2018_48_56-Office%20AC%20%5Btrue%5D

1 Like

Oops first should be closed and not open. One little error and it all goes to hell. :grin:

Now really fustrated. Not sure if this is a bug but I cannot get the rule to say True. Only false no matter what I click. Maybe it is a bug?

When I create a new condition for Door Sensor closed it defaults to false every time. If I choose Not this it shows True. I did an upgrade so not sure if something has changed but I cannot replicate the True without the NOT2019-07-02%2019_28_19-Office%20AC%20%5Btrue%5D

Well, your first rule looked at OPEN and your new one looks for CLOSED. That's why they are opposite. NOT closed = OPEN and NOT OPEN = Closed.