Piston Thoughts - lights on at arrival only when dark


#1

1) Give a description of the problem
I would like to turn on some lights when arrive mode triggers, but only if it is dark outside

2) What is the expected behavior?
Depending on complexity, it could be based upon sunrise/sunset +/- minutes like in SmartApps, but if there is a DTH that contains luminescence or other data to trigger off that would be fine as well.

3) What is happening/not happening?
Haven’t created it yet

4) Post a Green Snapshot of the pistonimage
(UPLOAD YOUR IMAGE HERE)

5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)

REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.


#2

Hi there,
with the sunset and sunrise, something like this should work:

IF arrive mode changes to ARRIVED (or HOME)
and
IF time is between sunset and sunrise
then
with switches/bulbs TURN ON

To turn off you need some other way (what ever you like)
maybe in 10 minutes, maybe at sunrise etc…

Some sensors have luminescence but I usually stay away from using them since they are really not 100% reliable in my experience.


#3

Just to add a bit to what Ike said…

Luminescence might work IF there are no lightbulbs visible from the luminescence sensor.
(otherwise, the lightbulb could make the sensor think it is daytime)


#4

@ike2018 thank you so much. Got it setup! So simple if you take your time and think through the different variables. I see how powerful WebCore is…


#5

IF time is between sunset and sunrise
then

Agreed. You are better off using the built in Virtual Device, “Time”. I had a problem using the sunset/sunrise global variables even though WebCoRE is supposed to be smart enough to work around the change in $sunset/$sunrise if the current date/time ($now) Global Variable goes past midnight, it was not doing so for me. Then I realized after searching that there was no need to use the Global Variables anyways as there is a built in Virtual Device for this.

Here is my working example:

I got tired of dealing with the redundant, waste of my time in setting up home device settings when my Logitech Harmony Home Hub starts any of my activities in the Living Room. It required me to specify the same repetitive settings over and over for every activity.

Instead of doing that, I created a Virtual Switch “Switch 1” in SmartThings, and instructed the Harmony Home Hub to simply turn it on or off when an activity begins or ends. I didn’t feel like using the built in sunset/sunrise calculator in the Harmony Home Hub because that whole product is awful and I don’t trust it.