#Homeserver automatic turn on when detected Ethernet

1 messages · Page 1 of 1 (latest)

modern flower
#

Is it possible to turn the home server on when ethernet detected and off when there is nothing?

orchid gulch
#

What is the home server?

modern flower
#
  1. Template Binary Sensor for Ethernet Status:
    template:
  • binary_sensor:
    • name: "HAOS Ethernet Connected"
      state: >
      {{ states('sensor.network_interface_eth0_ipv4_address') not in ['unavailable', 'unknown', 'none', ''] }}
      device_class: connectivity
  1. Automation for Shutdown:
    automation:
  • alias: "Shutdown HAOS when Ethernet disconnected"
    trigger:
    • platform: state
      entity_id: binary_sensor.haos_ethernet_connected
      to: 'off'
      for:
      minutes: 5
      action:
    • service: hassio.host_shutdown
  1. Automation for Wake-on-LAN startup:
    automation:
  • alias: "Wake HAOS when Ethernet reconnected"
    trigger:
    • platform: state
      entity_id: device_tracker.haos_server # Replace with your HAOS device tracker from router
      to: 'home'
      condition:
    • condition: state
      entity_id: binary_sensor.haos_ethernet_connected
      state: 'off'
      action:
    • delay:
      seconds: 10
    • service: wake_on_lan.send_magic_packet
      data:
      mac: "XX:XX:XX:XX:XX:XX" # Your HAOS MAC address
      broadcast_address: "192.
modern flower
orchid gulch
#

How should home assistant turn itself on when it's not running?

modern flower
#

It is running but you are right it can not turn back on

#

But doesn't that work over the Fritz Box?

orchid gulch
#

Why do you even want to power it off in the first place? It's a server, it should run 24/7

modern flower
#

Cause in the night my WiFi is down

orchid gulch
#

You shouldn't run servers over wifi. Plug it into the fritzbox via ethernet cable

modern flower
#

I have done that