Custom Integration - Help with DataCoordinator - Single UDP Request at a time

Hello,

first of all, i’m quite new here (using HA for a couple years now, but developing).

I’m currently building a custom integration for a smart electric heater called Thermotec Aeroflow.
(Integration / Custom Component)

The first “Alpha” version is already coded and works so far…

I’ll give you a short description on how the System works.

The library sends requests to the Gateway via UDP.
The Gateway is a physical device (called FlexiSmartGateway) and requests data via RF from the Heater.

My Integration uses the library to request data.

So far so good. This works easily and correctly with one or two heaters.
But it starts to fail at three entities. The reason is quite easy, the Gateway can pretty much handle only one UDP request at a time.


I hope i have explained my issue.

Now my question:
I’ve read, that the DataCoordinator could help me implementing a locking / requesting mechanism which could coordinate the requests to be fired one by one and maybe even with a 1-2 seconds timeout between the requests. Issue here: i couldn’t figure out, how i could do this :smiley: Sadly, the documentation is not that specific. I also couldn’t find an example that would help me here.

So maybe someone could help me here :slight_smile:

Best,
Kai

You just set your time interval for data update coordinator and it will regularly call your specific update implementation. So you can have multiple operations under that function, fire multiple udp packages and set internal state of home assistant based on received messages.