Need sanity check of ideas on entities for device frequently suspended

I am fairly new to Home Assistant and am working my way towards a complete config. I have setup Plex and Sabnzbd integrations but the issue I’m facing is the host that runs these services is my power hungry desktop and is frequently suspended to save power and avoid needless hard drive wear. If I restart HA while my desktop is suspended then the states for Plex and Sabnzbd disappear which is a problem as I’ve setup automations that when plex watched state changes to 0 the desktop is suspended if not being used. I’ve hacked around this situation by setting up an automation to restart HA when my desktop begins to respond to ping via binary sensor for ICMP to ensure sabnzbd and plex integrations are functional.

Is there a better approach to handling entities for services running on a device that isn’t always on?

In case it helps to see, these are the automations I’m working with:

- alias: 'Turn on compute'
  trigger:
    - platform: state
      entity_id: binary_sensor.desktop_ping
      to: 'on'
  action:
    - service: script.restart_ha
- alias: 'Turn off computer when idle'
  trigger:
    - platform: state
      entity_id: sensor.desktop_ssh_connections
      to: '0'
    - platform: state
      entity_id: sensor.plex_desktop
      to: '0'
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: sensor.desktop_ssh_connections
        state: '0'
      - condition: state
        entity_id: sensor.desktop_active
        state: '0'
      - condition: state
        entity_id: sensor.plex_desktop
        state: '0'
      - condition: or
        conditions:
          - condition: state
            entity_id: sensor.sabnzbd_status
            state: 'Idle'
          - condition: state
            entity_id: sensor.sabnzbd_status
            state: 'Paused'
  action:
    service: switch.turn_off
    data:
      entity_id:
        - switch.desktop

I suggest buying a RPi or an Intel NUC depending on your needs. Home assistant should be running on an always on machine. Especially once your sytem also conteols lights etc. Just my two cents…

Home Assistant is on a RPi4, it’s just sabnzbd and plex that are on my desktop and HA is trying to watch those services which are sometimes suspended.

Sorry, I reread your post and completely misunderstood your request.
Do the sensor reappear when the desktop is running again or they stay unknown/unavailable?

As best I can tell if HA is running then the desktop goes to sleep the sensors remain present but show unavailable and recover when the desktop turns back on. If I restart HA while the desktop is suspended the sensors disappear completely and never come back until I restart HA while the desktop is running. To automate that part I have an automation that restarts HA when my desktop begins to respond to ping via ICMP binary sensor.

This works just wasn’t sure if there was a better way like some kind of dependency where I could say “entity_id X requires entity_id Y in order to respond to requests” or something along those lines where the state of one sensor would rely on the state of another sensor. Also wasn’t sure if it was normal for HA to lose a sensor if it’s down when HA is restarted and not rediscover the sensor upon recovery. Could be maybe I haven’t waited long enough.