Motion Lighting Resettable Timer

I've been using HA stuff since the days of X10 and have used timers, flags etc to control motion lighting, to great success even if I do say so myself but I'm new to Hubitat so I am not sure how to accomplish what I am looking to do in that platform.

And, I've failed to find a simple answer though I'm sure there is one or, hope there is.

This gets complex in how I do things as you layer this but, to be as basic as I can what I'm trying to build is a motion triggered lights on with a timer (mode/flags/virtual switch to set the lighting mode) so I would have something like the following without all the conditional stuff:

If: YYY sensor goes on
Then: Turn on XXX lamps
Start XXX timer
Else:
Reset XXX timer

In effect, this turns on the lights, starts a timer and if motion is seen again the timer reset these lights stay on. I think I've figured out most of the other simple conditions I'd need.

Separately if the timer reaches zero, the lights go off. I need to work that one out as well.

There's probably a way to do this, I'm just not seeing it or finding it as I can't find any timers as such other than ones that are fixed so, they'd just run down and do whatever when they expire.

But specific creatable timers for a specific application like this I've failed to find so any pointers I'd appreciate.

Thank you.

K.

Good questions. Most built-in apps handle the timer cancelation on their own. The Rule Machine gives you more control over how the rule handles the timer, however, for the specific use case that you highlighted, I would use Basic Rules.

Here is an example of a Basic Rule that turns a light on, when the motion activates, then off when the motion stops for 15 minutes.

If motion reactivates within the 15 minutes period, the app cancels the timer automatically, for you:

BONUS this rule only triggers between 21 minutes after sunset and 30 min before sunrise, so that the lights only come on when it's really dark outside.

https://docs.hubitat.com/index.php?title=Basic_Rules

  1. Go APPS
  2. Add Built-In App
  3. Install the Motion and Mode Lighting App

Right, that makes sense, if the sensor picks up motion again ti just resets which actually makes programming things easier in many ways.

Thanks, just trying to find my way about things and figure out how to do what I need.

K.

2 Likes

@kwatt
You may also find useful, a switch that acts like a timer, so that you can act upon it (turning on/off):

Thanks, that may well be useful.

Some of the stuff I do with timers and flags (I call them that, in effect a virtual switch) gets quite complex with different timeouts till off, scenes used and switches operating with lights as well as vice versa.

It's stuff that's been built up over more than 20 years of HA so that things "just work", so long as the controller runs, all works as intended but it does get complex at times. You can work around most things with some imaginative programming but sometimes it's just easier to do things the way you know how.

The most complex part of HA is motion lighting (IMO) as it relies on fast and accurate detection of occupancy and setting it up in such a way as it works for your own needs so you have interactions aplenty between devices, timers and so on to make it work, reliably.

Being able to stop, hold, restart or reset a timer is incredibly useful, people often underestimate the power of simple stuff like that,

I am learning with Hubitat and the bare bones of it are good though I've a few issues, especially with the dashboards (admin) to see what's going on with stuff quickly. The "dashboards" to me are not a concern as you should never have to look or interact with them, for me that's the point of HA, you shouldn't need to correct it. It should just work, always.

So, although I know this is long and likely boring, I'd use a timer to say turn on the conservatory lights as I let the dog out. Motion trips that, Sets the lights on (depending on time etc) but it also works if someone goes in there but doesn't open the door, however, if the door is opened (door sensor) it halts the timer. The timer then resumes on the door closing so the lights go off shortly after.

The reason for doing it that way is, how long will the dog be outside, who knows?

So the unknown is gotten around. It's not perfect and it's a bit "grubby" I know but, it works and works well.

K.