I left my apartment over the weekend and just now saw that my PC seems to be active (thanks to the network binding). Does anybody know of a good way to remote control a Windows (10) PC?
I would prefer a dedicated solution. A small application to install on a PC which will then provide some kind of REST interface for all kinds of tasks like shutting down or restarting the PC, starting Kodi, etc.
I just use the exec binding which runs a little script:
net rpc shutdown -f -I 10.x.x.x -U PCXX\Username%password
Obviously, I’ve made it a wrapper and arguments are supplied from the command issued, but this is the important bit. For added HAB-fu, you could also add ICMP ping monitoring and use a Switch item with Wake-on-LAN to turn the computer on and the command above for shutdown. The WoL binding is very easy to implement, and most desktop machines support it.
Thanks for your answers. net rcp is something I already looked into but it’s rather limited and functionality is different between Windows versions, a user with password is needed (I think to remember), …
Anyhow, I’m hoping to find a more modern and straight forward way to control my different systems without the mess of dealing with Windows. A HTTP / REST Interface with configurable options would be amazing. Something has to be available!? Curiously I was not able to find a good solution.
Maybe I’ll have to install an SSH server… still not the set-ready-go solution I’m looking for.
indeed, I was referring to the setup in which you run OpenHAB on Linux, and ‘control’ the shutdown of a Windows computer. Likewise, I use a shell script which ssh’es into Linux workstations to shut them down.
Thanks for your answers. net rcp is something I already
looked into but it’s rather limited and functionality is different
between Windows versions, a user with password is needed (I think to
Actually, it’s net rpc, as in Remote Procedure Call. Yes, on Windows this is (as far as I know) since NT always a an authenticated action. I think the reasoning for that design should be pretty clear.
Running an SSH server on Windows is possible, and from there you can hack just about anything together with tools ranging from PowerShell to KiXtart to batch files, etc. Some applications expose their own interface for remote control purposes like Media Player Classic, VLC or some Bittorrent clients. If I am not mistaken, the SSH service will also require an authenticated login, though.
I’m not a kodi user, I use a heavily modified Freevo system in a custom ‘media center system’ that I wrote and built a while back, but if I’m not mistaken you can add just about any command to kodi, and operate kodi via HTTP commands. That should cover everything you need, no?
Guys, I’ve found a satisfying solution to my initial question:
I’m utilizing MQTT (which is quite nice as a protocol already widely used in the home automation area). “WinThing” is an MQTT client developed in Java to receive all kinds of Windows system commands, including executing a command, opening a URL or shutting down the system. Have a look:
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 mqqt and win thing.
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 is running on Synology NAS
Here are the steps i´ve already done. only to be sure thats the right way.
I have installed mosquitto-1.4.11-install-win32 on one of the Windows 10 Pc´s only one first to test (i found a guide i copied the dlls and everything seems to be running fine. It also starts as a Service should work perfect.
Then i start the Winthing.jar manually through windows cmd console (first afterwars it will work automatically)
Hey! As always when dealing with MQTT you should use an mqtt client on another device to debug the communication betwen your devices. For PC i can recommend mqtt-spy, for android or iOS you’ll also find apps. Use one of these to troubleshoot the communication.
First thanks for the given solution!
I think i done every step like you guys but it seems that i got an problem with the rules above.
Here are the steps i´ve done. Installed and configured mosquitto as broker on my raspberry. As client i tried to use my Windows10 PC, with winthing service. Inside openhab i´ve configured items, sitemap and rules like @ThomDietrich. So far so good.
The connection between mosquitto and my winthing clients works fine! I´ve tested the connection with MQTTlens application from chrome and was so able to send and execute commands on my Windows10 Client. Perfect!
The only thing that doesnt work is the execution from openhab. My log for the rule:
2017-07-06 10:20:31.886 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'PC Command': An error occured during the script execution: The name 'publish(<XStringLiteralImpl>,<XStringLiteralImpl>,<XStringLiteralImpl>)' cannot be resolved to an item or type.