You need to figure out which component of your setup is introducing the delay.
I use Zigbee2MQTT so I can see the inbound and outbound messages to home assistant:
1770235967.718014612 : zigbee2mqtt/bridge/logging : {"level":"info","message":"z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Living Entry IR', payload '{\"battery\":100,\"illumination\":\"dim\",\"linkquality\":212,\"motion_timeout\":19,\"occupancy\":true,\"update\":{\"installed_version\":8705,\"latest_version\":8705,\"state\":\"idle
1770235967.718259801 : zigbee2mqtt/Living Entry IR : {"battery":100,"illumination":"dim","linkquality":212,"motion_timeout":19,"occupancy":true,"update":{"installed_version":8705,"latest_version":8705,"state":"idle"},"voltage":2900}
1770235967.728706348 : zigbee2mqtt/Living Entry IR : {"battery":100,"illumination":"dim","linkquality":212,"motion_timeout":19,"occupancy":true,"update":{"installed_version":8705,"latest_version":8705,"state":"idle"},"voltage":2900}
1770235967.743668296 : zigbee2mqtt/Hall Ceiling/set : {"state":"ON","brightness":253,"color_temp":142}
- The first message is Z2M logging what is going to do.
- The second and third messages are from an IR sensor recording motion.
- The fourth message is coming from Home Assistant - turning on a bulb.
The timestamps are UNIX epoch times (number of seconds since 1st Jan 1970) however the critical part is the fraction of a second.
Subtracting the 2nd time from the 4th shows that Home Assistant is (worst case) servicing the request in 25 milliseconds (0.025 seconds).
Given that, I can check the other components:
- How long does it take for the sensor to detect my presence.
- How long after the “on” command does it take for the light to turn on.
Note I don’t have a scientific way to measure those last two points - I just click the button and see how long the light takes to come on / walk in front of the sensor whilst watching the Mosquito logs.
You will need to do something similar to identify where the latency in your setup is coming from.
If I had to guess, it would be that your sensors are introducing the latency - i.e.: that both home assistant and the outbound command are quick / not the problem - however you will need to test and confirm.