If you have a bunch of things to do in your automation then you could try doing some or all of them in parallel. By default each action in a sequence waits formtne previous action to complete before starting.
Thats about it honestly for changes on HA side. If you’re seeing your cpu or memory hit limits a lot then could be worth investing in beefier hardware.
But also before any of that, try simply running the step in the automation that tells Alexa to say something in isolation. See how long that step takes by itself.
HA cannot tell your Alexas to broadcast directly, it has to tell Amazon’s cloud service. And then that tells your Alexa’s to broadcast. It’s a full round trip to a cloud service and back. If that takes most of the time then you won’t be able to speed that up no matter what you do, that’s the minimum amount of time it could possibly take.
Also MQTT has a delay that can not really be improved, so if you can find a way to connect directly to HA, then it will be faster.
Maybe your MQTT device can be converted to ESPHome.
SteveHA mentioned using BlueIris. It’s NVR software running on a PC (there’s nothing to flash with ESPHome).
I have several devices that communicate with Home Assistant via MQTT and, over the nearly 5 years I have been running it, communication latency is imperceptible. Certainly nothing to contribute in any meaningful way towards the 5-10 second delay SteveHA mentioned.
As an experiment, SteveHA should make the motion events reported as persistent notifications with timestamps. If they appear shortly after a motion event occurs then he’ll know the latency is due to Alexa processing. On the other hand, if it still takes 5+ seconds to receive a notification then the problem exists between Blue Iris and Home Assistant.
MQTT is slower than a direct connection.
It is probably not the main cause, because that would probably be the Alexa retrip as CentralCommand said, but MQTT can easily add 1 or 2 seconds.
I have never experienced a 1 or 2 second delay for any MQTT-based communications on my local network.
If your claim of ‘easily add 1 or 2 seconds’ comes from personal experience then you should know that something somewhere in your system wasn’t optimal.
I use Zigbee2MQTT, which as it sounds means that MQTT is involved in HA communicating with all my Zigbee devices. I can push a button on a Zigbee remote and instantly have a Zigbee light turn on/off.
I used to have a Z-Wave remote with a direct association to a Z-Wave socket so that it directly controlled it. My replacement Zigbee setup with an automation is every bit as fast and actually is a little faster, the wife commented Oh, I see you’ve fixed the annoying delay with the garden lights.
I do not know what was wrong then with my setup.
I did not have many devices and used the addon mosquitto broker and I had a delay, which disappeared once I flashed my Tasmota devices with ESPhome.
I did check the MQTT broker with MQTT explorer and could see the message arrive at the broker, but still had the delay after that.
I also know that others have mentioned it in threads here, but trying to search for it with words such as Tasmota, ESPHome, switch and delay returns around half of all posts on the forum. Here my search-fu is coming up short.