Stop the Wait

I'm a HA addict, it's been 20 minutes since I've last fiddled with my Hubitat...

I would like to have a light turn on at 16:00, or later - if there is somebody in the room. But not after 23:00.

So I have made this rule (Dutch words are edited):
image

Now I'm wondering what would happen if somebody walks into the room after 23:00...

Is there an elegant way to stop the wait at 23:00? Only way I can think of is another conditional action to only turn the light on if it's before 23:00. But I'm wondering if there's a neat way to stop the wait at 23:00. A second rule maybe?

Really trying to keep things simple here, but I always end up with really complicated rules with lots of errors...

Thank you for thinking with me here, but I would also like the light to turn on if somebody is already in the room at 16:00.

The "Somebody's_here" is a switch that turns on for 30 minutes after motion is detected on a motion sensor. So if the person is drinking coffee, or watching TV, he's still being present...

I use motion triggers and modes to do something similar.

There are two motion triggers setup with the same sensors. One of them uses a short 30 second delay and the other is more like 10 minutes. Both trigger the rule.

Then the rule evaluates the mode. Most of the time it only turns off based on the long trigger but if the mode is set to bedtime it uses the short trigger. The light levels are also adjusted based on mode.

Setup your motion rules to work as you want, then add a second rule that triggers at 16:00 and turns on the light if the motion sensor or trigger is active.

1 Like

Okay, I'm going this way now. Firing up the rule, at 16:00 and every time motion is detected. It's really a pity, because it means that my rule will have to be evaluated by the Hubitat, every time there is motion (and every 10 seconds of motion) all day and night...

It would be nice if there was a "Wait for events until %time%" option :slight_smile:

The sensor is going to send those triggers to HE regardless of the rule and HE will have to process it. You really aren't adding any significant load to the hub.

Currently I have four motion sensors in the both the living room and kitchen, one in each bathroom, hallway and bedroom. My hub hasn't burst into flames yet. :wink:

2 Likes

I've changed my rule to start with a "Cancel Wait" and I've added a trigger at 23:01.

Not sure you need the "Cancel Wait." Any time a trigger matches, any pending Waits get canceled anyway.

1 Like

Here's an idea you may consider. This is a way I prevent turning off lights in a room, when a household member is sitting essentially motionless in it.

While not instantaneous, it suits my needs nicely, so I share it as an option to consider. It doesn't cure cancer or provide world peace, always. My 1/2 and I co-exist with our respective cell phone essentially strapped to our hip. It necessitates buy-in to Bryan's @bptworld excellent Life360 with states.

That said, in a former life in a sand box far away, I had boots on the ground reason to use Loran time differences. To KISS that, we munged known lat & long absolute values, because a simple difference between two munged values indicates a relative distance between. Excuse me for getting all nautical on ya, a.k.a., pay no attention to the goof behind the curtain. This works.

134.02679 represents my iPhone at my dining room table. 134.026618 is my wife's communicator near the kitchen. You would use applicable values for the location of your choice via Bryan's Life360 device value. In my corner of the world, longitude is negative and RM has no absolute value function, so I subtract it from my latitude to add it.

Hope it helps.

1 Like

I really enjoyed your post! Thank you. I still have to figure out what your rule does exactly. I will also test the accuracy of our non-apple phones with Life360.

Unfortunately we live in The Netherlands. Houses here are all multiple storeys (four in our case), I'll have to add a height variable to the mix...

In your first posts, you said you wanted the light to turn on at 1600 when someone was present in the room. IRL, someone may be in the room but not moving -- a "feature" motion detection regularly misses.

I use rules that alternate trigger on cellphone battery decrease and power source change (also Life360 related. We religiously plug our respective phone in to charge when we go to bed, hence the Asleep_Rob/Lori for automating security features when we're both in bed, for whatever reasons... Rolls eyes ).

In a perfect world this would fire at or within 2 minutes of the event. Reality is it can take up to 4 minutes, should you have my kind of luck.

The idea is, this "works" independently of your current rule, but you could use a better named bassackwards NotNearRob/Lori boolean to turn on the light in the room 1600-2300 when it applies. FWIW, 1.0E-4 is roughly 10m.

I regret not visiting your country. Got to all your neighbors via vijf REFORGERs in the 80's. Too many crazy memories packaging and putting my birds on ROROs in Bremerhaven with that. I had twee Warrants from the Netherlands who got their citizenship on this side of the pond who loved teasing me how different your language and southern German is from the "high" German I learned in school. At least we could agree on elf. Good people!

The AGL (above ground level) bit is an issue. We'll have to ask Bruce for a current barometric pressure variable to fix that. LOL. In my case, the key rooms (bedroom, kitchen area, recreation room, and dining room) are in vertical positions where that does not apply for me. Like I said, this concept doesn't cure all, always, but is an option to consider.

Tot ziens!