1) Give a description of the problem
Piston executes when tested, but not on real-world conditions (time of day and weather). Sub-triggers (doors opening) only partially execute as intended (light level increases, but does not revert back after designated 15 minute “wait” time- no evidence of countdown timer set in the dashboard. I have a feeling I’m not properly understanding else vs. else if vs. separate “if” statements. My coding has always been sloppy and amateur, but have always been able to figure it out. I tried several structures of this. Can someone tell me what I’m doing wrong?
2) What is the expected behaviour?
Only when my holiday lighting virtual switch is off, My porch, side entrance and deck lights come on to 50%, 2700k when it is between an hour to sunset and an hour past sunrise OR weather conditions are poor. When any of the above conditions are in effect and my front, side entrance or deck doors are open, their corresponding lights increase to 100% for 15 minutes then revert back to 50%. I’d also like to incorporate the same “level increase” behavior for arrival of presence sensors, but it’s not in the code yet.
3) What is happening/not happening?
Whenever I test the piston, the lights will come on or off as coded based on time of day or weather conditions. However, they will not turn on or off by themselves in the same way without manual testing (you can see this in the log below, when lights had been on overnight and the piston was tested in daylight, clear weather) . In other words, they don’t come on before sunset or after sunrise. When doors are open during the specified conditions, level raises as coded (100%); when closed, I can’t remember if they stay 50% or revert back to 100%, but I never see any 15 minute countdown in the dashboard as coded.
4) Post a Green Snapshot of the piston
5) Attach logs after turning logging level to Full
11/1/2019, 10:14:16 AM +704ms
+1ms ╔Received event [Home(1)].test = 1572617656701 with a delay of 2ms
+246ms ║RunTime Analysis CS > 27ms > PS > 61ms > PE > 158ms > CE
+250ms ║Runtime (49797 bytes) successfully initialized in 61ms (v0.3.10f.20190822) (247ms)
+251ms ║╔Execution stage started
+268ms ║║Comparison (enum) off is (string) off = true (3ms)
+271ms ║║Condition #1 evaluated true (14ms)
+273ms ║║Condition group #null evaluated true (state did not change) (17ms)
+345ms ║║Comparison (time) 36856984 is_between (time) 1572646800000 … (time) 1572608220000 = false (20ms)
+348ms ║║Condition #26 evaluated false (69ms)
+632ms ║║Comparison (dynamic) Sunny is_any_of (string) Cloudy, Rain, Cloudy/Wind, Fog, Heavy Rain, Light Rain, Cloudy, Rain Shower, Rain/Thunder, Rain/Wind, Showers Near, Shower/Wind = false (11ms)
+635ms ║║Condition #27 evaluated false (284ms)
+637ms ║║Condition group #25 evaluated false (state did not change) (357ms)
+638ms ║║Condition group #2 evaluated false (state did not change) (361ms)
+659ms ║║Comparison (time) 36857346 is_not_between (time) 1572646800000 … (time) 1572608220000 = true (13ms)
+661ms ║║Time restriction check passed
+663ms ║║Condition #29 evaluated true (21ms)
+677ms ║║Comparison (dynamic) Sunny is_not_any_of (string) Cloudy, Rain, Cloudy/Wind, Fog, Heavy Rain, Light Rain, Cloudy, Rain Shower, Rain/Thunder, Rain/Wind, Showers Near, Shower/Wind = true (9ms)
+679ms ║║Condition #30 evaluated true (15ms)
+681ms ║║Condition group #28 evaluated true (state did not change) (40ms)
+683ms ║║Condition group #5 evaluated true (state did not change) (42ms)
+686ms ║║Cancelling statement #7’s schedules…
+707ms ║║Executed physical command [Deck Light].off() (12ms)
+709ms ║║Executed [Deck Light].off (15ms)
+726ms ║║Executed physical command [Porch Light 1].off() (12ms)
+728ms ║║Executed [Porch Light 1].off (15ms)
+745ms ║║Executed physical command [Porch Light 2].off() (12ms)
+746ms ║║Executed [Porch Light 2].off (15ms)
+765ms ║║Executed physical command [Side Light].off() (13ms)
+767ms ║║Executed [Side Light].off (16ms)
+782ms ║║Condition #17 evaluated false (10ms)
+785ms ║║Condition group #16 evaluated false (state did not change) (12ms)
+797ms ║║Condition #19 evaluated false (8ms)
+798ms ║║Condition group #18 evaluated false (state did not change) (10ms)
+825ms ║║Comparison (time) 36857508 is_between (time) 1572646800000 … (time) 1572608220000 = false (16ms)
+828ms ║║Condition #40 evaluated false (25ms)
+830ms ║║Condition group #33 evaluated false (state did not change) (27ms)
+857ms ║║Comparison (time) 36857540 is_between (time) 1572646800000 … (time) 1572608220000 = false (17ms)
+860ms ║║Condition #50 evaluated false (24ms)
+862ms ║║Condition group #43 evaluated false (state did not change) (26ms)
+868ms ║╚Execution stage complete. (617ms)
+870ms ╚Event processed successfully (869ms)
REMOVE BELOW AFTER READING
If a solution is found for your question then please mark the post as the solution.