How to set up a rule to trigger after a certain period of time

I've been digging through the forums, and haven't found a direct answer to this....

Here's what I'm trying to do. I have some short-term (VRBO, AirBNB, etc.) rental properties, and have been putting automation on everything.

Right now I'm trying to figure out how to write a rule to automatically put my home into AWAY mode when there's been no activity for a specific period of time (24 hours). I have a combination of motion and door sensors I want to work with.

Essentially what I'm trying to solve is when my house is vacant for a period of time, to automatically trigger AWAY mode. And then when activity is detected, automatically put it back into DAY/NIGHT mode.

Any pointers are apreciated!

Setup your triggers, motion whatever.

Then use a wait for elapsed time 24 hours as the first action. Then set mode to away.

Anytime there is a triggered the timer will start again. Basically two lines in RM

[edit] You can use two rules that are the same but make the predicate for one when in home mode and the other when in away mode. One sets it back to home one sets it to away.

1 Like

So, this makes perfect sense. So now, just to understand the behavior....

If the same activity is detected again (i.e. - motion sensor) will it effectively re-trigger and reset the timer?

1 Like

Yes, another trigger event cancel's the Wait. So it starts another one. Mode would be set to Away 24 hours after the last motion event.

1 Like

We also have a short-term rental (my previous house) that we're just about to put on the market. I already have some automation there, mostly lights, locks and thermostat control.

I've been thinking about what else I can or should automate, for example monitoring the power to the hot tub in case the breaker trips. Without the ozone generator running, it could turn nasty.

Anyhow, for a case like yours, perhaps it would be better if you tied your away mode into your rental calendar? Or in addition to your motion and door sensors?

If your property isn't rented for some period, you'd likely still have some amount of activity (cleaning people, etc.) but once there's no activity and it's going to be vacant for some period of time, you might want to set the thermostat higher (or lower) than normal, turn the water off, etc. But if you have an upcoming rental, you'd probably want to set the thermostat back to a normal temp if an upcoming rental is within a certain amount of time, so the temp was normal by arrival time.

I've also toyed around with the idea of automatically setting the door and alarm codes and wifi password automatically, based on something. Not sure what, maybe a database I set up myself if there isn't any API into Airbnb and other sites. I think there's lots of opportunities for home automation in a vacation rental.

1 Like

So, based on the feedback, I've implemented my initial solution.

First, I've got everything based on Modes. I'm pretty simple in that setup, I have only three modes, Away, Day and Night.

I then set up a rule, that detects activity

I've used a couple of hub variables to help control everything. Both are booleans, Home_Activity and Activity_Paused Home_Activity drives some triggers that set the current mode. Activity_Paused drives another trigger that un-pauses this rule. The key here is, to keep things from constantly triggering when someone is in the house.

So by starting the script with a cancel timed action, it resets the delay which resets the Home_Activity variable to False. Then I have a conditional so that I'm not constantly resetting the Home_Activity variable, avoiding unnecessary triggering of other rules. At the end I pause this rule so that it doesn't keep triggering over and over again when someone is in the house.

The next rule is how I un-pause things.

This rule un-pauses the previous rule. It triggers off the Activity_Pause variable and essentially waits 10 minutes before unpausing the prior rule.

Thanks to the comments given earlier, and other articles I've read as I get more engaged in automation on my Hubitat.

1 Like

Download the Hubitat app