How would you guys handle this lighting automation?

My wife has requested a simple addition to our automations. We primarily use HD+ and Google Home to control our smart devices. I have some simple timer automations setup and some buttons setup.

My wife wants our interior garage lights to turn on when she opens the interior door to enter the garage.

Right now, I have a Zooz Switch controlling the base lights in the garage. Single tap turns up/down turns them off/on. Double tap up/down turns the base lights and shop lights on/off. Shop lights are connected to a smart plug.

I have a window/door sensor that I can use to tell when the door is opened. For our purposes, I am fine with the lights turning on whenever the door opens.

A minor improvement I would like to add is:

  1. If when the interior garage lights are off and they are turned on due to the door opening, it triggers a timer to turn off the lights after X time (in case we forgot to turn them off).

  2. If the lights were already on when the door/window sensor trips, nothing happens.

  3. If we use Google or the physical switch to turn the lights on/off, the timer action to turn the lights off is canceled.

I haven't gotten into the more advanced automations. I haven't tried Rule Machine yet.

My question for you guys, how would you handle the automations and conditions above? I'm just looking to use this as an opportunity to do more (and learn more) with Hubitat.

I believe I have almost everything working as much as possible. The only thing I haven't figured out is if we use Google to turn on the lights AFTER the shutoff time has started, I want to cancel the shutoff timer.

Posting a screenshot of what you have for the rule now will help folks suggest possible improvements.

Anyone please correct me if I'm wrong here, but there's nothing particularly special about an action coming in via Google (or Alexa or Siri). As far as Hubitat is concerned, that's just considered a digital (i.e. not physical) action, like most other actions.

Here's what I have done between using Rule Machine, Simple Automation, and Button Controllers.

IF the garage lights are off AND door contact opens, garage lights turn on. Garage lights turn off automatically after 20 seconds (short time for testing).

During the timer period, if we push the physical garage light switch on or tell Google to turn those lights on, the timer is canceled and the lights stay on.

During the timer period, if we use the Google Home android app or HD+ app to turn the lights off, the timer is canceled.

Everything works as expected. I'd like to reset the timer if the timer is still running and the door contact opens again.

I'm not sure how or if I can test those conditions though... I'll post screenshots after this.




In your second screenshot you've created a condition but I don't see where you've used it anywhere. If you want to make it a required condition you need to turn on the toggle for 'use required expression' and select it there.

Is this an older version of rule machine? I've used 'cancel delayed actions' but never noticed 'cancel timed actions' when using RM 5.

Somehow my second screenshot was wrong. I had to fix it. I've uploaded the correct screenshot.

The screenshots are not all from Rule Manager. I am using Rule Machine, Button Controllers (for the physical Zooz switch), and Simple Automation Rules for controlling the virtual switch tied to Google Home use.

The button controller is where you see the cancel delayed actions.

My suggestion would be to simplify the requirements, and try to remove the 'manual' portions.

Here is my garage lights RM Rule. It is pretty simple and has been working for years, without any complaints from the family.

Essentially, is any of the doors to the garage are open, or there is motion in the garage, the lights stay on. Once all doors are closed AND there is no motion, and 5 minutes have elapsed, turn off the lights.

This has worked so well, I cannot imagine ever needing to make a change. It does properly handle the case where someone opens a door or manually turns off the lights before the 5 minute wait has elapsed. If that happens, everything is canceled once any of the triggers fires again, and the lights turn back on (or stay on, if not manually turned off.)

It is possible that this Rule could be rewritten in the Room Lighting app, which was released years after I wrote this rule. Since it works so well, there is no need to change it now. :wink:

Good luck and I hope you find a solution that meets your requirements. Personally, my goal was to automate as much lighting in the house as possible, without making it annoying to the family. I never took away any manual or voice control from them. However, once I had enough motion sensors and door/window sensors in place to perform the automations, they never bothered to touch a light switch again. I also learned quickly that some rooms, like bedrooms, are too difficult to attempt automating everything. There are just too many edge cases to try to deal with. In those areas, I do make sure there is an Amazon Echo device, as well as Pico remotes on the nightstands, in every bedroom. The Pico remotes allow bedside control without needing to talk to Alexa and wake up others in the room. :wink:

You need to re-write your rule that turns on the light and remove the conditional trigger. Just do the following:

Trigger:
contact opens

Actions:
Turn on lights
Wait for event - elapsed time
Turn off lights

Your wait would be cancelled and rescheduled every time the contact opens. You’ll tell your lights to turn on again, but that wouldn’t hurt anything.

If you did not want to send the On command again, you could turn that action to a simple conditional (if lights off, then turn on lights). Going this way would only send the On command once but still reschedule your wait command.

2 Likes

Good idea from @JB10 above: I'd only add that for the "Turn on lights" command, you can use the "only command if off" option -- I'm going from memory for that exact verbiage, but that option will be available to use on the same page you set up the Turn On command.

1 Like