Nobody Home + Sunrise / Sunset

Spoke too soon. The kids arrived home this afternoon at 3:19 and the app changed the mode to Night! Almost 3 hours before Sunset!!! Worked excellent yesterday. Arrrrgh!!!

Sorry to hear about your troubles. I don’t have any ideas off the top of my head - but I’ll try to do some debugging soon.

I was literally going to write this program tonight. Thanks for already writing it!

Did we ever figure out the issue with the sunrise event? I would prefer to use the code that subscribes to that event rather than the weatherapi code.

UPDATE: The problem was that i had an old ver of the code that wasnt passing the “evt” var to the subscribed methods.

@imbrian Sorry to resurrect this thread, but I just got a Smartthings v2 and I’m interested in your automation.

I looked at the documentation for sunrise/sunset to figure out what you’re using and how that’s injected (I’m a software dev but not Java and I definitely don’t know the groovy syntax).

I don’t know if this is new or not, but your initialize() doesn’t know what to do when it’s first set up about sunrise/sunset, but there now appears to be a getSunriseAndSunset(Map options) in the documentation. You don’t even need to know the zip code, since it will use the user’s location, but you could supply that if you want.

That part doesn’t matter as much, but it could be a useful improvement. What I’d actually like to request is that you allow a “minutes before sunset” option. I’d like to have the lights turn on if it’s 45 minutes before sunset as it gets quite dark in the house before sunset. The same could be done for sunrise since it can be somewhat bright outside before official sunrise.

The documentation has sunriseTime and sunsetTime (same link as above) now as well. I was wondering if you could make use of these features, which may be newer than the last revision of your code.

Thank you!

Does anyone know the status of this app.
I have been using the version that is loaded on SmartThings, but it does not set the mode to “Home” when returning during the daytime. I am on a V2 hub. I tried deleting the app and reloading it today, but still sets to night on return.

Below is the Notification received when I returned home at 10:23 am
2016-08-27 10:23:40.960 AM MDT - 15 minutes ago APP Nobody Home changed your mode to ‘Night’ Push (OK)

Below is the "Show installed SmartApp for Nobody Home"

awayThreshold decimal ""
newAwayMode mode Away
newSunriseMode mode Home
newSunsetMode mode Night
people capability.presenceSensor Arrival Sensor, Frederick Johnson’s Android
sendPushMessage enum Yes

Event Subscriptions

presence presence true Frederick Johnson’s Android
presence presence true Arrival Sensor
sunrise setSunrise true Silver City (Location)
sunset setSunset true Silver City (Location)

Application State

sunMode Night

There have been significant changes to this app late last year by @ai7 on Github (not sure if he has an account on here). The app update process on SmartThings remains a mystery to me. I have submitted the code about 8 months ago, but as far as I know, it still remains unavailable. If you’d like to use the new version, you may have to manually install from the source code available here:

Older versions of this app polled weather data to reliably find the sunrise/sunset time - as the built in events were (at least for some time) reported to me as unreliable. This version of the code is far more simple and may or may not work for your needs:

Unfortunately, because of the above issues, I’ve ported all the logic for my home automation system off of SmartThings and now only use it as a simple z-wave controller. As such, I’m no longer actively developing or testing existing code for the platform beyond my app that acts as an event proxy.

I hope this helps - good luck!