Node Red flow to reload an integration

My Garage Doors are controlled via the MyQ Integration. Often times, they make themselves ‘Unavailable’, after which I manually reload the integration, and the entities show their states correctly. I would like to create a flow in NR, which reloads integration automatically, upon state change to Unavailable. What is the service call to reload an integration via NR?

https://github.com/home-assistant/core/blob/82746616fa92abc89a3a2b2e692c50ed4df2f97e/homeassistant/components/config/config_entries.py#L99

You can use the API node to make an HTTP post to that URL. The entry_id can be found by viewing the integration you want to reload in the integrations UI and it will be in the URL, config_entry=dc604....

Thanks! You got me at how to find the Integration ID. Can you please elaborate a little?

From the Home Assistant UI > Configuration > Integrations > Find Card MyQ card > click on either X devices or x entities

The URL of your browser should be something like

https://example.com/config/devices/dashboard?historyBack=1&config_entry=e91c2fcc771448eeb33748779fa16e85

the e91c2fcc771448eeb33748779fa16e85 would be the entry_id

I got the Entry ID. Now I have to build the API. Thanks!

Hey @Kermit, me and my friend are doing our best to follow this solution, we are noobs at this. What would the app call node look like completely, haha we are struggling.

image

[{"id":"56605b12.999ff4","type":"ha-api","z":"ffbd7f06.4a014","name":"","server":"","version":1,"debugenabled":false,"protocol":"http","method":"post","path":"/api/config/config_entries/entry/119c8582e5953ff5e572ece7d30cabf4/reload","data":"{}","dataType":"jsonata","responseType":"json","outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"results"}],"x":338,"y":2032,"wires":[["86fdf85a.609228"]]},{"id":"fc6e3e67.4b4a7","type":"inject","z":"ffbd7f06.4a014","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":172,"y":2032,"wires":[["56605b12.999ff4"]]},{"id":"86fdf85a.609228","type":"debug","z":"ffbd7f06.4a014","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":502,"y":2032,"wires":[]}]
7 Likes

I think this might be easier now than it used to be. Not sure. But this worked for me on 2022.10.4: curl -X POST https://YOUR_HASS_HOST/api/config/config_entries/entry/YOUR_ENTRY_ID/reload -H 'authorization: Bearer YOUR_AUTH_TOKEN'

Easiest way to get these details might be from a dev console in your browser, check the network tab and grab out the relevant bits. You could throw something like this into your HASS crontab too, in order to restart on a schedule. But the token will eventually expire so it’s not a very stable solution. Correction: use a long lived token instead: Authentication - Home Assistant.

Hello Kermit,

Unfortunately I only get a 404 error with this API call. I think the call actually looks good. What could be there? Any idea?

Bildschirmfoto vom 2023-11-02 15-52-01

I use a different method and I believe this one is way easier.
You can simply set up a call service node with:

domain: homeassistant
service: reload_config_entry
Data: {“entry_id”: “xxxxx”}

where xxxxx is the id of your integration

2 Likes