#Automation script loop doesn't seem to run the whole number of loops.

1 messages · Page 1 of 1 (latest)

humble blade
#

So I have a script that does the following.

Turn on Porch Lights at 1% brightness.

Then proceeds to run this next sequence 99 times: wait 10s, add +1 % brightness.

That -should- end at 100% correct? 1 + (99 x 1) = 100.

However, I noticed that my lights stopped at 84% brightness. The script trace seems to show only 20 loops, which cannot possibly be correct, because that'd put me at only 21% Brightness..

Here is the script:

  - action: light.turn_on
    metadata: {}
    data:
      brightness_pct: 1
    target:
      area_id: porch
  - repeat:
      count: 99
      sequence:
        - delay:
            hours: 0
            minutes: 0
            seconds: 10
            milliseconds: 0
        - action: light.turn_on
          metadata: {}
          data:
            brightness_step_pct: 1
          target:
            area_id: porch
alias: Porch Lights Fade On
description: ""
scarlet ether
#

Please format your code

austere heathBOT
#

To format your text as code, enter three backticks on the first line, press Enter for a new line, paste your code, press Enter again for another new line, and lastly three more backticks.
```yaml
example: here
```
Don't forget you can edit your post rather than repeatedly posting the same thing.

scarlet ether
#

Close

#

3 of them, as shown

humble blade
#

My bad. Sec.

scarlet ether
#

Anyway, my guess is that your lights don't support that granularity and it's increasing in larger increments

humble blade
#

But of a pita getting to that on my phone. 😛

scarlet ether
#

You can test this in devtools -> Actions

humble blade
#

It seems to work, I watched it go up by 1% increments manually running the script, though.

#

It's just weird that Traces only shows up to 20 iterations

#

What's strange is that I originally had the delay set to 1s for testing, and that seemed to work correctly and completely. Is there perhaps a time limit to a script running?

scarlet ether
#

doubtful. I modified your script and I'm up to 26 now:

test_script:
  sequence:
    - repeat:
        count: 99
        sequence:
          - delay:
              hours: 0
              minutes: 0
              seconds: 10
              milliseconds: 0
          - action: persistent_notification.create
            data:
              message: Test Notification {{ repeat.index }}
#

likely something to do with your device

#

up to 55 🤷

humble blade
#

Weird. I'll play with it more, I guess.

#

Tbh, it may very well be just responsiveness issues, as this is a cloud controlled set of wifi bulbs

#

I'll probably just add a 100% brightness to run at the end of the loop and be done with it.

#

Thanks.