Hibernating a windows PC from a Pi3

Hello everyone

Im trying to figure out if it is possible to “Hibernate” not shut down a windows 10 pc from a pi3

I already know about this command that you can run from the terminal
net rpc shutdown -I 192.168.X.X -U user%password
Which will shut down the remote windows pc but I want to Hibernate it so that I can lift off from what I was last working on and also windows 10 does not support WOL when shut down so hens the Hibernate.

for the moment i’m leaning towards this not being possible (the fault lying with windows) but would love to be proven wrong so i could implement this into a script on home assistant and have lot of home automation goodness going on :slight_smile:

I have a weird solution that has been working for me so far. I’m not sure why my mind went in this direction but hey…

My windows 10 pc is basically a kodi media player on startup for the bedroom tv.

switch 3:
  - platform: command_line
    switches:
      pc2:
        command_off: "curl -X POST http://192.168.1.50:8078/jsonrpc -d '{\"jsonrpc\":\"2.0\",\"method\":\"System.Hibernate\"}' -H \"Content-Type:application/json\""
        command_on: switch.wol_bedroom

  - platform: wake_on_lan
    mac_address: "00:11:DD:00:00:99"
    name: "wol_bedroom"
    host: "192.168.1.96"

  - platform: template
    switches:
      copy3:
        value_template: '{{ states.switch.wol_bedroom.state }}'
        turn_on:
          service: switch.turn_on
          entity_id: switch.wol_bedroom
        turn_off:
          service: switch.turn_off
          entity_id: switch.pc2

For this KODI would have to be running with all the network settings in working order. I now have a switch which turns on the PC via Wake over lan and also puts it back down to hibernate. This may not work for you but I thought I would share.