Reload Entity If Devices Become Unavaialbe

I have 2 android devices in the androidtv integration setup in my HomeAssistant. On occasion both devices become unavailable. If I reload the device it goes back to normal.

Is there a way to automatically reload the device if the state of that device becomes “unavailable”?

I can read the device state with {{ states('media_player.epson_ls800') }}, but how to I automatically reload it if it equals “unavailable”?

https://www.home-assistant.io/integrations/homeassistant/#service-homeassistantreload_config_entry

Does homeassistant.reload_config_entry know when the device becomes unavailable to reload it?

No. It is just a service to reload it. You have to automate it. e.g.

trigger:
  - platform: state
    entity_id: media_player.epson_ls800
    to:
      - unknown
      - unavailable
    for:
      minutes: 3
action:
  - service: homeassistant.reload_config_entry
    data:
      entity_id: media_player.epson_ls800

Got it. I will try this. Hopefully it will work. Thank you!