Baby Dimmer Control

bassinet in dark room

Manage your Baby’s dimmer

 

This little app will help control the dimmer switch in your baby’s nursery, or any other dimmer switch. Perhaps late at night you don’t want the light at 100% brightness. This app will take care of that by allowing you to specify a time and what level to set the dimmer switch at that time.

We have it turn down the dimmer switch to 20% before the baby goes to sleep for the night and back up to 90% in the morning.

The app was tested with GE dimmers which turn on any time you set the dimmer level. So this app will turn the lights off immediately after it sets the level. If the light was already on, then it will leave it on.

definition
(
    name: "Manage Baby Dimmer",
    namespace: "OMH",
    author: "Outsmarting My Home",
    description: "Sets the dimmer level low and high at the specified times",
    category: "Convenience",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
    iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png"
)

preferences 
{
    section("Lights") 
    {
       input "light", "capability.switchLevel", required: true, multiple: false, title:"Light"
       input "lowLevel", "number", title: "Low Light Level", required: true
       input "highLevel", "number", title: "Max Light Level", required: true
       input "lowTime", "time", title: "Time for low", required: true
       input "highTime", "time", title: "Time for high", required: true
       input "disable", "bool", required: false, title: "Disable App?"
    }
}

def installed() 
{
    log.debug "Installed with settings: ${settings}"
    initialize()
}

def updated() 
{
    log.debug "Updated with settings: ${settings}"
    unsubscribe()
    initialize()
}

def initialize()
{
    schedule(lowTime, lowLightHandler)
    schedule(highTime, highLightHandler)
}

def lowLightHandler()
{
   if (!disable) 
   {
       def leaveLightOn = light.currentState("level") > 0
       light.setLevel(lowLevel)
       if (!leaveLightOn) 
       {
           light.off()
       }
    }
}

def highLightHandler()
{
    if (!disable) 
    {
        def leaveLightOn = light.currentState("level") > 0
        light.setLevel(highLevel)
        if (!leaveLightOn) 
        {
             light.off()
        }
     }
}

Recent Content

link to Garage Door Monitor

Garage Door Monitor

Here’s a little app which will monitor your garage doors and alert you if they remain open for longer than you would like. It’s always a terrible feeling when you realize that you left the garage door open all evening, or throughout the heat of the day. You can also specify some motion sensors which […]