Like this?:
Lights not turning off
You need the first if statement to encompass everything.
Edit: Iâm usually limited to mobile. So it makes helping more difficult. Give me some time and Iâll whip up a piston
So the piston fired, but my lights turned on and off a couple times and stayed off. Tried to fix it and the logs are gone .
I did notice that all the lights were set to 1%, which is something I added at the end of the script (fade from 100 to 1 in 60 seconds). The problem was that it all happened so fast, I dont think it waited 60 seconds to fade.
Ive since scrapped the fade, and would kist like to get the lights to come on, white, 15 minutes before sunset at 100%. Then 10 minutes before sunset, if the month is X, follow the rest of whats posted in the piston.
EDIT: Not sure why this didnt actually post when I wrote it. It was about 20 minutes ago⌠SOrry.
I appreciate all your assistance with this.
Ok so here is what I was mentioning earlier about using a switch/case statement. To describe what is happening here. If the time is between 15 minutes to sunset and 10:30 pm then it will evaluate the month. It will take 10 and check each case for a match. If it finds one then it will complete the actions in that case. If it does not find a match then it will use the default case which has your normal colors.
Some issues that might surface from this. With the turn off being in the else of the time condition then you might find it difficult to turn on those lights outside of the timeframe but that might not be the case. At any rate you can import this and replace your lights back with how you had them. I used similar device types where you did so it should make for an easy transition.
Thanks for this! Ive imported and set MY lights to corespond with it.
The only time I ever have these lights called via another piston (in CoRe still), is in the second half (or-If) of my good night piston, which calls for them to come on between 1030 PM and 0600 AM if any of my presence sensors arrive in that time frame, do some other stuff (SHM disarm, interior lights, etc) wait 10 minutes and turn off.
And Im certain Ill need my hand held when it comes to that Core transition!
You are welcome. And this will be easy to add months to this piston as well. You will just select add a new case. Input the value of the month you want and bam. Add your actions!
Well when you decide to make that transfer we will be here to help. Currently I have an entire piston that controls just my location mode and shm. Its listed in the wiki as Home Scheduler. Separate from that one I have one that handles any arrival/departure for us. Those two work in tandem to keep the mode in check. Then I build other pistons based on the mode instead of checking for the same type of thing in different pistons.
A couple things after using your piston:
Firstly, I forgot to turn on full loggingâŚIts on now and Iâm leaving it on until this piston works fully.
For some reason, my porch light (Bulb 5)showed, in the ST app, that after this piston ran and shut everything off, that it powered on, then off, then on, and back off again. The color was set correctly while it was on, though.
Also, the other light that is grouped with my porch light (bulb 2 and 5) never set the correct color (purple).
Since Im using a Hue bridge, should I put a longer âwaitâ command between the actions? I recall someone saying or having around a 10 second wait between each action when a hue bridge was involved.
Thoughts?
I canât test this later when I get home. I have hue bulbs through the bridge as well. But I donât think Iâve had issues with waits.
Ok, thanks. Im gonna sit on my front porch tonight and see what happens when they turn on.
First Im going to go into each light and move the brightness and color to something other than what this piston calls for, then turn them off. Watch the piston fire (with logging on ) and Ill report back.
Do I need to turn TCP to never for anything in this piston?
No that wonât be necessary. Only if you had a long wait where the condition could revert back to false
Below are the logs fromyesterday. Apparently there was someone in my house that toggled my porch light, so it didnt come on as it should have. Either way, the brightness of the driveway lights did not set properly to 100%. And the some lights showed âonâ again after this piston turned off the lights at 1030. Almost like I was chasing the lights to turn them off again.
10/4/2017, 10:29:59 PM +366ms
+1ms âReceived event [Home].time = 1507174200000 with a delay of -635ms
+170ms âRunTime Analysis CS > 27ms > PS > 55ms > PE > 89ms > CE
+183ms âRuntime (43633 bytes) successfully initialized in 55ms (v0.2.0ec.20170927) (181ms)
+184ms ââExecution stage started
+264ms ââComparison (time) 80999563 is_between (time) 1507160400000 ⌠(time) 81000000 = false (13ms)
+267ms ââCancelling condition #6âs schedulesâŚ
+268ms ââCondition #6 evaluated false (71ms)
+274ms ââCancelling statement #6âs schedulesâŚ
+286ms ââRequesting time schedule wake up at Thu, Oct 5 2017 @ 6:25:00 PM CDT
+290ms ââCancelling condition #1âs schedulesâŚ
+291ms ââCondition group #1 evaluated false (state changed) (96ms)
+295ms ââCancelling statement #68âs schedulesâŚ
+353ms ââExecuted physical command [Driveway 2].off() (51ms)
+354ms ââExecuted [Driveway 2].off (52ms)
+419ms ââExecuted physical command [Driveway].off() (61ms)
+420ms ââExecuted [Driveway].off (63ms)
+448ms ââExecuted physical command [Front Porch Plug].off() (24ms)
+449ms ââExecuted [Front Porch Plug].off (26ms)
+478ms ââExecuted physical command [Garden Spot].off() (25ms)
+479ms ââExecuted [Garden Spot].off (27ms)
+526ms ââExecuted physical command [Porch].off() (44ms)
+527ms ââExecuted [Porch].off (46ms)
+533ms ââExecution stage complete. (348ms)
+535ms âSetting up scheduled job for Thu, Oct 5 2017 @ 6:25:00 PM CDT (in 71700.1s)
+555ms âEvent processed successfully (555ms)
10/4/2017, 6:25:07 PM +348ms
+0ms âReceived event [Home].time = 1507159508708 with a delay of -1361ms
+328ms âRunTime Analysis CS > 196ms > PS > 51ms > PE > 82ms > CE
+339ms âRuntime (43635 bytes) successfully initialized in 51ms (v0.2.0ec.20170927) (338ms)
+340ms ââExecution stage started
+357ms ââEvaluating switch with values [[i:75:null:0, v:[t:integer, v:10, vt:string]]]
+362ms ââComparison (integer) 10 is (integer) 10 = true (3ms)
+441ms ââExecuted physical command [Driveway].setColor([[hex: #800080, hue:83, saturation:100, level:25]]) (57ms)
+443ms ââExecuted [Driveway].setColor (68ms)
+488ms ââExecuted physical command [Porch].setColor([[hex: #800080, hue:83, saturation:100, level:25]]) (41ms)
+489ms ââExecuted [Porch].setColor (44ms)
+496ms ââFast executing schedules, waiting for 1872ms to sync up
+2384ms ââEvaluating switch with values [[i:75:null:0, v:[t:integer, v:10, vt:string]]]
+2389ms ââComparison (integer) 10 is (integer) 10 = true (3ms)
+2452ms ââExecuted physical command [Driveway 2].setColor([[hex: #FF8C00, hue:9, saturation:100, level:50]]) (44ms)
+2453ms ââExecuted [Driveway 2].setColor (46ms)
+2458ms ââExecution stage complete. (2118ms)
+2461ms âSetting up scheduled job for Wed, Oct 4 2017 @ 10:30:00 PM CDT (in 14690.193s)
+2477ms âEvent processed successfully (2478ms)
10/4/2017, 6:25:03 PM +169ms
+1ms âReceived event [Home].time = 1507159504554 with a delay of -1386ms
+370ms âRunTime Analysis CS > 47ms > PS > 64ms > PE > 259ms > CE
+382ms âRuntime (43635 bytes) successfully initialized in 64ms (v0.2.0ec.20170927) (380ms)
+384ms ââExecution stage started
+402ms ââEvaluating switch with values [[i:75:null:0, v:[t:integer, v:10, vt:string]]]
+410ms ââComparison (integer) 10 is (integer) 10 = true (3ms)
+473ms ââExecuted physical command [Driveway].setLevel([100]) (48ms)
+475ms ââExecuted [Driveway].setLevel (51ms)
+529ms ââExecuted physical command [Porch].setLevel([100]) (50ms)
+530ms ââExecuted [Porch].setLevel (52ms)
+536ms ââExecuted virtual command [Driveway, Porch].wait (1ms)
+538ms ââRequesting a wake up for Wed, Oct 4 2017 @ 6:25:08 PM CDT (in 5.0s)
+549ms ââFast executing schedules, waiting for 898ms to sync up
+1467ms ââEvaluating switch with values [[i:75:null:0, v:[t:integer, v:10, vt:string]]]
+1472ms ââComparison (integer) 10 is (integer) 10 = true (3ms)
+1537ms ââExecuted physical command [Driveway 2].setLevel([100]) (45ms)
+1538ms ââExecuted [Driveway 2].setLevel (47ms)
+1544ms ââExecuted virtual command [Driveway 2].wait (1ms)
+1545ms ââRequesting a wake up for Wed, Oct 4 2017 @ 6:25:09 PM CDT (in 5.0s)
+1557ms ââExecution stage complete. (1173ms)
+1560ms âSetting up scheduled job for Wed, Oct 4 2017 @ 6:25:08 PM CDT (in 3.98s), with 2 more jobs pending
+1576ms âEvent processed successfully (1576ms)
10/4/2017, 6:24:59 PM +162ms
+1ms âReceived event [Home].time = 1507159500000 with a delay of -839ms
+134ms âRunTime Analysis CS > 25ms > PS > 46ms > PE > 64ms > CE
+146ms âRuntime (43638 bytes) successfully initialized in 46ms (v0.2.0ec.20170927) (145ms)
+148ms ââExecution stage started
+218ms ââComparison (time) 66299322 is_between (time) 1507160400000 ⌠(time) 81000000 = true (12ms)
+220ms ââTime restriction check passed
+222ms ââCancelling condition #6âs schedulesâŚ
+223ms ââCondition #6 evaluated true (64ms)
+243ms ââCancelling statement #6âs schedulesâŚ
+258ms ââRequesting time schedule wake up at Wed, Oct 4 2017 @ 10:30:00 PM CDT
+262ms ââCancelling condition #1âs schedulesâŚ
+263ms ââCondition group #1 evaluated true (state changed) (105ms)
+268ms ââEvaluating switch with values [[i:75:null:0, v:[t:integer, v:10, vt:string]]]
+274ms ââComparison (integer) 10 is (integer) 10 = true (3ms)
+278ms ââCancelling statement #2âs schedulesâŚ
+330ms ââExecuted physical command [Driveway].on() (47ms)
+331ms ââExecuted [Driveway].on (49ms)
+384ms ââExecuted physical command [Porch].on() (49ms)
+384ms ââExecuted [Porch].on (51ms)
+390ms ââExecuted virtual command [Driveway, Porch].wait (1ms)
+392ms ââRequesting a wake up for Wed, Oct 4 2017 @ 6:25:04 PM CDT (in 5.0s)
+399ms ââCancelling statement #71âs schedulesâŚ
+445ms ââExecuted physical command [Driveway 2].on() (41ms)
+446ms ââExecuted [Driveway 2].on (43ms)
+452ms ââExecuted virtual command [Driveway 2].wait (0ms)
+453ms ââRequesting a wake up for Wed, Oct 4 2017 @ 6:25:04 PM CDT (in 5.0s)
+461ms ââCancelling statement #74âs schedulesâŚ
+491ms ââExecuted physical command [Garden Spot].on() (25ms)
+492ms ââExecuted [Garden Spot].on (27ms)
+531ms ââExecuted physical command [Garden Spot].setColor([[hex: #FF0000, hue:0, saturation:100, level:50]]) (23ms)
+532ms ââExecuted [Garden Spot].setColor (37ms)
+565ms ââExecuted physical command [Garden Spot].setLevel([100]) (21ms)
+566ms ââExecuted [Garden Spot].setLevel (29ms)
+574ms ââExecution stage complete. (427ms)
+577ms âSetting up scheduled job for Wed, Oct 4 2017 @ 6:25:04 PM CDT (in 4.816s), with 2 more jobs pending
+594ms âEvent processed successfully (593ms)
10/4/2017, 7:37:17 AM +65ms
+1ms âReceived event [Home].test = 1507120636794 with a delay of 270ms
+165ms âRunTime Analysis CS > 37ms > PS > 47ms > PE > 81ms > CE
+180ms âRuntime (43499 bytes) successfully initialized in 47ms (v0.2.0ec.20170927) (176ms)
+182ms ââExecution stage started
+247ms ââComparison (time) 27437260 is_between (time) 1507160400000 ⌠(time) 81000000 = false (15ms)
+252ms ââCondition #6 evaluated false (56ms)
+267ms ââCancelling statement #6âs schedulesâŚ
+282ms ââRequesting time schedule wake up at Wed, Oct 4 2017 @ 6:25:00 PM CDT
+291ms ââCondition group #1 evaluated false (state did not change) (97ms)
+298ms ââCancelling statement #68âs schedulesâŚ
+320ms ââSkipped execution of physical command [Driveway 2].off([]) because it would make no change to the device. (3ms)
+321ms ââExecuted [Driveway 2].off (12ms)
+327ms ââSkipped execution of physical command [Driveway].off([]) because it would make no change to the device. (2ms)
+329ms ââExecuted [Driveway].off (4ms)
+360ms ââExecuted physical command [Front Porch Plug].off() (28ms)
+361ms ââExecuted [Front Porch Plug].off (30ms)
+368ms ââSkipped execution of physical command [Garden Spot].off([]) because it would make no change to the device. (3ms)
+369ms ââExecuted [Garden Spot].off (5ms)
+376ms ââSkipped execution of physical command [Porch].off([]) because it would make no change to the device. (3ms)
+377ms ââExecuted [Porch].off (5ms)
+398ms ââExecution stage complete. (217ms)
+410ms âSetting up scheduled job for Wed, Oct 4 2017 @ 6:25:00 PM CDT (in 38862.527s)
+426ms âEvent processed successfully (426ms)
Sorry never had a chance to get on last night. Can you create a simple test piston that just has actions in it.
With hue lights
Set color to red
Turn on
Basically simple things to see if you need these waits. Try different things like using HSL instead of color. Mixing up where the turn on command is etc.
Having the same issue, tried multiple was of writing the if statements but timers not triggering properly.
For me also whenever I add a Fade effect it messes up the whole piston (possibly a bug here?)
Interested in the Hue wait times as havenât read about this before and most of mine are Hue.
I tried moving the order around, putting the âset levelâ first, and that didnt work.
I wonder if its holding onto the last level that the Hue Bridge controlled via the Hue app? Meaning, if I open the Hue app, turn the lights on (any color) and then set the level to 100, then turn the lights off, will webCore be able to keep that level, but change the color to the intended ones?
Im at a loss as well.
Paging @ady624 for guidance
Sorry I havenât been around a lot this week. Been super busy at work and home. But I donât seem to run into the same issues with my hue bulbs as you.
Do you actively use the hue app? Because I canât remember the last time I ever opened it.
I donât, but I have. Iâve used it to check the status quickly and initially change color and levels when troubleshooting this issue .
So Ive tried moving the order around within the piston and its not making a difference.
I was outside a few nights ago when this fired, and the lights turned on at 100% but then dropped to 25,50, and 25%.
They are not being used or called with any other piston or controlled by any smart lighting application. Im really stumped as to why they are doing this.
The one thing I havent tried is removing the line that sets the level, and see if that works.