Toggle a dimmer on/off for a holiday dispaly


#1

1) Give a description of the problem
I have 3 on/off switches and 1 dimmer as part of a holiday display. I have timers setup for all of the switches. They turn on at 30 minutes before sunset and off at midnight. The on/off timers all work correctly. With the dimmer I’m trying to get it to toggle off and on. The lights come on at the expected time, but the dimmer does not start toggling. I then go to my piston and click the orange “test” button. The dimmer begins its toggle cycle and everything works fine and turns off at midnight as expected. The next night comes along and again the toggling doesn’t happen.

2) What is the expected behavior?
The dimmer should start toggling off/on 30 minutes before sunset.

3) What is happening/not happening?
The dimmer does not toggle between off and on unless I click the orange “test” button during the “lightsOn” period.

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


#2

It’s not triggering that part of your piston, because your piston isn’t monitoring the variable for changes. Try clicking on this statement:

image

and then on the far right of your screen, change the Subscription Method to “Always”.

image


#3

Unfortunately changing the subscription method to “Always” did not make any difference. Any other suggestions?


#4

Odd, can you post a log file from when the piston executes and lightsOn is true?


#5

To rule out problems with the variable and to make it easier to test, I removed the variable completely and just used the virtual “Time” device. Here’s the new piston:

and the log:

11/27/2018, 12:12:36 PM +691ms
+1ms ╔Starting piston… (v0.3.108.20180906)
+805ms ║╔Subscribing to devices…
+939ms ║║Subscribing to Outdoor Switch 1…
+941ms ║║Subscribing to Outdoor Switch 2…
+942ms ║║Subscribing to WeMo Switch 3…
+943ms ║║Subscribing to Christmas Tree Dimmer…
+945ms ║╚Finished subscribing (152ms)
+1090ms ║Comparison (time) 43957757 is_between (time) 1543345200000 … (time) 1543302000000 = true (17ms)
+1092ms ║Time restriction check passed
+1100ms ║Cancelling statement #19’s schedules…
+1116ms ║Requesting time schedule wake up at Wed, Nov 28 2018 @ 12:00:00 AM MST
+1133ms ║Setting up scheduled job for Tue, Nov 27 2018 @ 4:51:00 PM MST (in 16702.177s), with 2 more jobs pending
+1149ms ╚Piston successfully started (1149ms)


#6

Has the piston fired yet? That log is only from the piston starting up after saving it, not from an execution, so we can’t see the logic or timing issues there.

What happens if you push Test? I see the time condition evaluated true… I wonder if the start-up didn’t execute any functions for some reason. Still seems odd.


#7

It always work correctly when I press Test. For some reason it would just never start as scheduled the next day. I have set the time back to when I want it to fire. We’ll see if that happens as expected today and I’ll report back.


#8

I don’t see it setting a wake-up time for noon… if working right, there should be a wake-up for it to take care of the “noon to midnight” routine, just like there’s wake-ups for the other times.

Try changing that last section to:

IF
Time happens daily at noon
Do
While time is before midnight
Toggle

See if that fixes it. It might just be that the variable and time ‘things’ we’re trying to subscribe to don’t make reliable triggers. I know the above will work.


#9

Thank you. It is working now. I’m still puzzled why the variable method did not work. I even tried changing to a global variable and putting that section in its own piston with no luck. Here’s my final piston:


#10

Not sure what happened but glad you got it working now!