Help with Lights

Is there a way to have a light turn a certain color and brightness, when a contact sensor opens, but then return to it's previous state when the sensor closes?

I currently will turn my living room lights on, and when the front door opens, the light will turn to a different color while the door is open. Then when the door closes, the lights turn off. I'm wondering if they could just go back to the previous color or back to off, whatever setting it was on. I'm currently using Basic Rules, but am hoping Rule Machine has more advanced features. Thank you!

Yes, use the "Capture" and "Restore" actions. You can "import" your existing Basic Rule into Rule Machine to avoid having to re-create it, though it would be pretty simple (if you're familiar with Rule Machine--this will save you some of the first steps) to create either way.

As you can probably assume, you'll want to add a Capture action towards the beginning of the rule, some time before you set the lights to their new states. Then, instead of turning off, you'll want to use the "Restore" action.

4 Likes

I'm really struggling to figure this out. I'm picking Restore as a separate Rule, and it just shows as Null, it won't let me pick a device.

You have to restore in the same rule, as this storage is per-rule.

Ok, I fixed that part now. Thank you!

But now, the light only flashes the purple color for 1 second, then restores, while the door is still open. Is it possible for it to remain purple the whole time the door is open, then change back to whatever previous color or state it was in, once the door closes?

Add a wait for event before the restore. The event should be the contact closing. This way your rule would not continue until the contact gets closed.

Alright, added the wait. But the light still only flashes purple, doesn't remain purple whole open.

Try modifying the wait to a “wait and stays”. For instance, a stay of 15 seconds would require the contact to be closed for 15 seconds before moving on in the rule.

I'm think we're misunderstanding each other, lol!

Ok, so currently the light is On and white. When the door sensor opens, it flashes the purple color that's selected, and immediately goes back to white, even with the door still open. I close the door 10 seconds later, and it then goes to purple.

I'm wanting the light to be any color or state I choose, while the door is closed, then change to purple and remain purple whole the door is open, then return to the previous state when the door closes.

Check the "Events" button/tab on the device detail page for your light to see if something else might be changing it away from purple. You can also check general "Logs," but that would depend on having logging enabled for such an app (whereas Events will show you not just events but commands that were sent--what you're really looking for, type "command" in the list--and where they came from).

Just a guess, but this will tell you for sure.

So I removed the "Turn Light On" and left the "Set color to..." command. That fixed the light from flashing. So it now stays purple when the door is opened, but... it doesn't go back to white (or previous state/color) when the door closes.

I checked to see if anything else is messing with the light, and there isn't sadly.

What type of bulb are you using?

Sengled Element Color Plus

A few things could be going on here, but the best thing to do would be to share a screenshot of your new rule plus the output of "Logs" filtered to just this rule -- just to make sure the rule is really doing what you intended.

If that's not it, the next steps would be to look at the device detail page for your Sengled bulb right before the capture, specifically, the values up in "Current States." If those are wrong, RM can't know any better and will also capture the "wrong" values, so your restore won't work as expected. There could be various fixes for that, but I'd start by running the "Configure" command on that device to see if it helps.

Well..... first thing I did was just "Configure" the device, and that fixed all the problems. LOL!!! Not quite sure how that fixed it, when it had been configured before, many months ago.

Could I possibly have to configure the bulb every few months or so...?

Also, thank you to everyone who helped!!!! You all are awesome!!!!

Not unless you reset the device. It should be done (automatically) once on pairing if it found the right driver, otherwise it's a good idea to run it once after switching drivers. Glad you got it figured out!

2 Likes

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