External request URL + sunset, turn on light


#1

1) Give a description of the problem
I am trying to figure out how to make a piston that can be executed via URL, but only will execute between sunset/sunrise

2) What is the expected behavior?
if URL is executed, and it is after sunset and before sunrise, turn on light

3) What is happening/not happening?
i can get the light to turn on when the URL is executed, but I want it to turn on only during night time.

**4) Post a Green Snapshot of the piston![image|45x37](

5) Attach any logs (From ST IDE and by turning logging level to Full)

.


#2

Enclose the turn on statement in if that will evaluate the current time is in between your requirement.


#3

Thanks @eibyer!
I think I got it…
see sample…


#4

Here’ it is a little cleaner… Click “options” in the edit piston window and choose “show restrictions”.
Then make a time restriction as shown in my example.


#5

much more elegant; I am pretty new to webcore, love it!!
Thanks again @allrak