#Homeserver automatic turn on when detected Ethernet
1 messages · Page 1 of 1 (latest)
What is the home server?
- 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
- name: "HAOS Ethernet Connected"
- 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
- platform: state
- 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.
- platform: state
How should home assistant turn itself on when it's not running?
It is running but you are right it can not turn back on
But doesn't that work over the Fritz Box?
Why do you even want to power it off in the first place? It's a server, it should run 24/7
Cause in the night my WiFi is down
You shouldn't run servers over wifi. Plug it into the fritzbox via ethernet cable
I have done that