# Loads default set of integrations. Do not remove.
default_config:
# Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes
# Include automations, scripts, and scenes
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
# Enable Wake-on-LAN integration
wake_on_lan:
binary_sensor:
- platform: command_line
name: "johpc_online"
command: 'nc -w 3 192.168.178.165 22'
value_template: >-
{{ 'SSH' in value }}
scan_interval: 30
# Template switch to control the PC
switch:
- platform: template
switches:
johpc:
friendly_name: "johpc"
value_template: "{{ is_state('binary_sensor.johpc_online', 'on') }}"
turn_on:
service: wake_on_lan.send_magic_packet
data:
mac: "9C:6B:00:8E:1C:88"
turn_off:
service: pyscript.shutdown_pc
Manually running the command does work.