I have an automation that runs while a bool is active. Without adding delay, it takes approximately 0,5s between each loop, which is too slow.
The automation is set up to dim the lights while a button is pressed, and i would prefer fast looping with small increments instead of slow looping with high increments.
The ‘looping speed’ is determined by the host machine’s ability to process the contents of repeat. The half-second you are measuring is probably not a limitation of the CPU but due to the integration that is used to transmit the dim command to the lights. I say that because a delay can be specified in milliseconds, meaning far shorter than the 500 milliseconds you are observing without the use of a delay.
What kind of lighting is it and which integration are you using to integrate the lighting with Home Assistant?
Its four ikea bulbs in a light group using zha. Im kind of new to this, so i dont know whats happening behind the scene. Do you know if each each run waits for response before continuing to next run? If so, is it possible to skip this and just spam service calls? Doesnt matter if some of the service calls fails.
When you say ‘light group’ do you mean the Light Group integration? If you’re using that then a dim command is transmitted separately to each one of the four lights. Acknowledgments are sent by each light. That happens each time a dim command is sent (each iteration of the repeat).
Zigbee supports the concept of native groups. If you have a Zigbee group containing a dozen lights, only one command is needed to make all 12 lights turn or dim (as opposed to a dozen commands if you use a Home Assistant Group or Light Group). However, I don’t know how ZHA manages Zigbee groups.