Fade to level, turn off, not working


#1

1) Give a description of the problem
I have a simple piston that is supposed to fade an LED light to 0% then turn off. It fades to 0 on command… and then turns back on. I’d think its a fairly simple piston, but can’t figure out why it turns back on.

2) What is the expected behavior?
Fades to 0, and stays off.

3) What is happening/not happening?
Fades to 0 but turns back on.

**4) Post a Green Snapshot of the piston!


#2

Do you mean to have AND between your conditions? So the sensor has to be active while Good Night is executed?

Either way, that wouldn’t contribute to what you’re seeing. Do you have another piston that controls this light? What are its conditions?


#3

Yes, the AND is intentional. The Goodnight routine is usually run via Google Home, Ok Google Good Night. Which I call from downstairs. It also runs automatically at 2am. The lights I’m controlling are under my bed to give me light to get to bed. The AND for the motion sensor is so that the lights turn on when I’m downstairs, headed up, but don’t run at 2am when I’m already in bed.

And this is the only piston that uses this light. I’ll just have to turn some extra logging on and see if I can peg it down.


#4

Debugging doesn’t show anything, the debug log looks like its doing exactly what its supposed to be doing.

I think it has something to do with the particular device handler. I tested this with another set of similar lights, which are LED lights on an H801 controller, and they do the exact same thing. Trigger a fade, it fades, and then when the fade is done, the lights go on to 100%.

I’ve been tinkering around and the best I have come up with is to do the fade, then “cancel pending tasks” then “turn off”. It fades, then turns on to 100% briefly, then turns off. Not what I want, but might help in figuring this out.

Anyone else have H801 LEDs they could try with?


#5

Here are the logs, but I’m not sure they will tell anything:

4/12/2018, 8:57:29 PM +978ms
+0ms ╔Received event [MyHome].time = 1523581049861 with a delay of 116ms
+121ms ║RunTime Analysis CS > 22ms > PS > 83ms > PE > 16ms > CE
+123ms ║Runtime (37772 bytes) successfully initialized in 83ms (v0.3.104.20180323) (122ms)
+124ms ║╔Execution stage started
+144ms ║║Executed virtual command [Cabinet Lights].cancelTasks (6ms)
+168ms ║║Executed physical command [Cabinet Lights].off() (22ms)
+169ms ║║Executed [Cabinet Lights].off (24ms)
+188ms ║╚Execution stage complete. (64ms)
+189ms ╚Event processed successfully (190ms)
4/12/2018, 8:57:09 PM +304ms
+2ms ╔Received event [Test Button].switch = off with a delay of 73ms
+10224ms ║RunTime Analysis CS > 18ms > PS > 10189ms > PE > 16ms > CE
+10225ms ║Piston waited at a semaphore for 10098ms
+10227ms ║Runtime (37852 bytes) successfully initialized in 10189ms (v0.3.104.20180323) (10223ms)
+10228ms ║╔Execution stage started
+10236ms ║║Comparison (enum) off changes = true (1ms)
+10238ms ║║Cancelling condition #4’s schedules…
+10238ms ║║Condition #4 evaluated true (4ms)
+10240ms ║║Cancelling condition #1’s schedules…
+10240ms ║║Condition group #1 evaluated true (state changed) (7ms)
+10243ms ║║Cancelling statement #2’s schedules…
+10399ms ║║Executed physical command [Cabinet Lights].setLevel([20]) (145ms)
+10404ms ║║Executed physical command [Cabinet Lights].setLevel([18], [delay: 1000]) (4ms)
+10408ms ║║Executed physical command [Cabinet Lights].setLevel([16], [delay: 2000]) (3ms)
+10414ms ║║Executed physical command [Cabinet Lights].setLevel([14], [delay: 3000]) (4ms)
+10418ms ║║Executed physical command [Cabinet Lights].setLevel([12], [delay: 4000]) (4ms)
+10424ms ║║Executed physical command [Cabinet Lights].setLevel([10], [delay: 5000]) (5ms)
+10428ms ║║Executed physical command [Cabinet Lights].setLevel([8], [delay: 6000]) (3ms)
+10434ms ║║Executed physical command [Cabinet Lights].setLevel([6], [delay: 7000]) (4ms)
+10438ms ║║Executed physical command [Cabinet Lights].setLevel([4], [delay: 8000]) (3ms)
+10444ms ║║Executed physical command [Cabinet Lights].setLevel([2], [delay: 9000]) (5ms)
+10449ms ║║Executed physical command [Cabinet Lights].setLevel([0], [delay: 10000]) (4ms)
+10454ms ║║Executed physical command [Cabinet Lights].setLevel([0], [delay: 10099]) (4ms)
+10455ms ║║Executed virtual command [Cabinet Lights].fadeLevel (203ms)
+10456ms ║║Requesting a wake up for Thu, Apr 12 2018 @ 8:57:29 PM EDT (in 10.1s)
+10461ms ║╚Execution stage complete. (234ms)
+10462ms ║Setting up scheduled job for Thu, Apr 12 2018 @ 8:57:29 PM EDT (in 10.095s)
+10470ms ╚Event processed successfully (10470ms)
4/12/2018, 8:57:09 PM +281ms
+1ms ╔Received event [Test Button].switch = on with a delay of 58ms
+125ms ║RunTime Analysis CS > 15ms > PS > 97ms > PE > 14ms > CE
+128ms ║Runtime (37771 bytes) successfully initialized in 97ms (v0.3.104.20180323) (126ms)
+129ms ║╔Execution stage started
+138ms ║║Comparison (enum) on changes = false (0ms)
+139ms ║║Condition #4 evaluated false (4ms)
+140ms ║║Condition group #1 evaluated false (state did not change) (6ms)
+142ms ║╚Execution stage complete. (14ms)
+144ms ╚Event processed successfully (144ms)
4/12/2018, 8:56:23 PM +645ms
+10281ms ║Piston waited at a semaphore for 10141ms


#6

Yeah I don’t see anything in there that seems to be turning it back on. Going to have to dig into the handler like you were saying.

What if you change your fade to stop at 1%? Does it do the same? Maybe 0% is like off, and a redundant off is making something act strange.