Go-hass-agent: a native app integration for desktop/laptop devices

Hi folks,

I wanted to share a project I’ve been working on, go-hass-agent. This is native app integration for desktop/laptop devices. It sits in the system tray of your desktop environment and quietly sends sensor data to a Home Assistant instance.

My motivation for writing this was originally to adjust my lights when I’m gaming on my desktop. But then I got carried away writing an entire app. I am no developer, so this was kind of just a fun hobby project for me. Maybe in a few days/months/years a robot can pick it up and help out?

:chart_with_upwards_trend: Sensors

It will currently add the following sensors to a Home Assistant instance:

  • Device location.
  • Current active application and list of running applications.
  • Battery status (for example, laptop battery and any peripherals).
  • Network status (for example, network connection status, IP addresses and Wi-Fi details where relevant).

The code can be extended to add additional sensors. See Device/Sensors for details.

:thinking: Use Cases

As examples of some of the things that can be done with the data published by this app:

  • Change your lighting depending on what active/running apps are on your laptop/desktop. For example, you could set your lights dim or activate a scene when you are gaming.
  • With your laptop plugged into a smart plug that is also controlled by Home Assistant, turn the smart plug on/off based on the battery charge to force a full charge/discharge cycle of the battery, extending its life over leaving it constantly charged.
  • Like on mobile devices, create automations based on the location of your laptop running this app.
  • Receive notifications from Home Assistant on your desktop/laptop.

🏃‍♂️Installation/Running

See the README for details. Note at the moment, only Linux :penguin: is supported. Though it should be extensible to other operating systems as it is written in Go which can run just about anywhere.

:bug: :question: Issues/Feature Requests

Please create any issues/feature requests on GitHub. In particular, for issues/bugs, a log will greatly help me debug things. You can generate a log by:

  1. Run go-hass-agent from a terminal or command-line with the --debug flag:
go-hass-agent --debug
  1. Try to reproduce the problem.
  2. After you have reproduced the problem, please (compress and) attach the go-hass-agent.log file found in the following location:
  • On Linux, in ~/.config/fyne/com.github.joshuar.go-hass-agent/go-hass-app.log
    (While I have made efforts to not log sensitive information, please check the log before uploading to GitHub and remove any information you do not want to share).

:keyboard: Contributing

If you would like to contribute new sensors or extend the app to run on additional platforms, please see my notes on contributing that will help you get started. Also, thank you!

6 Likes

Thanks for the share :wink: Wanted to try it on my Debian but it has an issue (I opened a bug report on Github :slight_smile: