Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 96121

Need sanity check of ideas on entities for device frequently suspended

$
0
0

@treydock wrote:

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

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 96121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>