Change light strip to red when motion detected

Hi,

I have two devices:

  • light strip
  • motion sensor

I created a rule machine already:
IF motion detected AND it's between sunset and sunrise (night time) THEN turn on the light strip.

Now I wanted to add another condition to detect movement at night (so that I'm aware if the kids are outside their room), the conditions:

IF motion detected AND light strip is on AND it's between sunset and sunrise (night time) THEN

  • get the current light strip colour & settings
  • change the light strip to red
  • wait until no more motion detected
  • change the light strip colour back to it's original

Can this be done by a rule machine OR motion lighting apps?

I tried the motion lighting apps, what happen is after motion is no longer detected, rather than put the light to its original colour, it turn itself off instead.

Thanks

RM can handle capture and restore--there are actions built in. However, it's a bit tricky if the bulb was off, where only the on/off state will get restored and you'll have issues turning it back on if you don't specify a new color or CT (the "off" state gets restored correctly, but with a future on() command, most bulbs would turn on to red or whatever you had it set to). Here's a lengthy thread where I tested a solution for someone to work around that, if you are interested:

This was for a different purpose and isn't exactly what you want, but it is pretty close and should be doable if you know how to do a basic motion lighting rule (if not, the docs have many examples).

Thanks for your response, I think I managed to do it using rule machine, but interesting enough, when I tried to restore the light strip status, it didn't restore the original light settings.
Ps: I've decided to use blue light instead of red to be more eye friendly :slight_smile:

Conditions:

Original light setting:

Post condition runs: