[SOLVED] Remote shutdown and start Windows 10 PC with any kind of binding/script

Hello out there, i am a new beginner to openHAb project.

I´m happy that now my shutter and light configuration is working but now i have a problem with Remote Control of Windows 10 PC.

My goal is to remote shutdown and start 2 Windows 10 PC´s (start maybe with windows login if possible would be great) from openhab

Openhab 2.1 snapshot is running on Synology NAS

maybe you have an answer for me to get this done. tried serveral guides and solutions but none is working
tried with wol and exec binding also with mqqt und winthing but doesn´t work.

does anyone has another solution (searching for almost 5 days through internet)

thanks in advance for helping

WOL should work as this is the only option when a PC is shut down, but you have to configure your Windows PC accordingly.

  • First you have to enable WOL in BIOS or UEFI,
  • second is, you have to enable WOL in Windows itself (for a specific Interface). In question of Login, you will have to configure autologin in windows.

After that part is configured, please try WOL, maybe using an App or the Interface of your router, you even can use etherwake to trigger WOL from a GNU/Linux console.
If you had success, try WOL from OH

Switch MyWOLSwitch "Windows PC" {wol="192.168.1.255#00:1f:d0:93:f8:b7"} 

where 192.168.1.255 is the broadcast address of your LAN and 00:1f:d0:93:f8:b7 is the MAC of the WOL enabled interface.

For shutdown, I think, you will have to use a script and a little service at the windows machine, I’m not aware of ‘official’ commands.

i have a android Wake on Lan app and it works it can start windows from any situation shutdown hibernate and so on

i sniffed the packets with wireshark on the network interface i can see clearly the magic packet WOL

so gladly windows and bios is configured now to work correctly.

wol binding installed in OH

but its still not working. i can see the traffic the arp request and everything but there is no clearly magic packet sent.

if i turned off only magic paket at the network card energy setup it is working but only from hibernate not from complete shutdown. but the side effect is that every ping/arp every network command from any device now starts the pc.

so there must be only MAGIC PACKET turned on

are there different versions of the wol binding in paperui i only find wol 1.10 snapshot not explicit a OH 2 binding

No, there is no OH2 wol binding.
As wol works as expected for me, which version of openHAB exactly do you use? How did you install? Which OS?

openhab 2.1.0.4 snapshot running ond synology nas dsm 6.1

installed with spk package center of synology

siemens plc logo binding and also network binding works perfect

but yeah i am thinking i can be a problem with maybe synology nas maybe rights problems but i dont have any log or i didn´t find it only have openhab.log and events.log

on Oh Log i have following:

[INFO ] [nhab.binding.wol.internal.WolBinding] - Wake-on-LAN packet sent [broadcastIp=10.0.0.255, macaddress=bc5ff454fb12]

pc has exactly this mac adress and this ip 10.0.0.99

so as i unterstood the binding it only post this info to log if its working. and yes somehow its working but it does not send the “magic packet” it sends useless traffic with tcp protocoll (sniffed with wireshark)

I did not wireshark my system but at least my yavdr (GNU/Linux) systems do wake up if I use wol binding, and these systems do not wake up through ping…

i compiled my own wake on lan in java put it on synology nas and now i see the magic packet when i start i with root in cmd line

if i start it with OH its the same as the WOL binding packets coming but wrong information and wrong port

it seems to be a right problem or maybe i only can send this with root rights.

i am thinking of port problem. WOL needs port 9 and if i am thinking right only root or admin can open this port on linux (or DSM)

so i am still trying to find a solution

Yes, you do need privileged rights, but as I don’t run openHAB as root, I don’t think this is a general issue, but belongs to Synology implementation.

the problem is fixed. solution was to put the user openhab to the user group admin. now WOL works with the binding although with exec and own Java compiled WakeonLan class