Automation Triggers quickly, executes slowly (1-3 seconds), each piece is fast on its own (0.01 seconds)

Hey! Thanks for looking at my post.
I’ve got haos setup on a dedicated dell device w/ 4gb ram, 4core cpu.
I’ve got a Lutron caseta system with a pico remote and a Lutron dimmer.
If I use dev tools to run light.toggle on my switch, it switches the light instantly.
I built an automation that takes a pico remote ‘on’ press (not release), and fires the toggle on the switch.
When I test the automation, it runs instantly and the light is instantly switched.
When I press the ‘on’ button on the pico remote, the automation shows the blue indicator for ‘triggered’ instantly, but the light doesn’t switch for at least one full second and in some cases 3 seconds.

The trace log on the automation shows the automation is running in 0.04 seconds. But the light does NOT change that fast.

My first guess would be that the pico remote itself is reporting slowly, but when I am on the automation page and click the button, the ‘triggered’ blue bar shows up very* fast. Then a 1+ second delay to the action being called.

My second guess was that the ‘call service’ to the light.toggle was not running fast. But when I go to the dev tools and run the light.toggle manually using the services tab, it toggles the light instantly as well.

I’m a little bit lost for what to try next. The automation is just slow enough that it makes me think it hasn’t worked. When I use this remote as a switch on the wall, it will be slow enough where I won’t trust it has worked.

I do know for Lutron caseta switches, they actually switch the light first, then report the state, but the pico remote is actually firing the event to the hub, which is pushing very quickly to the server. It is only when wrapped in the automation system that it seems slow. :frowning:

1 Like

I think that would be posting the automation yaml and the trace yaml.

Haha, yep, that would help :slight_smile:

Automation:

alias: Remote_Main_On
description: ""
trigger:
  - platform: device
    device_id: 7614b13b9a4aeb11831f6601562879a1
    domain: lutron_caseta
    type: press
    subtype: "on"
condition: []
action:
  - service: light.toggle
    data: {}
    target:
      entity_id: light.kitchen_island_pendants
mode: single

Trace:

{
  "trace": {
    "last_step": "action/0",
    "run_id": "7913cb6da767ae8e1cd5fd9c5c5eb4bd",
    "state": "stopped",
    "script_execution": "finished",
    "timestamp": {
      "start": "2023-02-26T12:05:58.508722+00:00",
      "finish": "2023-02-26T12:05:58.564090+00:00"
    },
    "domain": "automation",
    "item_id": "1677363553971",
    "trigger": "event 'lutron_caseta_button_event'",
    "trace": {
      "trigger/0": [
        {
          "path": "trigger/0",
          "timestamp": "2023-02-26T12:05:58.508768+00:00",
          "changed_variables": {
            "this": {
              "entity_id": "automation.remote_main_on",
              "state": "on",
              "attributes": {
                "last_triggered": "2023-02-26T12:04:39.460899+00:00",
                "mode": "single",
                "current": 0,
                "id": "1677363553971",
                "friendly_name": "Remote_Main_On"
              },
              "last_changed": "2023-02-26T12:03:08.143753+00:00",
              "last_updated": "2023-02-26T12:04:39.501540+00:00",
              "context": {
                "id": "01GT6SRPD4HA6GFX49C84NADK3",
                "parent_id": "01GT6SRPD3Z0FC7SNH2DR67Z5H",
                "user_id": null
              }
            },
            "trigger": {
              "id": "0",
              "idx": "0",
              "alias": null,
              "platform": "device",
              "event": {
                "event_type": "lutron_caseta_button_event",
                "data": {
                  "serial": 82582347,
                  "type": "Pico3ButtonRaiseLower",
                  "button_number": 2,
                  "leap_button_number": 0,
                  "device_name": "Pico",
                  "device_id": "7614b13b9a4aeb11831f6601562879a1",
                  "area_name": "Kitchen",
                  "button_type": "on",
                  "action": "press"
                },
                "origin": "LOCAL",
                "time_fired": "2023-02-26T12:05:58.507564+00:00",
                "context": {
                  "id": "01GT6SV3KBR9H1NGZACGHCFDRS",
                  "parent_id": null,
                  "user_id": null
                }
              },
              "description": "event 'lutron_caseta_button_event'"
            }
          }
        }
      ],
      "action/0": [
        {
          "path": "action/0",
          "timestamp": "2023-02-26T12:05:58.510166+00:00",
          "changed_variables": {
            "context": {
              "id": "01GT6SV3KCW96Z0M7RVY6B9Q49",
              "parent_id": "01GT6SV3KBR9H1NGZACGHCFDRS",
              "user_id": null
            }
          },
          "result": {
            "params": {
              "domain": "light",
              "service": "toggle",
              "service_data": {},
              "target": {
                "entity_id": [
                  "light.kitchen_island_pendants"
                ]
              }
            },
            "running_script": false,
            "limit": 10
          }
        }
      ]
    },
    "config": {
      "id": "1677363553971",
      "alias": "Remote_Main_On",
      "description": "",
      "trigger": [
        {
          "platform": "device",
          "device_id": "7614b13b9a4aeb11831f6601562879a1",
          "domain": "lutron_caseta",
          "type": "press",
          "subtype": "on"
        }
      ],
      "condition": [],
      "action": [
        {
          "service": "light.toggle",
          "data": {},
          "target": {
            "entity_id": "light.kitchen_island_pendants"
          }
        }
      ],
      "mode": "single"
    },
    "blueprint_inputs": null,
    "context": {
      "id": "01GT6SV3KCW96Z0M7RVY6B9Q49",
      "parent_id": "01GT6SV3KBR9H1NGZACGHCFDRS",
      "user_id": null
    }
  },
  "logbookEntries": [
    {
      "name": "Remote_Main_On",
      "message": "triggered by event 'lutron_caseta_button_event'",
      "source": "event 'lutron_caseta_button_event'",
      "entity_id": "automation.remote_main_on",
      "context_id": "01GT6SV3KCW96Z0M7RVY6B9Q49",
      "when": 1677413158.508815,
      "domain": "automation"
    },
    {
      "when": 1677413158.562214,
      "state": "on",
      "entity_id": "light.kitchen_island_pendants",
      "context_event_type": "automation_triggered",
      "context_domain": "automation",
      "context_name": "Remote_Main_On",
      "context_message": "triggered by event 'lutron_caseta_button_event'",
      "context_source": "event 'lutron_caseta_button_event'",
      "context_entity_id": "automation.remote_main_on"
    }
  ]
}

I’m also going to setup node-red and test it running through that. That was what I used to use in my old setup. (new house, was putting in some new stuff decided to start fresh and try using the built in stuff only.)

Ok, so node-red does the same thing. The actual automation runs VERY fast, and you can see the lights ‘turn off’ or ‘turn on’ when looking at the dashboard. It is nearly instant. But the actual light doesn’t turn off for 1-2 seconds. But, when on the dashboard, if I actually click the light to toggle it, it is instant. I’m not sure why they are not the same time on each one.

Video of the delay I am talking about and showing both the remote trigger and the manual trigger.

May be slightly off-topic, but I’m confused about why you’re using the pico remote to control a light through a Home Assistant automation since the remote can be programmed to communicate directly with the lutron switch that controls the light. Maybe you’re already aware that you can still use HA to control the light without needing to add HA as a “middle man” between the remote and the light?

I am aware I can control it directly. What I can’t do is things like ‘double press’, ‘long press’ or things like scene control. So then the remote can trigger different lighting settings per time of day, or use a double off press to turn off all lights, but a single press to turn off only one, hit the on button and if the light is already on, cycle to next scene, use the middle/fav button to trigger light syncing on the TV through harmony, etc. HA has way* more power than Lutron does.

I was mainly using this to test the automations and linkage before going on to add more complex functions. It just struck me as oddly slow since the automation itself is triggered very quickly and runs very fast. I plan on also using Lutron motion detectors (they have been the most reliable I have tried), and they will also need to use HA if I am going to have them do scene control w/ brightness settings. Lights dimmer at night, etc.

Any updates on this? I’m actually experiencing Lutron light delays from the remote or just from motion sensors. The toggle from the dashboard is quick as it should but when it’s triggered by the automation then it’s about 1-2 second delay.

I’m glad it isn’t only me, though sad you are also seeing problems. A small update that I will add more too once I do a little more testing:

Using a Lutron motion sensor, tied to HA automation, firing light.turn_on to a Lutron switch has the same delay issue.
Using a Shelly motion sensor, tied to HA automation, firing light.turn_on to a Lutron switch does NOT have the same delay issue.

I’m going to test one more thing today: Lutron remote tied to hue light. It seems to be Lutron → ha → Lutron that is slow. But again, the actual automation triggers quickly and a direct press in the interface is very fast. Not sure where the speed issue is coming from. I did use Lutron remotes in my old home tied to shelly 1s and shelly rgbw2s, so I expect the Lutron remote to hue light won’t be a speed issue. Not sure why the lutron->ha->Lutron is so slow.

Update: This slow issue does not happen when using a Lutron pico remote to control hue lights, or anything else. Only Lutron → Lutron seems to be an issue. The interface clicking the lutron light is very fast, but toggling or triggering a scene using an automation is slow.

Out of curiosity, did you ever figure this out? I have a Lutron Homeworks QSX system integrated with Home Assistant and I have the same kind of lag. HA seems to see the action immediately, but the lights can take several seconds to react.

Nope. For whatever reason, when using a lutron device through HA to control another Lutron device, it is super slow. Using other devices to control the lutron is fine (motion sensors, hue remotes, etc).

It really sucks, because the lutron remotes w/ the pedestal stands are such nice remotes. Or the Pico in a holder on the wall. I have one setup to control my shelly rgbw2 strips, and it is instant. So, sending the commands in is instant. Controlling the lutron after an action is instant. It is only when they are controlling each other. :frowning:

Adding my hat into the ring. Same behavior, same issues. I also tried creating a Scene in the Lutron app (with the Scene being a simple on command), and the delay is still there.

I noticed that the green flashing light on the remote times perfectly with the light reacting… aka, when the green light STOPS flashing, the lights responds. But this could be a timing coincidence.

More info: adding a second Lutron light to the automation adds no extra delay (ie, ButtonPress->Delay->Both Lutron lights respond). Adding a non-Lutron light at the end of the automation will visibly illuminate first, before the Lutron lights respond. This leads me to believe it’s on the Lutron side AFTER receiving the command from HA, since this indicates that HA is sending the “on” signals in sequence but Lutron is not responding immediately.

It kind of makes me wonder if Lutron is disabling incoming commands during the time the remote is sending them or something. I appreciate the extra info. My other experiences with Lutron have all been incredibly positive and reliable. This is really the only dark spot for me with their products.

I have also noticed the same issue with an automation I have that is triggered by some zigbee motion sensors and switching on some lights on Sonoff plugs/basics. I changed over the plugs to some Meross LAN. I thought it was my zigbee network at first but the trace also shows everything running very quickly but the same 1-2 second delay to the light plugs.

I have tried creating a new automation with less triggers / choices and it is faster so I am thinking this may be my issue but see that you automation does not have many steps, conditions or actions. It would be a shame to have to create three separate automations to control one set of lights.

Have you made any progress with yours ?

Unfortunately, I haven’t. I have essentially stopped trying to fix it. I will potentially look for other remote options since it only seems to be an issue from a Lutron device to a Lutron device.

Late reply here, but I was struggling with the same thing running multiple lutron switches from an automation and having a large delay on triggering them.

What I found worked was setting up a scene in the lutron app to do what I wanted to happen and triggering that scene from Home Assistant. This took the delay out entirely. Hope it helps!

Im finding this exact same problem… and the comment above about only allowing one-way commands may be the problem.

I am using a pico through an automation, monitoring events, to turn on another lutron light.

i see the trigger is instantaneous once i push the pico button, but there is always a 1 second delay for the light to come on. I also notice that if i create a service call to the same action (no automation, just developer tools->services) to turn on the light and execute it, instantaneous. But if i put it all together in an automation, 1 second delay.

if i change the automation to turn on an ikea light instead of a lutron light, instantaneous…

So perhaps thats whats happening… cant send a command when listening to a command with the lutron bridge?

I have no idea, just wanted to add this.

One more datapoint… i setup an ikea zigbee RODRET dimmer switch in zigbee2mqtt… used an MQTT trigger in automation to turn on lutron light… happened instantaneously…

So definitely seems to be somethign where the trigger device (PICO) and the target device (CASETA DIMMER) are part of the same automation… 1 second delay gets introduced.

Now in my scenario this probably wont be a problem for me because i am going to use the picos to control some ikea tradfri GU10 bulbs… i was just being thrown off because i was setting up a test ot see how the picos worked with automation and i just happened to pick the lights in the room i was sitting in which are caseta dimmer driven… and i was concerned with the 1second delay introduced… now at least i think i know where that 1 second comes from and wont be a factor in my scenario.

Frankly cant see where you’d use a pico to control a caseta outside of the lutron app… unless maybe you were trying to group a caseta switch or dimmer and a non caseta swithc or bulb into the same trigger device (PICO).

Anyway, hope this helps.