Add service integration.reload

Agreed. That’s exactly what I was trying to figure out. I’ll probably have to make a script or automation based off of a template that monitors entities that go unavailable for “x” period of time. Then use another template in the action to pull the entities id and run a Home Assistant Core Integration Reload All. Basically running a reload of all yaml configuration without restarting the entire box.

I usually don’t have too much of an issue as I already have a daily simple reboot and weekly database purge and full system restart occur.

1 Like

Reloading all integrations is basically a restart.

There is a homeassistant.restart service.

What is this sporadic issue?

1 Like

A purist would say, “Don’t do that, find the root of the issue!”, but we have to live in the real world!

1 Like

The issue is mostly with the Tuya, VeSync, & Overkiz integrations, but sometimes also with Hue.

Every few weeks some device(s) stops following the scheduled automations. More often than not, reloading the integration once resolves this issue.

This is not a reauthentication problem.

I’d rather not restart the whole thing if i can get away with it, but If necessary I could schedule a 3am reboot weekly. (I’ve had problems in the past with scheduling reboots bricking my whole system so im fairly reticent to go that route.)

With so many integrations giving you issues this is more likely a networking issue. I’ve never read of issues with the Hue integration on the forum (even though I don’t use it).

Perhaps, but I already attempted to find a correlation with network issues. No Dice.

Hue has problems so infrequently but I added it to my list for completion purposes.

Thanks, this helped me out reload the efergy (power monitoring) integrations whenever the sensors decide to go unavailable.

See the following post where I try to come up with a way to do this in lovelace with a card & a script. Integration Reload w/Card & Script - no luck so far. I may have missed it above but the service call with an entity_id does not seem to support templates for the entity_id.

Please do this feature.

After a power outage, some integrations stop working so this feature will be amazing … as I don’t need to check if they work or not.
Some integrations require a reload from time to time.

It’s already available on many integrations.

What’s about the homeassistant.reload_config_entry action?

nevermind, this was already posted multiple times above :see_no_evil:

1 Like

I’m using node-red to do this by leaving the entity_id empty and writing the entry_id in the data field.

This type of comment does not help; worse, it is misleading.

The majority of integrations cannot reload programmatically (using actions that can be used in automation); some examples of integrations that I’m using that don’t have this capability are Broadlink, Ecoflow-cloud, Landroid-cloud, Midea Smart AC, Roborock, Smartthings, Watchman and many more; like 99% of all integrations.

Please do your research before chastising people for “unhelpful” comments.

Even though you listed mostly custom integrations (not made by HA), every single integration you listed can be reloaded with an automation using homeassistant.reload_config_entry action.

This action reloads the broadlink integration.

- action: homeassistant.reload_config_entry
  target:
    entity_id: remote.bonus_room_remote

Every integration that is set up in the UI can be reloaded with this service.

The yaml heavy hitters (Most used) can all be reloaded with their own service.

At this point, the only integrations that cannot be reloaded are old yaml integrations that haven’t seen updates in years.

3 Likes

I get your point; however, you are missing my point.

To reiterate, I want (and I’m not alone) a way to reload an integration.

Currently, what is available is helpful, but it has a couple of flows, such as the need to specify all the entities/devices related to integration.

I would expect something like this:

action: homeassistant.reload_integration
target:
  integration_id: smartthings

This will allow us to write feature-proof automation; whenever a new device is added or removed, the automation doesn’t need to be updated.

No. You just use a single entity from the integration and it will reload the entire thing. If you have multiple integrations of it, then you’d need multiple entities.

Hmm, maybe it is a bug in that case; I just retested (now) using:

action: homeassistant.reload_config_entry
data: {}
target:
  entity_id: switch.0_lv1_power_outlet_1

this being an entity part of the HomeKit devices. Only that entity was reset, not even all entities part of the same device. All the other devices from the HomeKit devices list have not been reloaded.

To reiterate, even if this will work … this is not a future-proof solution as when this entity is deleted you will need to update the automation.

It depends on the integration, if each device creates a separate instance of the integration, then you’d need to add all the devices. But that doesn’t make any sense because they’d have a different connection and there’d be no reason to reload them all if you’re having issues with 1.

Did you read the link I posted? I don’t think so, you can also use the entry_id. You don’t need to use entity_id, you can use anything target accepts.

I’ve read the documentation, however; you are missing my point or unwilling to understand what I’m saying.

When an issue happens it happens with one or multiple integrations (for example after a power outage). I rarely had issues with only one device.

For the stuff that is working on Home Assistant, please consider adding the ability to reload an integration that is based only on an integration identifier.

I’m not missing the point, you keep moving the bar even though you can do exactly what you’re saying. You can reload integrations, entry_id is akin to integration name.

After a power outage, I have 3 integrations that need to be reloaded because they don’t recover, guess what I use? This service with 3 entry_ids.

Sorry that the current implementation doesn’t meet your standards.

Here’s a script that will reload all config entries associated with an integration.

reload_integration:
  alias: Reload an entire integration
  mode: parallel
  fields:
    integration:
      description: Integration
      selector:
        text:
  variables:
    entities: "{{ integration_entities(integration) }}"
  sequence:
  - condition: template
    value_template: "{{ entities | count > 0 }}"
  - action: homeassistant.reload_config_entry
    target:
      entity_id: "{{ entities }}"

using it…

action: script.reload_integration
data:
  integration: smartthings

or if you want to reload just a specific config entry without needing to know the entry_id…

reload_config:
  alias: Reload an instance of an integration
  mode: parallel
  fields:
    entry:
      description: Config to reload
      selector:
        config_entry:
  sequence:
  - condition: template
    value_template: "{{ entry is defined and entry }}"
  - action: homeassistant.reload_config_entry
    target:
      entry_id: "{{ entry }}"

Both usable from the UI.

3 Likes