Hey guys,
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.
How about Unified Remote?
Itās an app for Android that allows you to control various devices (like Windows machine).
You simply install server app on PC and youāre ready to go.
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
remember), ā¦
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)
i got status messages from engine: like winthing/system/commands/open and alle the others
and at least: Subscribed, Sending initial Message, Engine Started
So hopefully it looks like its running
I have copied exactly the items the rule and to test also the sitemap from above to the conf folder openhab.
But now its not working.
in events.log i see:
WZ_PC_Commandā received command shutdown
2017-05-20 08:47:00.620 [ItemStateChangedEvent ] - WZ_PC_Command changed from NULL to shutdown
2017-05-20 08:47:00.732 [ItemStateChangedEvent ] - WZ_PC_Command changed from shutdown to NULL
and on openhab.log:
i have nothing
informations: installed openhab 2.1 snapshot and mqqt binding and also action but still not working
maybe you have an answer for me to get this fixed. or other solution for remote pc start/shutdown start progamm etc ā¦
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.