Shutdown of PC

Hi,

i am just starting with Openhab and i have one need.
I want to shutdown my Windows 10 PC from OpenHAB.

So for example if i set a status, that i go to sleep i want openhab to shutdown my pc.

Does anyone have an exaple how i can do that…
And maybe next step can be to send a wake on LAN package to the pc, so maybe you also have a solution for this too.

First stepp sould be to use the search function
Windows PC remote control (Shutdown, …)
etc.

You could also use the exec binding.

Here’s an example from my configuration. I also used the network binding.

Switch PC { channel="network:pingdevice:pc:online", wol="192.168.0.255#94-DE-80-C4-XX-XX", exec=">[OFF:net rpc shutdown -C MESSAGE -I 192.168.0.5 -U username%%password -f -t 0]" }

If your Firewall is active, you have to configure it.