Temporarily change hue color on event

Here’s what I’d like to do. When a contact Sensor opens change the brightness and color of a hue bulb. Then when the contact closes, change the bulb back to the previous color and brightness. I believe the Notify with Hue app did this in the V1 version of the ST app but that’s since been depricated.

Does anyone have an app that does that or a tricky way of making that work?

You can do this with Rule Machine

You cannot technically do this with Rule Machine. You can set the colors and brightness levels when the door opens and closes but it won’t ‘remember’ what the settings were previously to the door being opened or closed. You would have to set new levels each time.

I have asked @bravenel if he could add this to Rule Machine but I’m sure he has more pressing issues. :smile:

It would be nice if smartThings supported triggering Hue Scenes. I could use a rules engine like this or the lighting app to change the color/brightness and then trigger the scene on close to reset it as an alternative. Ultimately the best solution is to set the color back to the previous settings, but triggering scenes would be a close second.

Someone modified Hue Connect to pull in the scenes too, so you might be able to use that. Not sure how well it works.

Yeah. I found that app. I tried to uninstall my Hue Connect app first and the supported hue connect app appeared to uninstall, but it’s still listed as as an app for me. Now I can’t reconfigure the supported app and the Hue reconnect app won’t save its configuration. Ugh…

It was a suggestion I made about Smart Lighting, having an option to revert back to previous state instead of just ‘off’.


Set the color and brightness you want in Smart Lighting. Then install and setup this simple little app to return to the previous color/brightness.

Reset Color on Close

Enjoy and Happy Hacking!


Hey @twack, any plans to integrate that feature into the Smart Lighting app? Not just colour and not just necessarily a contact sensor, but just the ability to ‘revert to previous state’ option on ANY Smart Lighting app would be a god send.

Thanks for that @twack. I think you’ll need to grab Hue and Saturation and include them in the setColor map. Sending color will only set the position in the color picker. At least for the Hue devicetype.

Would it be possible to have an event cue the light to both change color ( to red) and flash? For example, if the basement door is breached during nighttime hours a flashing red light would let me know this is an emergency, not just motion detected and turning on the second floor light.

1 Like

Please help… the code does not work
also the close handler is not in captital when you define it at the end