Motion activated smart light with dim nightlight function for night time


#1

1) Give a description of the problem
I have a Sengled Smart LED light that I have controlled with a motion sensor in my master closet. I have pasted the piston below. I would like to have the light always turn on at full brightness with motion. At night, I would also like it to turn on at 20% over night to act as a night light. My question is is this better done with a second piston or should I add conditions to this listed piston?

2) What is the expected behaviour?
Always turn on at 100% with motion. From sunset to sunrise, light at 20% except when there is motion, then increase to 100% and return to 20% if no motion detected for 3 minutes.

3) What is happening/not happening?
The listed piston works

4) Post a Green Snapshot of the pistonimage

5) Attach logs after turning logging level to Full
(PASTE YOUR LOGS HERE THEN HIGHLIGHT ALL OF THE LOGS AND CLICK ON THE </> ICON TO FORMAT THEM CORRECTLY)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

I am thinking something like this:

IF Sensor 3's motion changes to active         <-- Trigger
Then
    Set level to 100%
END IF

IF Sensor 3's motion STAYS inactive for 2 min  <-- Trigger
Then
    IF Time is between Sunrise and Sunset      <-- Condition
    Then
        Turn off
    Else
        Set level to 20%
    END IF
END IF

(notice the indented IF above)


The only thing this piston does not do, is automatically turn on/off at Sunset/Sunrise.
(although it will correct itself when the first person/pet walks by)

If you want to force it, you can add two more blocks to the very bottom:

Every day at Sunset
Do
    Set level to 20%
END EVERY

Every day at Sunrise
Do
    Turn off
END EVERY

Although, if it were me,

  • I would just add the “Set level” command to my normal “Sunset” piston,
  • and add the “Turn off” command to my “Sunrise” piston.

#3

Thanks for your suggestions. I have revised the piston and will check it out tonight to see if it works.


#4

Sounds good…

Keep us updated.