Night light funcationality with dimmer switches

There is currently a night light that will turn on a switch if it detects motion in the night for a night light. However, given that it’s the middle of the night you probably do not want a light glowing at full capacity. Is it possible to create an app in which allows you to turn on a night light at a given luminosity?

The “Make It So” app can do this. Set up your light’s desired dimmer value on the device screen (and leave the light on, as configured) then run through the “Make It So” options and select the device you just configured.


Check out my recently shared at: Hallway Light at Night. It uses a motion sensor to detect movement, and then turns on a light at a user selected percentage. Then after a user specified number of minutes, it turns off the light. (Technically, after the time limit, it turns the light on full bright, and then turns it off. This way the light is set for 100% the next time it’s manually turned on.) Also, this app will only turn on the light at this dimmed level if:

  1. The light is already off.
  2. If it’s between a specified time at night and before a specified time in the morning.

I wrote this problem a while back for this exact problem, but for some reason forgot to share it. I’ve shared it now. Just to give you a starting point, I have mine set to only dim from 8:45pm to 5:00am. Dims at 22%, and turns off after 6 minutes, but all those can be tailored to your tastes when you install the app.

@chrisb thanks! This sounds exactly like what I need. However, I’m not familiar with importing other user apps into SmartThings. How do I go about this?


Unfortunately SmartThings hasn’t opened the ‘store’ yet so you can’t access other peoples programs. Instead, what you’re going to do is basically write your own program. But instead of having to write the code you’re just going to copy the code that I shared on the site.

Here’s a link to a quick cheat sheet I created a couple of months ago:

Note that it might be visually wrong as I think SmartThings made a few cosmetic changes to their site, but the steps should still be pretty much the same.

Essentially you’re going to sign up for developer status (real simple), then you’re going to start a new app. You’ll give it a name and brief description. Then you’ll browse through the example programs that SmartThings and others have written. Find the program you want and you have “Overwirte” the code from that program onto your program. Then we’ll save changes, publish it, and it’ll show up on your phone as a program you can use.

Obviously I’ve simplified things here, but give it a shot. If you get stuck let me know and I’ll walk you through the steps.

Thanks @chrisb wrote my first app tonight. How can I access other users’ shared apps?


Check on page 2 of my little tutorial. After you start your new app, click “Browse SmartApps” at the top right. Then click “Browse Shared SmartApps.” This should open the list of all the shared apps.

@chrisb, I’m looking for your “Hallway Light at Night” with exactly the functionality you’ve described here, but I’m not finding your app. did you change the name or remove it?

Try searching for “Smart Night Light - Dimmable” under Convenience in the Developer’s IDE.

Yea, I have that one running now. It’s not good because if the light is already on (say at 100% brightness) when motion is detected, it still changes the light to the nightlight (20%) level.

Chris’ original description of “Hallway Light at Night” is that it will only turn the light on if:

This is what I’m looking for. Not sure how to code it myself yet…



It should be there. I just updated the app to change the category to convenience so it might be easier to find.

However, having said that I do need to say that it may not work exactly as advertised. Specifically the “Only activate when light is off” part was a little buggy. The problem I was experiencing was that my hallway light was being turned on by an AUX switch in a three-way setup. Because of some of the quirks in z-wave technology this wasn’t reported to the Hub right away and so even though the light was on the app still activated.

This may not be a problem with you if you’re not using the 3-way AUX to turn on the Hallway. It also may not be a problem with newer Hub firmware that should update z-wave switches more rapidly.

I’ll try to do some more testing tonight if I get a chance.

@chrisb - hey, I know this is an old thread … but wondering if you ever got this app to work? I’m also looking for a dimmable night light solution that won’t fire if the switch is already on.

I haven’t used it myself for a long while cause my motion sensor batteries went dead and I’ve been too lazy to replace them, but it was working last time I used it. The app is called “Hallway light at night” and it is in the shared section.

One of these days I’ll take a look at it again and see if the code needs updating or fixing.

As in my previous post the “Only activate when light is off” part is/was still buggy. Because of some other changes in how we operated in my home this became much less of an issue so I never really worked too much more to resolve that problem.

I am using your Hallway Light at Night and it is working great for most of the program. My house goes into night mode at sunset at 100% brightness. I have the Hallway Light at Night to do 15% dim between 11:00PM and 4:00AM. All that works great. The problem I am having after 4:00am the motion sensor does not trigger anymore. It’s like it does not go back to night mode. If I manually change mode to I’m home and back to night the motion sensor start working again. Any suggestions on how I can fix this?