I need to stop lights turning on while baby is sleeping

Here is the switch i have.
GE In-Wall Toggle Switch (On/Off) $47.00

I got it right out of the smartthings store. will it work with what i am trying to do?

Just to be clear, paddle or toggle? Dimmer or not?

no dimmer, toggle switch

edit: Thanks so much for being a great ST community member JD. You have seemed to answer most of my questions on my previous posts and it seems like a lot of other peoples too

1 Like

Check this out. It might work. But some Community members report the timing never gets quite right. But since it’s not a dimmer, there’s a chance it will work.

Personally, I’d consider the mode toggle switch as a separate option from the light switch. You can put it anywhere in the house, including outside the baby’s room, and you’d have a little more flexibility. But different things work for different people.

And thanks for the kind words. I really don’t answer that many questions, but I’m particularly interested in two things: network protocols, and how specific devices process specific network protocols. So it’s just automatic for me to pay very close attention to the differences between different models, and to go ahead and read things like conformance statements that make most people’s eyes glaze over. And I have the advantage of using voice technology, which makes it very easy to respond in full paragraphs. :wink:

You won’t find me on many of the threads about, for example, Sonos, irrigation systems, thermostats, or cameras, unless there’s a basic protocol aspect, and then it will just be one or two comments on that aspect. And I don’t join in any of the topics about specific app code, because following a block of groovy code with a text reader is almost impossible.

It just happens that I find the “will this device do that?” Conversations very interesting. :blush:


ill give it a try but i think that i tried this and it is only able to change the hello home actions and not the modes.

controlling the mode is what i found worked for me, although i could be missing something. Right now i have a smart app setup so that if the nursery motion sensor sees movement it turns on the overhead light. To get it to not turn on the light when the baby was sleeping i added a mode “baby sleeping” and then i went and modified the smart app to only perform the action “motion = lights” to work only when the mode is not in “baby sleeping”

is there a better way that i am not thinking about to accomplish what i need?

That sounds like a good approach. A hello home action can change the mode, so if you’re triggering a hello home action, you should be able to have that hello home action put it into the mode “baby sleeping”. You shouldn’t need to write your own smart app to do that, although you can, of course.

The following might also be relevant:

ive got it all set up, i will give it a try as soon as i get home from work. Thanks again JD

Good luck! Letting sleeping babies lie is always a good thing. :blush:

1 Like

If that doesn’t work, I have another way to do this that I’ve used, for the exact same reason. I wrote a very small app, that I’d be happy to share with you if you need it. The way it works is this: If you turn off the switch manually for the light that is ordinarily turned on with motion, it disables the motion turning it on. It remains disabled for motion until you allow the light to be turned off by motion inactive. No modes are involved, so nothing else in your setup is affected by it. I did this for my visiting granddaughters. I may have to resurrect it soon, as they are coming for another visit soon.


Below is the code for the app. For this to work you will need to make a few changes to your setup.

  1. In the IDE create a new device (in My Devices), and give it the type On/Off Button Tile. This is a virtual switch. You have to give it a name, an address, and assign it to your hub.
  2. In your shortcut where motion turns your light on and off, replace the light being turned on/off with your new virtual switch.
  3. Install this app, and specify the real switch and the virtual switch.

What will happen is that when motion goes to turn on the light, the little app will check first to see if it should turn it on or not. If motion is enabled, it will turn on just as before. If motion is disabled, nothing happens.

You disable motion by turning off the real switch while the light is on. To re-enable motion, all you have to do is walk away, and let the motion turn-off do its thing.

preferences {
	section("When this real switch is turned off...") {
		input "realSwitch", "capability.switch", title: "which switch?", required: true
        section("This virtual switch helper will disable motion...") {
    	        input "virtual", "capability.switch", title: "which virtual switch?", required: true

def installed() {

def updated() {

def initialize() {
    subscribe(virtual, "switch.on", virtualOnHandler)
    subscribe(virtual, "switch.off", virtualOffHandler)
    state.motionEnabled = true

def virtualOffHandler(evt) {
    state.motionEnabled = realSwitch.currentSwitch == "on"
    if(state.motionEnabled) realSwitch.off()

def virtualOnHandler(evt) {
    if(state.motionEnabled) realSwitch.on()
1 Like

Wow Bruce thats awesome! I will work on getting everything set up while I am at work today, and then test tonight. I’ve been thinking i need to learn more about virtual switches, and this seals the deal lol

everytime i try to create the virtual switch i am met with this error code

Error 500: Internal Server Error
URI /device/save
Reference Id e94b7568-247d-457b-97a3-42ceeb083ff6
Date Mon Apr 20 12:48:44 UTC 2015
Class java.lang.IllegalArgumentException
Message identifier required

I don’t know what that error is. Does that happen when you hit Create in the My Devices section of the IDE?

Yes it does.

and it also makes me log back in all of the time…

I sent you a Private Message. Check that.

Hello, trying to understand the smart app code above.

Question, you wrote:

To re-enable motion, all you have to do is walk away, and let the motion turn-off do its thing.

Do you mean, physically turn the switch on and then walk away?

If not, how does it know to start motion again?

Thanks in advance!

Yes, that’s what I meant. Allowing the motion-off to turn off the light re-enables motion.

Do you have a suggestion for a good switch that can be hard-wired and will transmit a double-tap? Ideally can also differentiate between double-up an double-down. The more it looks like a plain switch the better.

Ya I wish I knew what a good switch to transmit double taps was

The Leviton VRMX1 reports very fast, even with quick successive taps. So an app could use those for double tap with parameters, as has been done.