I have an Integration, that fails regularly, and a reload fixed it, so I created this automation:

alias: "Auto Reload Affalddk Integration"
description: "Reloads the integration if the sensor stops reporting"
trigger:
  - platform: state
    entity_id: sensor.affalddk_rest
    to: "unavailable"
    for:
      minutes: 5
action:
  - service: homeassistant.reload_config_entry
    data:
      entry_id: "***********"


To find the Inegrations entry_id:


Go to Settings > Devices & Services.

Click on the integration you want to automate.

Look at the URL in your browser.

The Entry ID is the string at the very end of the URL.

Example URL: .../config/devices/dashboard?config_entry=az45**********...

The ID is: az45**********...