Configure multiple devices through config flow

Hi,

I am implementing a custom device_tracker integration, which should be able to track multiple devices by querying an HTTP(S) endpoint. Each device has its own set of credentials (id and private_key), which the user should be able to enter through the initial config flow triggered via the UI.

Going through the documentation I couldn’t really find if there is a way to enter multiple sets of credentials through a config flow. What I would like to have is some kind of form where the user can click a + button and an additional set of fields (id and private_key) would appear. Is this functionality available in home assistant?

Thanks for any hints and help!

It may be possible to do that, but it’s not practical and probably not intended.

The easiest approach i can think of is setting your integration_type to “device” in manifest.json.
You can perform the config flow as many times as you want, or use the “+ add devices” button in the integration details to add a new device.

This is assuming the API endpoint doesn’t have credentials other than the device specific ones, if that is the case it gets a bit more complicated.