Issue with command : Fade over time

I am having a weird issue with fade over time. Actually it is more with the Wait for Event statement.

Basically, When triggered by a motion detector, I turn on a light (Eclairage corridor) to three different level according to time of day. 100%, 75% and 25%. that works fine.

The issue is with the rule machine rule turning it off. Basically the rule fades the level to 15% and when it reaches 15% it turns off the light. When it fire from the 100% or 75% level it works fine, but when it fires from the 25% level, it has a odd behavior. It turns off the light as expected, then turn it back on at the 15% level. This is confirmed by the logs that the fade over time act after the OFF statement

Here is the rule :
image

Since the rule has 24 steps (2 minutes at 12 steps per minute). The dim level from 100 % 75% and 25% have steps of respectively 3.5%, 2.5%, 0.416%).

At 100% and 75%. For the Wait test to be true, your have to be at the 24 of 24 steps, otherwise you are at 18.5% and 17.5% respectively at the 23rd step. Alls is fine and this works well

What I suspect is that since the wait statement use an integer for the comparison, at the 22nd step, it has decreased the 25% original level by (22x.416%=9.16%) thus reaching. 15.84%.

At 15.84% the wait statement using an integer for comparison trigger and turns off the light. But... there are still 2 steps left in the Fade operation , so at the 23rd step there is a dim command at 15.42% issued, and the lamp goes back on.

Any suggestion how I could work around this issue. Since I can not make a comparison with a decimal level to 15.0 ? The alternative would be to add a dumb delay of 11 seconds before the off statement to make sure that all 24 iterations are done, but this is not an elegant solution.

Any suggestions ?

Thanks !

Turn on the Action logging for this rule,, and post a screenshot of those logs for when it fails from 25% starting point.

To get around this: You could add "Stop dimmer fade " action right after the Wait, and also change the Wait for Event into a Wait for Condition

Thanks for the suggestions.

Following is the logs taken after the rule was triggered.

It seems to confirm that the dimmer level value gets 'truncated' to the integer value of the required level by the fade routine. That results in the same level being requested more than once when the steps are below .5%.

Highlights:
AT 21:51:59, The rule to turn off light at 15% triggered and turned OFF light when dim level reached 15.84%) 22nd of 24 dimming steps
At 21:52:04: The light turned back ON when a dim command at level 15% was issued when fade calculated a level of 15.42%) (23rd step of 24 fading steps)
At 21:52:09: The light were dimmed at level 15% again when fade calculated a level of 15.0% (24 step and last of fading)

dev:642023-01-06 21:52:14.845infoEclairage corridor is 15% [digital]

dev:642023-01-06 21:52:14.842infoEclairage corridor is on [digital]

dev:642023-01-06 21:52:09.789infoEclairage corridor was set to 15% [digital]

dev:642023-01-06 21:52:09.783infoEclairage corridor is on [digital]

app:682023-01-06 21:52:09.405infoFinal Step Down: Eclairage corridor: Level 15

app:682023-01-06 21:52:04.828infoAction: Delay 0:03:00

app:682023-01-06 21:52:04.784infoTriggered: Eclairage corridor digital on

app:682023-01-06 21:52:04.774infoEvent: Eclairage corridor switch on

dev:642023-01-06 21:52:04.730infoEclairage corridor was set to 2% [digital]

dev:642023-01-06 21:52:04.727infoEclairage corridor was turned on [digital]

app:682023-01-06 21:52:04.345infoStep Down: Eclairage corridor: Level 15

dev:642023-01-06 21:52:00.018infoEclairage corridor was turned off [digital]

app:682023-01-06 21:51:59.763infoAction: Off: Eclairage corridor

app:682023-01-06 21:51:59.715infoWait over: Dimmer level of Eclairage corridor(15) reported <= 15

app:682023-01-06 21:51:59.688infoWait Event: Eclairage corridor level 15

dev:642023-01-06 21:51:59.658infoEclairage corridor was set to 15% [digital]

dev:642023-01-06 21:51:59.655infoEclairage corridor is on [digital]

app:682023-01-06 21:51:59.288infoStep Down: Eclairage corridor: Level 15

dev:642023-01-06 21:51:54.845infoEclairage corridor is 16% [digital]

dev:642023-01-06 21:51:54.842infoEclairage corridor is on [digital]

app:682023-01-06 21:51:54.234infoStep Down: Eclairage corridor: Level 16

app:682023-01-06 21:51:49.586infoWait Event: Eclairage corridor level 16

dev:642023-01-06 21:51:49.556infoEclairage corridor was set to 16% [digital]

dev:642023-01-06 21:51:49.554infoEclairage corridor is on [digital]

app:682023-01-06 21:51:49.166infoStep Down: Eclairage corridor: Level 16

dev:642023-01-06 21:51:44.491infoEclairage corridor is 17% [digital]

dev:642023-01-06 21:51:44.488infoEclairage corridor is on [digital]

app:682023-01-06 21:51:44.115infoStep Down: Eclairage corridor: Level 17

dev:642023-01-06 21:51:39.439infoEclairage corridor is 17% [digital]

dev:642023-01-06 21:51:39.436infoEclairage corridor is on [digital]

app:682023-01-06 21:51:39.065infoStep Down: Eclairage corridor: Level 17

app:682023-01-06 21:51:34.420infoWait Event: Eclairage corridor level 17

dev:642023-01-06 21:51:34.389infoEclairage corridor was set to 17% [digital]

dev:642023-01-06 21:51:34.386infoEclairage corridor is on [digital]

app:682023-01-06 21:51:33.998infoStep Down: Eclairage corridor: Level 17

dev:642023-01-06 21:51:29.338infoEclairage corridor is 18% [digital]

dev:642023-01-06 21:51:29.335infoEclairage corridor is on [digital]

app:682023-01-06 21:51:28.949infoStep Down: Eclairage corridor: Level 18

app:682023-01-06 21:51:24.293infoWait Event: Eclairage corridor level 18

dev:642023-01-06 21:51:24.264infoEclairage corridor was set to 18% [digital]

dev:642023-01-06 21:51:24.261infoEclairage corridor is on [digital]

app:682023-01-06 21:51:23.896infoStep Down: Eclairage corridor: Level 18

dev:642023-01-06 21:51:19.199infoEclairage corridor is 19% [digital]

dev:642023-01-06 21:51:19.197infoEclairage corridor is on [digital]

app:682023-01-06 21:51:18.821infoStep Down: Eclairage corridor: Level 19

dev:642023-01-06 21:51:14.141infoEclairage corridor is 19% [digital]

dev:642023-01-06 21:51:14.138infoEclairage corridor is on [digital]

app:682023-01-06 21:51:13.770infoStep Down: Eclairage corridor: Level 19

app:682023-01-06 21:51:09.105infoWait Event: Eclairage corridor level 19

dev:642023-01-06 21:51:09.076infoEclairage corridor was set to 19% [digital]

dev:642023-01-06 21:51:09.073infoEclairage corridor is on [digital]

app:682023-01-06 21:51:08.698infoStep Down: Eclairage corridor: Level 19

dev:642023-01-06 21:51:04.026infoEclairage corridor is 20% [digital]

dev:642023-01-06 21:51:04.023infoEclairage corridor is on [digital]

app:682023-01-06 21:51:03.648infoStep Down: Eclairage corridor: Level 20

app:682023-01-06 21:50:59.006infoWait Event: Eclairage corridor level 20

dev:642023-01-06 21:50:58.970infoEclairage corridor was set to 20% [digital]

dev:642023-01-06 21:50:58.967infoEclairage corridor is on [digital]

app:682023-01-06 21:50:58.582infoStep Down: Eclairage corridor: Level 20

dev:642023-01-06 21:50:53.915infoEclairage corridor is 21% [digital]

dev:642023-01-06 21:50:53.912infoEclairage corridor is on [digital]

app:682023-01-06 21:50:53.531infoStep Down: Eclairage corridor: Level 21

app:682023-01-06 21:50:48.933infoWait Event: Eclairage corridor level 21

dev:642023-01-06 21:50:48.903infoEclairage corridor was set to 21% [digital]

dev:642023-01-06 21:50:48.900infoEclairage corridor is on [digital]

app:682023-01-06 21:50:48.474infoStep Down: Eclairage corridor: Level 21

dev:642023-01-06 21:50:43.795infoEclairage corridor is 22% [digital]

dev:642023-01-06 21:50:43.792infoEclairage corridor is on [digital]

app:682023-01-06 21:50:43.422infoStep Down: Eclairage corridor: Level 22

dev:642023-01-06 21:50:38.746infoEclairage corridor is 22% [digital]

dev:642023-01-06 21:50:38.743infoEclairage corridor is on [digital]

app:682023-01-06 21:50:38.369infoStep Down: Eclairage corridor: Level 22

app:682023-01-06 21:50:33.726infoWait Event: Eclairage corridor level 22

dev:642023-01-06 21:50:33.692infoEclairage corridor was set to 22% [digital]

dev:642023-01-06 21:50:33.689infoEclairage corridor is on [digital]

app:682023-01-06 21:50:33.302infoStep Down: Eclairage corridor: Level 22

dev:642023-01-06 21:50:28.634infoEclairage corridor is 23% [digital]

dev:642023-01-06 21:50:28.631infoEclairage corridor is on [digital]

app:682023-01-06 21:50:28.250infoStep Down: Eclairage corridor: Level 23

app:682023-01-06 21:50:23.608infoWait Event: Eclairage corridor level 23

dev:642023-01-06 21:50:23.572infoEclairage corridor was set to 23% [digital]

dev:642023-01-06 21:50:23.569infoEclairage corridor is on [digital]

app:682023-01-06 21:50:23.195infoStep Down: Eclairage corridor: Level 23

app:682023-01-06 21:50:18.558infoWait Event: Eclairage corridor level 24

dev:642023-01-06 21:50:18.522infoEclairage corridor was set to 24% [digital]

dev:642023-01-06 21:50:18.519infoEclairage corridor is on [digital]

app:682023-01-06 21:50:18.130infoStep Down: Eclairage corridor: Level 24

app:682023-01-06 21:50:13.102infoAction: Wait for event: Dimmer level of Eclairage corridor(25) is <= 15

app:682023-01-06 21:50:13.079infoStep Down: Eclairage corridor: Level 24

app:682023-01-06 21:50:13.051infoAction: Lower Eclairage corridor down to 15 over 2 minutes with 5.0 seconds interval

app:682023-01-06 21:50:13.039infoDelay Over: Delay 0:03:00

dev:632023-01-06 21:48:18.340infoMotion / Temp: motion is inactive

Your supposition appears to be correct. That is, the value kept step to step during the fade is decimal, but setLevel only accepts an integer. With the step size < 0.5, you can see how the saved value could be 15.9, then 15.5, etc. while the first of those sets the level to 15, but it's not done yet.

So just put 'Stop dimmer fade' before the off action, after the wait.

1 Like

Thanks for the feedback.

Solution tested. It fixes the issue

Thus the Stop dimmer fade should be mandatory for most of my dimmer fades implementation as I like a slow dim...

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.