Piston not running certain command


#1

I want my piston to turn bulb to 100% for 20 sec then to 0% and then keep the bulb ON at 0%. I have my own reason why I want bulb ON even though level is 0%.

Everything works fine except the last command.

It did run as expected last night but not today.


#2

You may want to consider using preset sunset and preset sunrise instead of {$sunset} and {$sunrise}


#3

I dont think that is the issue. Piston runs fine til the last command (turn ON).


#4

The lights should already be on when you set the level. I believe when you set to level zero is the same as off and will not change to on until you adjust the level again.


#5

With my Philips Hue bulbs, if I drop the level to 0%, not only does the bulb go completely dark, but it shows as OFF. If I toggle the switch, it still shows as off. If I toggle again, then it shows as on, but it now produces a bit of light. (even though the level still shows 0%)

Your mileage may vary


#6

That is my logic too but it did work last night. I use the same bulb to arm/disarm my cameras. So I need it to be ON at 0% to make it work.


#7

@WCmore hit the nail right on the head. You CANNOT have a bulb on at 0%. When you set it to 0% it turns the bulb off. That is not a function of ST but instead of the bulb. And the logic makes sense. If you sent a command to fade from 50 to 0 over 5 seconds, you wouldn’t know exactly when the bulb started so you wouldn’t know when to send the off command. So, when the lamp reaches zero, that is essentially turning it off. That’s just the way the bulbs work.


#8

So why does it work sometimes? It worked at 1:30 am today but not at 5:40 am.

10/23/2018, 5:39:36 AM +185ms
+1ms ╔Received event [Home].time = 1540291177470 with a delay of -1286ms
+165ms ║RunTime Analysis CS > 28ms > PS > 69ms > PE > 68ms > CE
+169ms ║Runtime (37112 bytes) successfully initialized in 69ms (v0.2.102.20180116) (165ms)
+171ms ║╔Execution stage started
+215ms ║║Executed physical command [Patio Light].setLevel([0]) (12ms)
+217ms ║║Executed [Patio Light].setLevel (15ms)
+223ms ║║Skipped execution of physical command [Patio Light].on([]) because it would make no change to the device. (3ms)
+225ms ║║Executed [Patio Light].on (6ms)
+228ms ║╚Execution stage complete. (58ms)
+230ms ╚Event processed successfully (231ms)
10/23/2018, 5:39:17 AM +306ms
+1ms ╔Received event [Backyard Camera].motion = active with a delay of 67ms
+80ms ║RunTime Analysis CS > 15ms > PS > 32ms > PE > 32ms > CE
+82ms ║Runtime (37120 bytes) successfully initialized in 32ms (v0.2.102.20180116) (80ms)
+83ms ║╔Execution stage started
+94ms ║║Comparison (enum) active changes_to (string) active = true (1ms)
+97ms ║║Cancelling condition #2’s schedules…
+98ms ║║Condition #2 evaluated true (7ms)
+132ms ║║Comparison (time) 20357405 is_not_between (datetime) 1540298280000 … (datetime) 1540338420000 = true (10ms)
+134ms ║║Time restriction check passed
+136ms ║║Condition #7 evaluated true (37ms)
+138ms ║║Cancelling condition #1’s schedules…
+139ms ║║Condition group #1 evaluated true (state changed) (50ms)
+142ms ║║Cancelling statement #3’s schedules…
+156ms ║║Executed physical command [Patio Light].setLevel([100]) (7ms)
+157ms ║║Executed [Patio Light].setLevel (10ms)
+162ms ║║Executed virtual command [Patio Light].wait (0ms)
+163ms ║║Requesting a wake up for Tue, Oct 23 2018 @ 5:39:37 AM CDT (in 20.0s)
+169ms ║╚Execution stage complete. (86ms)
+171ms ║Setting up scheduled job for Tue, Oct 23 2018 @ 5:39:37 AM CDT (in 19.994s)
+179ms ╚Event processed successfully (179ms)
10/23/2018, 1:30:08 AM +134ms
+1ms ╔Received event [Backyard Camera].motion = inactive with a delay of 84ms
+94ms ║RunTime Analysis CS > 15ms > PS > 42ms > PE > 37ms > CE
+97ms ║Runtime (37115 bytes) successfully initialized in 42ms (v0.2.102.20180116) (95ms)
+98ms ║╔Execution stage started
+109ms ║║Comparison (enum) inactive changes_to (string) active = false (0ms)
+111ms ║║Cancelling condition #2’s schedules…
+112ms ║║Condition #2 evaluated false (8ms)
+113ms ║║Cancelling condition #1’s schedules…
+114ms ║║Condition group #1 evaluated false (state changed) (10ms)
+117ms ║╚Execution stage complete. (19ms)
+119ms ╚Event processed successfully (119ms)
10/23/2018, 1:29:57 AM +76ms
+1ms ╔Received event [Home].time = 1540276198510 with a delay of -1435ms
+172ms ║RunTime Analysis CS > 83ms > PS > 45ms > PE > 44ms > CE
+175ms ║Runtime (37111 bytes) successfully initialized in 45ms (v0.2.102.20180116) (171ms)
+177ms ║╔Execution stage started
+209ms ║║Executed physical command [Patio Light].setLevel([0]) (10ms)
+211ms ║║Executed [Patio Light].setLevel (12ms)
+221ms ║║Executed physical command [Patio Light].on() (7ms)
+222ms ║║Executed [Patio Light].on (10ms)
+226ms ║╚Execution stage complete. (49ms)
+227ms ╚Event processed successfully (228ms)


#9

If your bulbs are anything like mine, it will only work every second run, as shown in post #5 above.

I highly recommend considering alternative approaches to this. Personally, I think that anything related to home security needs to be rock solid, and having a bulb on at 0% sounds finicky, at best.