Setup an automatic nightlight with option to manually pause routines used in ST

I’m trying to setup a routine which automatically turns on a light to around 10%, when somebody walks into a room a night. When the presence sensor no longer detects anyone in the room, the light should be automatically turned off. This is quite easy to do in SmartThings.

However, I’d also need the option to manually change the brightness of the light and prevent the light from being turned off automatically. So basically some manuell overwrite, which disables the routines until I’ve turned off the light again by hand.

The typical solution to this involves the use of a virtual switch which is added as a precondition to your routines.

The details depend on exactly what you have in mind for your manual control.

If you intend to operate a the smart switch for the light manually you will find that it probably isn’t able to tell you if it was switched manually or automatically. You may find yourself using the virtual switch to indicate you turned on the light automatically. Your ‘on’ routine might add a check if the light is off and then turn on both the light and the virtual switch. Your ‘off’ routine might add a check for the virtual switch being on and also turn it off. Allowing for manual control when the light is already on might be more awkward. You could however have a routine to turn off the virtual switch if the light is set to values that aren’t used in automations.

Alternatively if you use separate hardware such as a button for remote control you could use the virtual switch to indicate manual control and set or clear it as required in the button handling routines.

Agree with orangebucket on the virtual switch. If you want something simpler to start with, you can use the brightness itself as the flag:

  • On routine: IF presence detected AND it’s night AND the light is off, THEN set it to 10%.
  • Off routine: IF no presence for a few minutes AND the light level is 10%, THEN turn it off.

If you bump it to anything other than 10%, the off routine leaves it alone until you turn it off by hand. The catch is if you manually pick exactly 10% it acts like the automation, which is usually fine for a night light.

Start the off delay longer than you think and shorten it after a few nights. I wrote up the off side here: www.homeautomationcookbook.com/automation/lighting/lights-off-after-motion.html

If your device supports a default dim level and an occupancy mode like the GE/Jasco motion dimmers do, you can create a couple of Routines to both change the modes and dim level depending on time of day:

If Virtual_Switch_Night turns on
Then
Set Operating Mode to Occupancy
Set Timeout Duration 1 Minute
Set Default dim level 1%

When motion is detected, the light comes on at 1% and goes off after 1 minute.

If Virtual_Switch_Night is on (precondition)
  When Light is On
  Light Switch is toggled up
Then
Set Dimmer to 100%

If you press the toggle up it will increase the dimmer level and the motion timer will still turn off the light after 1 min.

Then in the morning:

If Virtual_Switch_Night is off
Then
Set Operating mode to Vacancy
Set Timeout Duration to 5 mins
Set Default Dim Level 100%

Which turns off motion detection and makes it so the light comes up at 100% when the switch is toggled on.