Can I write an automation to reload/restart an integration?

I ended up switching to Meross LAN, which entierly solved it.

Some of my integrations also need reloading from time to time (Wiser, IKEA) and I’m really interested in a solution to this. Am thinking a button to reload a specific integration and an automation to “press” that button.

+1 for integration reload

+1, I have the issue where zwave stuff stops working on upgrading the integration.

I need to restart MQTT and then Zwave and want to do that on server restart, since for some reason a restart is not enough :slight_smile:

EDIT:
Just noticed it now exists, Call service “Restart Add-ON”.

I believe integrations are different from addon’s. Restart Add-on has been available for a while.

I don’t think there is a service to restart Integrations.

I frequently need to restart the Home Connect integration. I’m using the Reload Config Entry service twice a day now, and I’ve not needed to restart the integration itself since implementing this. You might be able to use Reload Config Entry in a similar way - it’s worth a try.

1 Like

I had troubles with my tuya integration. Somehow the temperatures shown only were correct in the first moments after a restart or reloading the config. After that the temps were way off so scripts to set the temp on my floor heating were firing at the wrong temps. Since I couldnt get a fix on the temps and it wasn’t a fixed offset that needed to be applied I now use a reload script like mention above by @arrows and it looks like this:

alias: Reload Tuya integration every few minutes
description: ''
trigger:
  - platform: time_pattern
    minutes: '1'
condition: []
action:
  - service: homeassistant.reload_config_entry
    data: {}
    target:
      entity_id:
        - climate.ty88632848c82xxxxxx
        - climate.ty4220004198f4xxxxxx
mode: single
6 Likes

There does appear to be one, but it restarts all of them. Call Service → Home Assistant Core Integration: Restart

Looks like I’m not the only one affected by Tuya stalling. :smiley: Same issue brought me here, thanks a lot for the tip. Mine is with doors sensors stopping to report statuses though.

I’m afraid I have that problem as well. It seems to be a seperate problem from the Tuya issue, since my door sensors (aqara) connect to a Conbee II dongle, and I use a couple of IKEA range extenders to increase the range. Works most of the time, but one of the least used doors sometimes just goes unavailable. So annoying.

Same here, im looking into way to restart the Tuya service as my device status stops updating after about 8 hours

Check out my workaround here, does the job perfectly for me:

1 Like


:man_shrugging:

This will restart Home Assistant, which is probably fine in the middle of the night, when you are typically ok about having the system out for a couple of minutes (although I would definitely add a “Party mode” helper to suspend the execution when I have guests at home).
As I understood, the point here was about restart an integration everytime some specific sensor (or a number of sensors) is unavailable, which is OK to happen a few times during the day as this probably will cause unavailability of a few sensors for just a couple of seconds (and not minutes) and will fix the problem right at the time it shows the first symptoms.

+1 here to reloading an integration. In my case it’s for the Deako lights that seem to just stop responding after midnight. No idea why, bugs already submitted but the integration is mostly dead at this point. The most annoying part is the integration doesn’t even return ‘unavailable’, it’ll say a light is on when in fact it isn’t. The Deako integration seems to falsely report back the status of lights until you reload it and then it’s fine.

That is not a core integration is it?

Unfortunately not, it’s a custom integration as the company does not officially support HA but the folks that built it aren’t particularly active either.

homeassistant.reload_config_entry

Yes, this is the right service to load the integration. I use it for UniFi integration that doesn’t load by itself after updating Home Assistant, and integration clients aren’t at home, which causes problems when people are at home.
Hopefully the automation will work properly .

alias: "Po Restartu Home Assistant "
description: |-
  provede po restartování HA
  - znovu načtení integrace UniFi
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - service: homeassistant.reload_config_entry
    data: {}
    target:
      entity_id: update.unifi_network_application_update
mode: single

1 Like

Thank you, this was the solution to auto-recover my Tractive integration.