Unwanted delay in light Automation

Hi!

I want to turn on multiple lights at the same time.

I have so far tried automation, group lights and scenes but have been unsuccessful. The easiest setup seems to be an automation triggered by a time stamp as code example below. What happens when I run the automation is that the first light turn on immediately but there is an (exact) delay of 10 seconds between each following light turning on. Adding more lights to the automation adds additional 10 seconds of delay between each light turning on. If I trigger two lights manually they both switch on immediately.

Any advice is most welcome!

- id: '1570825239747'
  alias: Time
  trigger:
  - at: '12:08'
    platform: time
  condition: []
  action:
  - data:
      entity_id: light.lounge_vagg
    service: light.turn_on
  - data:
      entity_id: light.lounge_tak
    service: light.turn_on

Two things to try:

  1. Put the lights in a light group and turn the group on.
  2. List all the entities in a single service call:
  - service: light.turn_on
    data:
      entity_id:
        - light.lounge_vagg
        - light.lounge_tak
1 Like

Thanks for the quick reply. I have actually tried both and in both cases only one of the lights turn on.

What kind of light are these? If you put them in a group and turn on the group it turns on only one light and the other doesn’t turn on at all?

Maybe the lights belong to a union and they subscribe to a one light at a time policy? :rofl:
I’d like to know what platform they are as well, so I can avoid it.

These are fixed installation dimmers called Plejd. I use a special hack to make it work with Hassio. Since the lights can be turned on in tight sequence manually it should also be possible through automation was my assumption. No other ideas on how to troubleshoot?

Maybe this may be of use Create a trigger via http

This is definitely something you should be discussing with the custom component developer. It’s not a home assistant problem.

I see you have already raised an issue and that the repository is being maintained so hopefully you will get a solution.

1 Like

As @tom_l said, the problem is with the custom component. Issue #10 on Github looks like a similar problem.

And as a point to note my grouped lights (IP wifi lights) turn on together via automation or GUI.

I hope the component creator takes a look at the behaviour.

Meanwhile I would like to find a workaround. I have noted that turning on several lights immediately after one another manually works fine.

Is there a way to mimic this manual turning on of lights through a script or similar (turn on light by light independently in a sequence with short delays?).

I have written a simple script but dont know how to call is over and over for each light.

If you toggle them locally, then each switch gets an immediate instruction.
If you are switching them together then this requires communication to each element involved.
The discussion above is regarding that communication and how slow it is.
There is no way round bypassing this communication; only to replace it with a newer, faster form of same.
This again is central to the discussion above.
If you need this speed your choice is to wait for the developer or to switch to another platform where the speed is not an issue.

1 Like

Maybe I need to clarify that what I mean by ‘manually’ in this case is that I press a button-card in my GUI, not pressing the actual physical switch.

This makes me believe that if I can mimic the press-button in a script I could get it working.

Hmmmn ! that’s interesting that they both go through HA but one takes longer than another.
What you could do is write a script, serially turning on each element with a delay between each one.
Well say that the delays are set by an input number to make them a) all the same b) easily changeable.
You can then experiment reducing the time and if you get to zero then you can basically ALL turn off (or on) at the same time.

Try : -

script:
  sc_light_off_test:
    alias: Light Off Test
    sequence:
    - service: light.turn_off
      entity_id: light.light_001
    - delay: "00:00:{{ states('input_number.in_light_test_timer') | int }}"
    - service: light.turn_off
      entity_id: light.light_002
    - delay: "00:00:{{ states('input_number.in_light_test_timer') | int }}"
    - service: light.turn_off
      entity_id: light.light_003
    - delay: "00:00:{{ states('input_number.in_light_test_timer') | int }}"
etc.

Start the value at say 12 seconds (You know you should be okay with 10) and work your way down, or just take a stabe and change it from there.
If you can do it on 0 seconds then edit the script to remove the delays and make sure that it’s still okay.

1 Like

Interesting results. When adding a 12 seconds delay it takes 22 seconds before the second light is turned of and with a 2 seconds delay it takes 12 seconds.

Did you fix it? I have same delay when motion and turn on LED & zwave lights…

It was related to a bug in the integration plugin. Not applicable to any other problem I am afraid.