Restart / Reload Integration with an automation?

Is there an easy way to reload an integration through an automation?

I have a Sure Petcare integration which works 95% of the time, but occasionally it stops and I find that a restart of the integration solves the issue.

This is important as it allows my cats out in the morning and stops them going out at night.

I currently have a notification flow where as it tries three times over 15mins and if it still fails it drops me a notification, but if I’m away etc I might not catch it

In these scenarios the reload (so far) has worked every time
Can anyone advise how this action can be automated?

Thanks

This is how I have.done it.

Awesome - thank you - will give that a go!
Is there any way to confirm it’s restarted?
(I just tested and watched the UI but you I didn’t seem to get the confirmation which probably relies on the UI interaction)

I used a node-red events: state node to listen for a state change on one of the devices entities. If the entity went unavailable, I reloaded the integration.

Here is the node-red code I used to reload my Honeywell integration:

image

[{"id":"785242a0724243c8","type":"api-call-service","z":"fe1a8042.af255","name":"Reload Honeywell","server":"","version":7,"debugenabled":false,"action":"homeassistant.reload_config_entry","floorId":[],"areaId":[],"deviceId":[],"entityId":["climate.home_heat"],"labelId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","blockInputOverrides":false,"domain":"homeassistant","service":"reload_config_entry","x":310,"y":1040,"wires":[[]]},{"id":"8314a70fcf03e689","type":"server-state-changed","z":"fe1a8042.af255","name":"Honeywell Unvlbl","server":"","version":6,"outputs":2,"exposeAsEntityConfig":"","entities":{"entity":["climate.home_heat"],"substring":[],"regex":[]},"outputInitially":false,"stateType":"str","ifState":"unavailable","ifStateType":"str","ifStateOperator":"is","outputOnlyOnStateChange":true,"for":"5","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":100,"y":1040,"wires":[["785242a0724243c8"],[]]}]

Please note: this was a temporary fix - Integrations should not have to be reloaded if they are working properly. I tried to provide as much information to the integration developer via a GitHub issue to get the integration fixed. The Honeywell integration was fixed and I don’t need this flow anymore (I keep it around as an example).

1 Like