/HA-Game-SPy

lightweight C# app to watch windows processes and publish them to mqtt

Primary LanguageC#MIT LicenseMIT

HA-Game-SPy

CodeQLCodespaces PrebuildsGitHub tag License issues - HA-Game-SPy

The purpose of this windows application is watch for certain Games by looking for the windows process. You could use it for any windows process.. This will create a sensor in MQTT that should be autodiscovered by Homeassistant (At the moment, you will need to be using MQTT, the direct HomeAssistant integration hasnt been written yet!) The sensor follows the form sensor.hagamespy_yourcomputername e.g.: sensor.hagamespy_ryzen

You can use a Markdown card to show the status

content: |
  ![Game Image]({{ state_attr('sensor.hagamespy_ryzen', 'gamelogourl') }})
  **Device ID:** {{ state_attr('sensor.hagamespy_ryzen', 'device_id') }}
  **Game Name:** {{ states('sensor.hagamespy_ryzen') }}

And the card will appear something like this:

image

from this, you can then build out automations to do things like set a lighting scene, or even notify you if the kids are up late gaming etc! The application can be run minimised and at boot, there is a very small list of games included, but I have added functionality in to allow you to add games at will. If anyone has a good list of game names and their exe names, please creata PR for the games.json file, the more the better :)

Main Window:

Add Game:

You can use the browse button to find the executable for your game, fill in the name, and the image url can either be a source on the internet, or hosted locally on your homeassistant (Assuming you have an image in /config/www/images/ your url would be /local/images/yourimage.png) NOTE if you publish a local (to Home assistant) url, the banner image currently wont display in the app, only in Home Assistant. I may fix this in the future :)

List Games:

you can edit and remove/add games in the list view too