New to Hubitat. Need help with simple Lights on/off on motion

Hey There
So I successfully setup my new Automation. I have a Yeelight Bulb and a Xiaomi sensor. I added them to the Hub and I have setup an automation to turn on the light when motion is detected and turn if off when there is no motion. But the problem is when I Physically turn off the light switch and then turn it back on, the automation breaks. I have to turn off the light from Hubitat to make the automation work. So how do I stop this from happening?

Screenshots of this automation? Are you using Rule Machine, Basic Rules, Motion Lighting, or what? It is hard to tell what to suggest if we don't know what you have setup.

This is normal behaviour. The only bulbs that preserve their on/off state when power is removed (ie you turn off at the power switch) are Sengleds and Hue bulbs (when connected to a hue bridge).

1 Like

Have you considered replacing the smart bulb with a dumb one and instead using a smart switch? An HE-compatible smart switch can then be used to turn on or off the light manually or from HE. If you are US-based, the Lutron Caseta combination of smart switches and their PRO series hub are an excellent (though expensive) choice.

1 Like

This is my automation. What shall I do to not break it every time someone turns off the light switch?

Unfortunately you've run into a limitation of most smart bulbs. Namely, if you regularly turn the power off to the bulb at the switch, you won't be able to continue using it with Hubitat as expected.

In addition to what @rocketwiz and @brad5 mentioned as alternatives, if you're set on continuing to us this particular bulb, you'll have to stop people in your household from flipping the switch that controls power to the bulb.


In the one location I actually have a dumb switch connected to smart bulbs I use these...


Yup I have used something similar before.

Another option is to remove the switch entirely, connect the line and load wires together so the bulb is always on, and install a Lutron Pico where the switch used to be. If anything goes wrong with Hubitat though, you lose the ability to control the bulb at all with this option.

1 Like


1 Like

Can you elaborate?

Put enough epoxy on the toggle switch, let it harden, and no one will be able to turn it off.

You must have a very easygoing spouse :wink:.