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

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.

1 Like

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

2 Likes

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

same here. Thanks for your thoughts!

Is there any way to reload UI integration i have problem in Tuya integration
I notes after reloaded it back working as normal,
thanks

Yes, call the service homeassistant.reload_config_entry

1 Like

thanks, but this for individual entity
Is there a way to Full reload the integration ?

Reloading the config for one entity also reloads the config for its integration

top Thanks for the info

This does not seem to work for Adax integration. Reloading it with target as one entity fails to bring the integration online if there is an issue. Yet, reloading it from the integrations page works, but this does not help with my automation. Is there anything I can do?