Detect when integration is or goes offline

My Rinnai integration for my water heater sometimes goes offline. It can be fixed with a simple service call to homeassistant.reload_config_entry. How can I catch when the automaton is offline or goes offline?

trigger:
  - platform: state
    entity_id: # your entity here
    to: unavailable
3 Likes

Beautiful, Ty