See this post here for download and how to use it.
Hi, first post here!
I developed a Windows program (in C#) that communicate some information to Home Assistant using MQTT. It will send PC temperatures (using AIDA64 for now) and PC usage (in use/not in use). I also added a bidirectional communication, so you can use Home Assistant to execute pre-defined commands on your PC.
When I last searched for it, I did not find anything that suited my needs. So I wonder if there is any interest for that Windows PC-Home Assistant bridge. If positive, I might clean up the code a bit and publish it on GitHub or release the binary here with some basic user settings support.
Sorry if I posted in the wrong category, was unsure since the project is not public (yet!).
Expand the image to see everything (1 image limitation for new user).
Well, thanks a lot for the kind comments! I did the research some weeks prior to this project release… Mine detects if the PC is used remotely (RDP) or physically, I might add it as a PR to IOT Link if it does not support that yet and if the interest is there.
That is actually pretty cool! You should add it as a PR or release as separate project (I actually don’t know if iot link has this, I haven’t started to use it yet). I just mentioned it to you as it seemed like the projects were/are very similar in what they want to achieve. That is the reason I mentioned IOT link. I would hate to see you build something really similar only to find out later that there is already a project that is maybe ahead already (and that precious time could be used to build other beautiful projects no?) XD.
Very interesting project, I would like to test it too.
It could be used in a lot of different automations. For example to change slightly the color of a bulb depending on the temperature of the PC.
Exactly! Also a personal use case of mine for ‘Is PC In Use’: I use it to turn air conditioner into manual control (since it’s in the same room as the PC) as well as adjusting up the PC room brightness. I also extend the motion sensor auto-off time. Could be a light that is on/off according to PC being used or not and therefore serve as a reminder to lock your session.
You can also see easily using charts what was the max temperature of each sensor or track length of your computer session, etc.
I sent you a pm with the link and the how-to guide.
For now, the Is PC In Use sensor reports the PC as not used when it’s a remote session (my personal needs), I could add 2 distinct sensors if someone want that.
Hi, first release, download link of the latest version is at the end of the post!
First, you need to edit PCInfoToMQTT.WPF.exe.config and fill the server address/server port/username/password of your MQTT server (I use Mosquitto in HA).
I implemented another way that does not require AIDA64 for temperature reading. It uses OpenHardwareMonitor internally and therefore you need to run it as administrator to be able to get hardware sensor temperatures. It still supports AIDA64 without admin rights need, to use, just set UseAida64 to True in the config.
I also added a button in the UI to get all the MQTT topics easily.
I minimize the window to the tray using RBTray (http://rbtray.sourceforge.net), trusted light tool that just does that for any window. You can also just minimize the window or send it to another virtual desktop if that bothers you.
I could add native support for tray minimize natively later.
Let me know how it works for you guys. I can help if you have problems!
@kslb got it working the same day for anyone wondering if the tool is actually working (told me in private). If anyone miss a feature or find a bug, just let me know!
There would be great option, if you can name PC, so that MQTT topics would be like:
“home-assistant/PCNAME/temperatures/intelcpu-0-temperature-0”
Or that “pc” is equal PC name, so that this can be used on multiple computers…
@kslb Great idea! I added a new setting called BaseTopic that you can edit in the .config file. The default value is ‘home-assistant/pc’.
@TychoWerner I will look at it, what would you need the most, is pc in use or the temperatures and which ones?
@vageesh79 Make sure you edit the .config file (PCInfoToMQTT.WPF.exe.config) to set your MQTT info: username/password/server address. Also, the errors can be seen in the Windows Event Viewer, that might help to find the problem. Also if you do not use AIDA64 for the temperatures and use the built-in temperature reader (UseAida64 is false by default in .config), you need to run it as Administrator. I will add better logging later!
Update (2020-05-15)
See this post here for download and how to use it.
I got your code working. Thanks for providing the compiled file. However, few of the temperature sensors are being picked up. I think this has to do with the way you are polling available sensors, and I was thinking if I could modify the source code to fit my needs. If you have published this to github, could you please link me to it?
I was using the built in method. I ran it as admin, and few of the sensors were picked up. How are you finding what sensors are installed?
Also, how do I use the AIDA method? DO I just install AIDA64, and change the flag to give it a go? I tried that, but did not see any topics being published.