Motion/Switch/Light Help

Hi All -- this is my first post here and looking for how some of you would solve my problem.

I have an Inovelli LZW36 fan/light switch. I have turned off the physical relay to the lights so that I have continuous power to the zigbee smart bulbs in the fan. I also have a generic zigbee motion sensor in the room. I'd like to be able to turn the lights off and on via the physical switch on the LZW36, but also have the bulbs turn off if there's no motion in the room after 20 minutes. I'm sure I can accomplish this via Rule Machine with simple logic, but I'm struggling with how to accomplish this in either the Motion Lighting App or the Simple Automation Rules App.

Specifically, I'm not sure how to have the inactivity event change the state of the LZW36 and the bulbs so that the inactivity trigger doesn't just toggle the lights off and on with each successive 20 minutes of inactivity. If I turn off the bulbs via the motion sensor, then the LZW36 will require two taps to turn the light on because it doesn't know it's already off.

I suspect I might be able to implement a virtual switch to solve this problem, but I'm new to Hubitat and home automation in general, so I just don't intuitively understand this stuff yet. I searched around quite a bit and didn't find anything posted already that helped me solve my problem, but I'm sure I could have missed it. Thank you in advance for any help y'all can provide!

I would consider this as two different automations, unless I'm missing something that you want to do. Also, it's important to note that at this point (i.e., with local control disabled), the light portion of the LZW36 is basically just a button controller device--not a switch anymore. So what you really want to do is manipulate the Zigbee lights in response to motion in the room or taps on the switch; you don't want to actually turn off the switch (cutting power to the load), which--unless you disable remote control as well--is still possible via Z-Wave (e.g., your hub). This also applies to any other ways you might want to manipulate the lights, like Alexa/Google Home or other integrations--use the lights, not the LZW36.

Back to the automations, for motion, the built-in Motion Lighting app can handle this. Basic Rule or Simple Automation Rules could also do it, but Motion Lighting probably has the most options. You could certainly use a Rule, too, but there's no reason to--and it's much harder to set up (and requires learning RM if you aren't familiar already)--if the other apps can handle your needs. It should be fairly intuitive to set up if you haven't already. The Motion Lighting app also has a "Buttons to toggle on/off" option that you can use (just specify the button number; this may vary depending on what driver you're using, but you should be able to check the event history to see for sure). This will turn the lights off if they're on or vice versa in response to this button-pushed event.

For the button press, another option the Button Controller app. A Rule triggered by the button event could also work and isn't too hard to set up (all the options you'd need to use after this are the same; they share a lot of code). The key here is to use one of the "toggle" actions, which will turn the lights off if they are currently on or turn them on if off. For example, if you choose Set Dimmers and Bulbs > Toggle Color Temperature and Level (and specify something like 2700 at 100%), then a press of this button will turn the lights on to those settings (warm white at 100% if you do that) if they're currently off, or it will turn them off if they're on. But since Motion Lighting has that option built in, you probably don't need to go this route unless you want something more advanced (like setting the CT as I'm doing in this example).


Thank you so much for your reply! I'll spend some time with this and see if I can get it working the way I want with the help you provided. I really appreciate it!

1 Like

One other option you may want to consider, which I use, is the option in Motion Lighting at the bottom of the main configuration screen, with the phrase "Control with Alexa or Google Home using this name", with your answer used to name a dimmer device that will be created automatically for you. When you turn this dimmer device on it activates the rule if it is not already active. Turning it on will also stop the motion lighting rule from turning everything off, even if it has already been triggered. The reason I like to use this is for providing manual control in a room / situation where I know I may not trigger motion often enough or for some other reason I want the lights to remain on.

To achieve this I use Hue Dimmers to turn this Alexa Dimmer on whenever I press the On, Dim Up or Dim Down buttons, then turn the Alexa Dimmer off (as well as the lights) when I press the Off button, returning the room to motion-based lighting. The interaction between the Hue Dimmer and Alexa Dimmer is handled in a Button Controller Child App. Obviously other rules can / do act on this Alexa Dimmer as well, such as mode changes, etc.

1 Like

Thank you bertabcd1234 and sburke781 for your help. I got it working like I wanted. Again, I really appreciate both of your willingness to help out a noob!

1 Like