Hue automation and script lag (up to 30 second delay)

I have a simple automation that activates a five minute timer as follows:

five_minute_delay:
  alias: "Five minute delay"
  sequence:
- service: homeassistant.turn_on
  data:
    entity_id: input_boolean.enable_timer
- delay:
    minutes: 5
- service: homeassistant.turn_off
  data:
    entity_id: input_boolean.enable_timer

The automation is called when a group of two Philips Hue lights are turned off by using the state commend from on to off.

It works, but recently I have noticed that it takes up to 30 seconds for the script to activate which is causing problems and I can’t work out what is causing the delay. I have read a few posts about resetting the Hue hub which I have tried but it does not seem to have improved things.

There are no errors in my log file that I have seen that point to failed connections with the Hue.

I have sort of managed to workaround the problem but it is bugging me that I can’t find the cause of the delay.

Can anyone suggest a good place to start to try and find my bug!

Reduce the scan interval for the hue component

Thank you - For some reason I assumed that it was some type of push setting from the Hue hub to HA rather than HA scanning the hub on a regular basis.

I have set it to 5 seconds - I assume that too low a scan interval will start to cause problems. I will do some testing :slight_smile: