Windows computer integration with OpenHAB

What are people using to integrate their computer with openhab?
I’ve looked at MQTT but there isnt a client that is still being maintained that I can find. EventGhost and IOTLink are no longer being maintained.

I’m basically looking to watch for when something occurs in openhab (Monitors turn off) then hibernate my computer.

When my computer returns from sleep then notify openhab and turn my monitors back on.

should be possible to detect the trigger event on OH and then remote execute a command on your computer to hibernate it.

I vaguely recall there were threads on WakeOnLAN and there also was some discussion on executing Windows stuff. Please search the forum yourself for that.

there is Network Binding to check availability of computer, I think also Fritzbox Binding can inform you in case you are using Fritz box…

Are you running openHAB on your windows machine?

I do exactly this with Remote Shutdown Manager. I previously used Assistant Computer Control, but RSM is more direct/simple.

You would need the Network binding or something else to sense when your Windows PC turns on.

No I’m running it on a linux server.

I’ve thought about doing some sort of custom development stuff like this. I was hoping for more of an agent type of setup that could run as a service and broker communication for multiple actions/data brokering. I dont know if my programming skills are up to that kind of a task though. I really liked the idea of EventGhost but I really dont like to use abandoned software projects.

At the moment I think I will go the WakeOnLAN and Network Binding route for now. We’ll see if I cant give it the old college try and do some development for some sort of agent.

I’m tempted to install zabbix and try to figure out how to integrate the two… maybe with zabbix_sender/zabbix_get.

My problem is I want everything in one place but there isnt really any sort of desktop type agent for openhab. I like the idea of having a remote agent on my desktop for analytics, visibility and automation from/to openhab. Knowing and acting upon things going on in the environment would be great. So many UPSs only have a USB interface and you’re only going to get that data from the local machine. I guess I could setup openhab on my desktop and do openhab_remote to send the data to my primary server, but that seems a bit heavy handed.

IDK I’ll let you know if I come up with something cleaver. Let me know if you have any ideas.

-Kirk

Going back to your first post, you suggest that:

  • openHAB would respond to the monitors being turned off to hibernate the PC
  • openHAB would respond to the PC turning on to turn on the monitors

This would be easier if you used one device to trigger both scenarios:

  • PC hibernation turns off the monitors
  • PC resume turn on the monitors

In this case, you just have to monitor the PC with the Network binding and toggle the switch. Alternatively, you could put the PC on an energy-monitoring switch to detect when it’s ON/OFF.

  • Turning off a monitor hibernates the PC and turns off the second monitor
  • Turning on a monitor resumes the PC and turns on the second monitor

In this case, you monitor a switch and then use Remote Shutdown Manager to hibernate or WakeOnLAN to resume.

I’m not sure what you would gain from this. Can you provide more detail?

Running openHAB on your desktop wouldn’t enable your primary OH server to wake it up, and the Systeminfo binding doesn’t provide much information that I can see being useful to trigger other devices/rules. So I can’t see what you would gain. But I’m probably just not grasping your scenario.

This makes a lot of sense. I will go this route.

I agree that the system info binding likely wouldnt get me a lot. What really brought me down this path was two things:

  1. Auto startup/shutdown of my computers/VMs/Hosts (when I’m not using them and when I have a power outage)
  2. the collection of other data like power usage

I tried to go the NUT route but for some reason I cant get NUT to work with my UPS. From what I can tell I’m not the only one.

Unified Remote Binding allows you to switch the monitor ON or OFF, restarting and shutting down your PC and few useful things more. However, Wake-On-LAN trigger isn’t provided in this binding. Requirement - the Unified Remote Server must be running on your computer (cross-platform).

As most folks here have stated there are many different ways to accomplish what you are asking.
SNMP is also an option, there is a binding for it in Openhab as well. Plus, you can enable it on both your windows devices as well as you Linux and in many cases your network devices. does have a learning curve but there is plenty of good documentation out on the web around OID usage most vendors provide the MIB’s with many of the actions you want to monitor. Also, lots of forums on how to set up your devices.
As for using NUT I had it running on my ESX server and the Deamon on other devices. at one point when the UPS they were connected to only had serial port I seem to recall quite a bit of configuration file hacks and fighting firewall ports for other remote servers and even some permission challenges, but I finally did get it working and I have to say it worked flawless right up till I replaced that UPS.
I also use APC power chute for my bigger UPS’s with Nic cards Ther are many ways to solution your environment for different conditions.
I would suggest you approach them as separate activities
Such power outages being something that just does graceful shutdowns and try and practice the KISS approach to insure the most reliability.
As for cool things like triggering you monitors on and off and sending devices to hibernation treat that as a different bell and whistle solution.
I also agree with the other Openhab SME’s that setting this up on a single device to manage all the remaining devices is the most logical approach, but it does leave you to a single point of failure if something happens to that device and you lose power.

This is an interesting option I may just go with this one.

I was able to figure out my problem with NUT not connecting to my UPS. I did change my design a little bit. Openhab (running as a VM) does poll the UPS directly. This is primarily for data collection and analysis for power level usage information. Then I setup my (linux based) storage system to use NUT connecting to the UPS directly as that should be the last thing that gets shut down. So when the time comes the storage system can trigger the clean shutdown of each VM and the virtualization host before shutting itself down. I havent tested it yet but thats how its currently configured. :crossed_fingers:

I didnt like the idea of each vm/device polling the snmp interface. I’ve seen bad things happen when they get overloaded (ironically it was a loadbalancer that didnt like being overwhelmed with snmp queries.) I might reconsider having the virtualization host direct connect as well and the VMs get their orders from the host itself.

Thoughts on the new design?

This makes sense to me. Your individual VMs don’t need to monitor NUT as long as your primary client can send shutdown commands. The only downside is that if your primary client goes offline for some reason, none of the other VMs will know that there’s a power outage. But that’s probably a low risk.

I hadn’t come across this before. I’ll stick with RSM since I don’t want/need any more than the hibernate command, but it’s good to know that this is available.