WoL Binding To Turn Windows PC On and Off

Hi

I am trying to use the WoL (Wake on LAN) binding to turn my Windows PC on and off from my Raspberry PI based OpenHab instance.

I’ve got the power on working by creating an item as follows:
Switch Network_OpenhabWebsite “openHAB Web3” (Status, Network) { wol=“255.255.255.255#XX-XX-XX-XX-XX-XX” , autoupdate=“false”}

Where the XX etc is the MAC address of my PC and the 255 etc the Broadcast IP - the site below was very helpful in working this out. This creates a switch which starts my PC.

https://community.openhab.org/t/remote-shutdown-and-start-windows-10-pc-with-any-kind-of-binding-script/28692/3

Good so far - if you are trying to do this hopefully this helps you!

I’d also like an OFF / shutdown switch.

I’ve tried the format given in the binding [here](http://Switch networkPC “Computer” (network, gOGBuero) { wol=“192.168.10.255#00-DE-AD-BE-EF-00”, exec=">[OFF:shutdown -s -m \\192.168.10.23 -t 0 -f]" }) and a few variations on the theme.

If I try from the PI command line get an error:

Could not connect to server 192.168.1.161
The username or password was not correct.
Connection failed: NT_STATUS_LOGON_FAILURE
Could not connect to server 192.168.1.161
The username or password was not correct.
Connection failed: NT_STATUS_LOGON_FAILURE

The posts
here
and
here
by @es7zero @Udo_Hartmann and @HGBAXXTER respectively seem to have cracked it but I can’t work it out!

Can anyone help?

You also have follow these instructions to enable the Windows Machine to accept remote shutdown commands. (Especially the part beginning with “Part A) On the Windows machine:”)

Hope it helps!