Lights on Arrival adaptation


(Michael Janczyn) #1

Hello,
I am attempting to adapt 625Alex’s smartapp which turns on lights after sunset when presence is sensed.
I wanted to make it turn off after a set period of time after presence is initially sensed.

I did this by inserting some code from “The Flasher” which is designed to flash lights on/off for a configurable period of time when presence is sensed. (it is measured in ms so I used something crazy like 60000 for ten minutes)
The Flasher
I thought I had everything configured correctly however upon installing it I receive terrible errors, haha.
This is my first time doing anything with code so help would be appreciated.
Thanks!

Code is located:
Lights On Arrival

Error:

org.codehaus.groovy.runtime.metaclass.MethodSelectionException: Could not find which method subscribe() to invoke from this list:
public java.lang.Object physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.DeviceWrapper, java.lang.String, java.lang.String)
public java.lang.Object physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.InstalledSmartAppWrapper, java.lang.String, java.lang.String)
public java.lang.Object physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.DeviceWrapper, java.lang.String, java.lang.String, java.util.Map)
public java.lang.Object physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.InstalledSmartAppWrapper, java.lang.String, java.lang.String, java.util.Map)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.AttributeWrapper)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.DeviceWrapper)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.HubWrapper)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.InstalledSmartAppWrapper)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.LocationWrapper)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.AttributeWrapper, java.util.Map)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.DeviceWrapper, java.util.Map)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.HubWrapper, java.util.Map)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.InstalledSmartAppWrapper, java.lang.String)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.LocationWrapper, java.lang.String)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(java.lang.String, java.lang.String, java.lang.String)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(java.util.Collection, java.lang.String, java.lang.String)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.HubWrapper, java.lang.String, java.lang.String)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.InstalledSmartAppWrapper, java.lang.String, java.util.Map)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.LocationWrapper, java.lang.String, java.lang.String)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.LocationWrapper, java.lang.String, java.util.Map)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(java.lang.String, java.lang.String, java.lang.String, java.util.Map)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(java.util.Collection, java.lang.String, java.lang.String, java.util.Map)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.HubWrapper, java.lang.String, java.lang.String, java.util.Map)
public void physicalgraph.app.SmartAppExecutorBase#subscribe(physicalgraph.app.LocationWrapper, java.lang.String, java.lang.String, java.util.Map) @ line 52

@625alex


(Mike Maxwell) #2

If you’re using AEON micro devices, they support (in the hardware) a configurable flash function.
I’ve written a device for this and use it in my setup.


(Alex) #3

So what you want is for the lights to turn on on arrival and then to turn off after a set amount of time?


(Darc Ranger) #4

You could set this up from the phone app.

I also did this 11 months ago that adapted other people. There are various Turn on Scripts done by SmartThings and others as noted. I also adapted from Alex’s script. Instead using of a set on-time or luminosity levels, I setup it to operate only between sunrise and sunset based on my location.
GitHub:Turn It On When I’m Here Between Sunset/Sunrise

My outside light come on when I or my wife arrive home and stay on for a set time, I use 12 minutes.


(Michael Janczyn) #6

I currently have a Linear WS15Z-1 that I am testing this on however I will probably end up with a GE/Jasco switch for the final implementation.

Yes

Wow, it looks like this is exactly what I need.


(Alex) #7

Lights should probably stay “on” if they are already “on”.


(Michael Janczyn) #8

This is going to control a set of lights that are never turned on, except when this app will enable them.
It is a set of lights outside the garage, I want them to turn on whenever anyone in my household arrives in the evening.
These lights aren’t used now (terrible light switch location) so I figured I would put them to use.


(Israel Munoz) #9

Great contribution, I used this functionality in the Hub v1 but dissapeared in the Hub v2 have been looking for this app. I’ll try it tomorrow. THANKS!