Hibernate and Wake up your Windows PC

A neat way of doing this from Linux to Windows 10 is using OpenSSH in Windows The ON being provided by regular Wake-on-Lan.

- platform: command_line
  switches:
    jon_hibernate:
      command_on: "ssh jon@hostpc1 shutdown.exe /h"
    doe_hibernate:
      command_on: "ssh doe@hostpc2 shutdown.exe /h"
- platform: template
  switches:
    pc_doe:
      value_template: '{{ states.switch.doe_pc.state }}'
      turn_on:
        service: switch.turn_on
        entity_id: switch.doe_pc
      turn_off:
        service: switch.turn_on
        entity_id: switch.doe_hibernate
- platform: template
  switches:
    pc_jon:
      value_template: '{{ states.switch.jon_pc.state }}'
      turn_on:
        service: switch.turn_on
        entity_id: switch.jon_pc
      turn_off:
        service: switch.turn_on
        entity_id: switch.jon_hibernate
2 Likes