Porch light on infinite loop, help!


#1

1) Give a description of the problem
light is switching on and off in a loop

2) What is the expected behavior?
go on if it is between 1 hr before sunset and sunrise and turn off other times (if someone turns the light off physically at night i want the light to come back on and same for turning it on during the day)

3) What is happening/not happening?
when it gets to one hour before sunrise the light turns on and off in a loop

4) Post a Green Snapshot of the piston![image|45x37](upload://Screenshot (4).png)

5) Attach any logs (From ST IDE and by turning logging level to Full)
(
Date Source Type Name Value User Displayed Text
2018-07-31 7:22:58.686 PM CDT
7 minutes ago DEVICE switch on Front Porch Light switch is on
2018-07-31 7:22:56.097 PM CDT
7 minutes ago DEVICE switch off Front Porch Light switch is off
2018-07-31 6:58:11.321 PM CDT
32 minutes ago APP_COMMAND off Front Porch - Nighttime sent off command to Front Porch Light
2018-07-31 6:58:10.392 PM CDT
32 minutes ago APP_COMMAND on Front Porch - Nighttime sent on command to Front Porch Light
2018-07-31 6:58:10.295 PM CDT
32 minutes ago DEVICE switch on Front Porch Light switch is on
2018-07-31 6:58:09.657 PM CDT
32 minutes ago APP_COMMAND off Front Porch - Nighttime sent off command to Front Porch Light
2018-07-31 6:58:09.366 PM CDT
32 minutes ago DEVICE switch off Front Porch Light switch is off
2018-07-31 6:58:08.962 PM CDT
32 minutes ago APP_COMMAND on Front Porch - Nighttime sent on command to Front Porch Light
2018-07-31 6:58:08.653 PM CDT
32 minutes ago DEVICE switch on Front Porch Light switch is on
2018-07-31 6:58:08.016 PM CDT
32 minutes ago DEVICE switch off Front Porch Light switch is off
2018-07-31 6:58:07.959 PM CDT
32 minutes ago APP_COMMAND off Front Porch - Nighttime sent off command to Front Porch Light
2018-07-31 6:58:07.281 PM CDT
32 minutes ago APP_COMMAND on Front Porch - Nighttime sent on command to Front Porch Light
2018-07-31 6:58:06.902 PM CDT
32 minutes ago DEVICE switch on Front Porch Light switch is on
2018-07-31 6:58:06.535 PM CDT
32 minutes ago APP_COMMAND off Front Porch - Nighttime sent off command to Front Porch Light
2018-07-31 6:58:06.315 PM CDT
32 minutes ago DEVICE switch off Front Porch Light switch is off
2018-07-31 6:58:05.936 PM CDT
32 minutes ago APP_COMMAND on Front Porch - Nighttime sent on command to Front Porch Light
2018-07-31 6:58:05.543 PM CDT
32 minutes ago DEVICE switch on Front Porch Light switch is on
2018-07-31 6:58:05.303 PM CDT
32 minutes ago APP_COMMAND off Front Porch - Nighttime sent off command to Front Porch Light
2018-07-31 6:58:04.969 PM CDT
32 minutes ago DEVICE switch off Front Porch Light switch is off
2018-07-31 6:58:04.592 PM CDT
32 minutes ago APP_COMMAND on Front Porch - Nighttime sent on command to Front Porch Light
2018-07-31 6:58:04.272 PM CDT
32 minutes ago DEVICE switch on Front Porch Light switch is on
2018-07-31 6:58:03.994 PM CDT
32 minutes ago APP_COMMAND off Front Porch - Nighttime sent off command to Front Porch Light
2018-07-31 6:58:03.605 PM CDT
32 minutes ago DEVICE switch off Front Porch Light switch is off
2018-07-31 6:58:03.069 PM CDT
32 minutes ago APP_COMMAND on Front Porch - Nighttime sent on command to Front Porch Light
2018-07-31 6:58:02.801 PM CDT
32 minutes ago DEVICE switch on Front Porch Light switch is on)

REMOVE BELOW AFTER READING


#2

I think your math was overlapping & causing the loop…
(if on, turn off… if off, turn on)

You could simplify your piston by using something like this:

Although normally, I do not recommend taking this approach because you are basically turning a smart bulb into a stubborn bulb. Other variables (including free will) will no longer be considered…

Unless you change something later,
you will never be able to make the bulb do anything…
That bulb will be locked… 24 hours a day…
(with the exception being color & brightness changes)

Please understand that if you decide to go this route, you’ll have to be careful that none of your pistons, scenes nor routines try to control that light switch at all.
(or you may unintentionally re-create the loop once again)