Motion Activated Lights with Virtual Switches for Alexa Routines

Long time listener, first time caller…. I put a sensor in my kitchen, the Zooz ZSE40. I’m having some difficulty with setting it up properly. I tried Rule Machine, Simple Automation and the Motion and Mode Lighting Apps. I’m trying to do the 5 minute delay turns the light off but my kitchen appears to be possessed with every attempt I made, turning the lights off every minute or less.

I read on here that Motion and Mode Lighting Apps would be the be easiest but my problem is that the lights are only controlled through Alexa or manually. I’m also using a WallMote. Therefore I don’t have a switch that can be toglee on and then off. I have to use virtual switches that can only turn on but not off. So the long winded question is, how can I pull this off? I also only want it to turn on if the illuminance is less than 50.

Thanks in advance for anyone who may be able to help.

Welcome to the Hubitat forums!

It should be, but depends on a few things like how complex you are tying to get.

So how are the lights tied to Hubitat? What device are you using for a (presumably) smart light switch or smart bulb?

How does this factor into things now? Are you going Wallmote to Hubitat to Alexa? Or is the Wallmote just available for use?

Huh? I am not saying this in a mean or snarky way, but how do you expect it to work if there isn't some smart device that can be controlled? Or is there something but it isn't a switch? Or is it a device that does not directly pair with Hubitat? It isn't clear what you mean by that...

I don't think I understand that statement. Why can't they turn on and not off? Virtual switches have the ability to be controlled both on and off.

I would add this feature in after you get the rest sorted out. Motion Lighting has the ability to use illuminance (lux) when you have the rest of the rule working correctly.

The lights are tied through a virtual switch that triggers an Alexa Routine. I am using the driver Virtual Contact Contact Sensor with Switch by ogiewon. When motion is detected, it turns on my switch “Kitchen Lights (On)”. That switch behaves as a contact sensor so when it is turned on it tells Alexa that the “contact sensor” is opened. That then triggers an Alexa routine to turn on my kitchen lights. That virtual switch auto turns off after 5 seconds (closing the “contact sensor”) so that it can be triggered again at some later time. I then have to turn on my virtual switch “Kitchen Lights (Off)” in order for there to be a follow up Alexa routine that turns everything off.

The virtual switch driver provides two preferences, an option where you can reverse action and an option to Auto Turn Off. If there was an option to Auto Turn On then I would be able to use the Motion and Mode Lighting Apps since that app only gives you turn switch off in order to turn off the kitchen lights.

If the Motion and Mode Lighting Apps had the option to turn a switch on as a function of turning the lights off then it would work. Also, if that driver Virtual Contact Contact Sensor with Switch had an option to Auto Turn On, then that could also make this work.

When I attempted the method of turning off “Kitchen Lights (Off)”. It will turn it off but the virtual switch remains in the off status. So next time motion is inactive and my rule tells it to turn off, the virtual switch remained off so no action happens. This is what I mean when I say I don’t have a switch that can be toggled, my only options are to turn the virtual switches on.

The devices that I’m using are Lurton Caseta (not pro, therefore not connected to hubitat) and two WYZE bulbs and one Wyze plug for under cabinet lighting.

Me bringing up WallMote may not be relevant, I just mention it to provide the example that I don’t just use the Motion triggers. I use the WallMote as a manual switch. I also use Alexa in various ways to turn those lights on or off. I wanted to mention it just to provide all info. My rules for the WallMote also use that Virtual Switch driver to trigger Alexa Routines to turn these lights on and off.

You don't need the pro switches, just the pro hub...

Honestly to make things run smoother you should re do things so they're tied to hubitat directly. That said, Do what you want through simple automation app. The virtual on off contact driver will work just fine for on and off through that. Just make sure it's exposed to alexa

1 Like

I agree 100%,

It is best to connect everything you can directly to Hubitat and establish rules (either basis rules or rule machine) for everything that needs to be done.

Alexa should be used only to control those devices that cannot be controlled by Hubitat. For example, I have some Hunter Simpleconnect fans that use WiFi and cannot be controlled directly by Hubitat. Those are controlled by Alexa. There are a few WiFI devices that can be controlled by Hubitat.

The Alexa Hubitat skill can be used to allow voice control for devices linked to Hubitat. Alexa Speaks can be used to provide voice announcements.

The big advantage of Hubitat is that it operates locally. It does not require Internet access like Alexa. Amazon Web Services has experienced some recent outages that took Alexa offline, but Hubitat and all its connected devices still functioned.


Your advice to use the Simple Automation app did the trick. I set up two rules, one to turn it on then another to turn on the virtual switch that triggers the Alexa Routine to turn it all off.

Thanks for your help! I was hoping I could pull it off without having to buy other devices such as the Lutron pro hub.

1 Like

The pro hub and caseta switches are worth the investment when you're ready

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.