How does HA run Actions in an automation?

I have an automation that monitors a contact sensor from Hubitat. The actions that I have are:

a. Notify me using Pushover
b. Activate a sound on an Aeotec siren6 (Doorbel sound)

I did this on the Hubitat and the Siren was almost instantaneous. Now going thru HA it takes 5 -8 seconds before the siren sounds. Does HA process the Pushover first and then the Siren? Creating the lag time ?

Thanks

Yes. Unless you tell HA to do them in parallel.

That sounds like way too long for an API call. Could try putting the steps in parallel but might be something else going on. Any errors in the logs?

That makes sense that they run serially. I will try to run parallel or reverse them. I’ll look in the logs to see if anything is going on. Thanks for the reply

I changed it to run Parallel, no change, it actually took 10 seconds. Would I need a restart of HA? Nothing in the logs that I can find

No something seems wrong, I doubt its related to the parallel. What is an “Aeotec siren6”? How have you integrated it with HA?

Here is the siren:

I have it connected to the HA over Zwave. So far this is the only zwave device I have connected to the HA. Using the Run actions it works immediately.

you can trace the timeline with automation debugger…maybe that reveals something?

Nothing that I can see

You can see the automation itself isn’t the problem. (running those two in parallel would drop it even more) It took 1 second. Its either the honda_door_contact that took 5-6 seconds to turn on or the siren that took 5-6 seconds to actually sound once called. Or a mixture of both.

Next step would be to rule out the sensor. Watch the state of that sensor in the developer tab and open it and see if it responds quickly. What is that sensor anyway? What integration is it from?

This more/less rules out the siren. :slight_smile:

I still find the 1.02 secs ‘long’ compared to my 0.06s🤔
What hardware does HA run on?
(mine is VMware on an old but pretty fast 8core W10 machine)

I’m guessing pushover held it up. Its sequential. But ieven if its parallel, the entire automation will wait for both to complete…

Ha is running on a RPI3

That is a contact on an Arduino sending that to a hubitat and then integrated to the HA. The Hubitat sees the state change almost immediately when the door starts to raise. So maybe the issue is the integration between the HA and the Hubitat. It uses an api. It appears to be quick. I will look at the state of that contact in HA when I get home tonight. thanks for all the help

Just thought that th siren might be taking its sweet time to do its thing. Need to look at that as well.

You can call the service to turn on siren from developer tools manually. If you hit “call service”, does it ring the siren immediately or is there a lag?

1 Like

It is immediate, so more than likely the delay is within either the Arduino or the Hubitat. FYI the contact is from the Arduino that integrates to the Hubitat and then the Hubitat is integrated to the HE.

I suppose you meant to say HA not HE.

Anyways, don’t know how the arduino contact sensor thingy being setup in terms of HW / FW / SW, have you ever considered to somehow hook up this honda_door_contact sensor directly to HA?

You could flash it using ESPHome, which has direct API access to HA though its add-on :wink:

I have condsidered direct connection. I haven’t found a method of doing it I can afford yet.

I have several relays and several temp sensors (DS1820) connected to the Arduino Mega2560. I also have two of the Arduinos one for general stuff and one I want to use to contol my hot water heating system. Have yet to get that sorted out. Can I have two Arduinos connected at the same time with ESPHome? Alot of this is new to me.

Each ESPHome device is a sever and Home Assistant is the client, you can have as many ESPHome devices added to Home Assistant as you require.