Light Timer

Hi, all.

New to the apps part. I have lights that I just want to have turned off 30 minutes after they are turned on. Not dependant on motion, presence, etc. Have looked through all the smart apps and I don’t think there is anything there. Am I missing something?

Many thanks.

1 Like

I think it’s currently missing from the new app. You can create a virtual presence sensor and leave it in an away state then use “Lights off with No motion or presence” as a work around. That’s. The only way I’ve found to do it without using a custom app.

Here is that app:

2 Likes

has been driving me nuts…I deleted when I thought I would upgrade…but now that I am holding off I can’t get these back. Sent note to support saying “let there be lighting allowances!”

Once you delete all of the old Lights & Switches shortcut apps, they are gone for good! That’s actually a good thing, because the underlying app was a mess.

Smart Lights can do all of those functions from Lights & Switches but for two: Turn off after motion stops, and Turn off after a period of time. We’re pretty sure that the former is a very simple bug/oversight in Smart Lights. Not sure about the latter.

In either case, as an interim solution, the two apps I linked to above perform those two functions. My recommendation is to use Smart Lights for everything you can, and if you need one of those two, just install the little app through the IDE.

1 Like

I understand, I just meant the smart app for lighting allowance are gone. I understand the dashboard issues.

The dashboard view is important for locks/garages and lights, so I am staying on v1 until resolved.

Here is the direct link to the “light power allowance” app replacement. Same functionality.

3 Likes

I have a driveway gate, so when presence is detected, open the gate by turning on the switch, but after X minutes close the gate by turning switch off.

And then I can force open the gate by turning it on (so it doesnt auto-close)

This app is nice, but now it auto-closes the gate whenever I force the switch open. Additionally it doesnt work with Presence.

Ugg!!! I feel like I am going backwards with v2!!

You got to be sure you are using the right tool for the job. All this app does is turn something off x minutes after it was turned on, by any means.

If you want to get presence into it, that changes what you need to solve it. How did you do this before V2??? If you can spell that out, I can point you in the right direction. You could not have been using Light Power Allowance, which this replicates.

1 Like

You are correct! Your app is perfect for the right job -

Yea, I’m just trying to do something in v2 that I was already doing in v1. You use to be able to turn off a switch/light after x minutes of time and/or motion. This has been removed from v2 apparently.

That’s correct. The first was called Light Power Allowance. The app above in this thread performs that function. The other was called Turn off after motion stops, and that app is linked below. Everything else you used to be able to do in V1, you can do with Smart Lights in V2.

2 Likes

hmm… Yea, maybe its more a presence smartapp that is needed, ie, when presence is detected, turn on this switch, and then after x minutes turn this switch off.

Many thanks, Bruce. Exactly what I needed.

Bruce’s apps worked awesome for me, and now they can’t be taken away!

If I understand your dilemma, light power allowance is still there, just harder to find. You used to be able to edit your device and set the light power allowance, or turn on/off schedule. From the dashboard, select “Lights & Switches”. Then tap the gear in the top right corner. This will list your devices, click the (+) to the right of the light or switch of interest. The next page will allow you to set on/off, motion, timer, schedule, and presence preferences.

I hope this helps. I spent forever trying to find these settings and started using a smartapp until I stumbled upon it.

Lights & Switches has been deprecated. If you had it before, you still have it. But, once you delete all of the shortcut apps, it will go away and not come back. ST has replaced Lights & Switches with Smart Lights. Unfortunately, Smart Lights omitted Light Power Allowance. That’s why the app above was created, for either new users who never had Lights & Switches, or others who no longer have Lights & Switches.

You can still find the power allowance smartapp as a template in the dev portal (IDE)

/**
 *  Copyright 2015 SmartThings
 *
 *  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
 *  in compliance with the License. You may obtain a copy of the License at:
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
 *  on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
 *  for the specific language governing permissions and limitations under the License.
 *
 *  Power Allowance
 *
 *  Author: SmartThings
 */
definition(
    name: "Power Allowance",
    namespace: "smartthings",
    author: "SmartThings",
    description: "Save energy or restrict total time an appliance (like a curling iron or TV) can be in use.  When a switch turns on, automatically turn it back off after a set number of minutes you specify.",
    category: "Green Living",
    iconUrl: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet.png",
    iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Meta/light_outlet@2x.png"
)

preferences {
	section("When a switch turns on...") {
		input "theSwitch", "capability.switch"
	}
	section("Turn it off how many minutes later?") {
		input "minutesLater", "number", title: "When?"
	}
}

def installed() {
	log.debug "Installed with settings: ${settings}"
	subscribe(theSwitch, "switch.on", switchOnHandler, [filterEvents: false])
}

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

	unsubscribe()
	subscribe(theSwitch, "switch.on", switchOnHandler, [filterEvents: false])
}

def switchOnHandler(evt) {
	log.debug "Switch ${theSwitch} turned: ${evt.value}"
	def delay = minutesLater * 60
	log.debug "Turning off in ${minutesLater} minutes (${delay}seconds)"
	runIn(delay, turnOffSwitch)
}

def turnOffSwitch() {
	theSwitch.off()
}

That works, but lacks the features of the app posted above (Turn off after some minutes), including multiple switches, and restrictions as to time of day, days of week, and modes.

True, I’m using your example :smile:

Just tested few times. It’s still there under “lights and switches” smart app.

  1. Just choose light or switch you want to control.
  2. what do you want to control: choose turn Off.
  3. how do you want to trigger the action: scroll all away down and choose: Power allowance exceeded.
  4. Select after how many minutes you wants off.
  5. Choice of what day, mode etc.
    Next, can rename the smart app.
    And you done.

I hope this helps.

1 Like