Reload integrations indiviudally

Would be nice to be able to reload/restart individual integrations after having made a change to the configuration, instead if having to reload the entire configuration.

Also, if an integration fails, or happens to only do discovery on startup, the ability to re-load or restart integrations would be very helpful.

This could lead to never having to re-start unless there is an upgrade also (perhaps).

Yes I agree, if possible, this would be nice, especially when debugging integrations.

Mentioned this here:

1 Like

Being worked on as we speak :smile::+1:

5 Likes

I’ll also second this. I run zoneminder on the same server as HA, if I need to restart the box, then the zoneminder config doesn’t load until I restart HA.

Both are now merged!

1 Like

Is the reload also exposed via a service call? (cannot find it)

1 Like

This would really help me out as well.
Either service call or a python script?

I don’t believe there’s a service call for that currently. However it is possible via an API call.

If you look at the code for the tests, it’s called via :

client.post(
        f"/api/config/config_entries/entry/{entry.entry_id}/reload"
    )

I’m not sure how you would write code that can interface with the API to make this call, but it seems possible at least.

Ok, thanks. Couldn’t wait and looked, and it is reload via an URL like:
POST /api/config/config_entries/entry/691c716d001011eba8bd99c0f2866538/reload HTTP/1.1

Tricky thing is to find the “691c…” id, that seems to be only in the .storage directory. As long I don’t delete the config entry, the id should stay the same :wink:

Can you help and show an example.
How exactly You trigger this URL?
Thanks.

If you got the URL, you can use CURL to execute it. If you want HA, put the following in your configuration (the api token you need to add to the secret file):

rest_command:
  reload_sms:
    url: http://192.168.1.1:8123/api/config/config_entries/entry/691c716d001011eba8bd99c0f2866538/reload
    method: POST
    headers:
      authorization: !secret ha_api_token
1 Like

Hey,

Is there already a Service to call ?
Like integration.reload or something else ?

No … That’s why we need to resort to such REST API call.

1 Like