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:

6 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)

2 Likes

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
3 Likes

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.

2 Likes

Is this something that I can use already?
My IKEA integration i have to reload every time. At least once a day if it isnā€™t more.

1 Like

So this is properly annoying me. I canā€™t see why its not working at all, it appears to be something wrong with authentication, but I canā€™t see whatā€¦

https://10.n.n.n/api/config/config_entries/entry/a43bfad89c4487c518270203fb3b995a/reload

With

authorization xxx (long live access token)

In the header but I just get a 401 or 403 for http & https.

Iā€™m running https on 443 (not 8123) using lets encrypt.

In the HA log I get

Login attempt or request with invalid authentication from 10.n.n.n

Iā€™ve got api: in configuration.yaml

Really stuck now.

I got it working. See my post in a different topic with an example:

  • Feels like there should be a ā€œreloadā€ menu option that uses this on every integration in the UI
  • A native service call that can be called via automation not a just a REST call.
  • Even better would be for there to be some form of native recovery option you could set for ALL integration to try and restart them at least once automaticly.

I have about 3 external services ā€œOmbiā€, ā€œUnifiā€, and ā€œIkeaā€ that seem to break frequently and it is JUST because the service missed one poll or the service was not available on HA reboot.

1 Like