Mqtt switch pc on windows 10


openHAB 2.5.10 Release Build

I want to use the built-in mqtt broker and the button in sitemaps to turn on and off pc with windows, preferably with feedback (if a switch came through mqtt, then the switch changed its position in sitemaps, and vice versa - if the switch was turned off in sitemaps, then in mqtt the topic was “off”)
How can i do this?

That broker was abandoned years ago. People here not tend to use mosquitto broker.

have a little experience with mosquitto broker, how to implement this functionality through it? (mosquitto broker is also installed on the server with openhub2 …)

i think i can use the line “Switch networkPC” Computer “(network, gOGBuero) {wol =” # 00-DE-AD-BE-EF-00 “, exec =”> [OFF: net rpc shutdown -C MESSAGE -I -U USER %% PASSWORD -f -t 120] "}
" from
But, how to add control via mqtt to this?

To turn it on you need to send a wake up packet through the network

Here’s a solution that uses IFTTT. It just sends commands to an app running on your Windows computer. I use it to put my PC to sleep when I leave or go to bed, and it’s very fast.

You can’t use it to turn a PC on, though. As @denominator said, you’d need a wake-on-LAN function to do that, and I’m not sure if anyone has accomplished it here.

If you want confirmation that the PC is turned off, you can use the network binding to determine if the PC is connected to openHAB.