HASS.Agent: Windows client to receive notifications, use commands, sensors, quick actions and more!

Hi everyone,

After using Home Assistant for a few years and being very happy with it, I finally have something to share with the community! :tada:

It’s a Windows-based application (companion app) that communicates with- and adds functionality to Home Assistant, called: HASS.Agent



Features

Short summary of the currently implemented core features:

  • Notifications: receive notifications, show them using Windows builtin toast popups, and optionally attach images. Supports actionable notifications: add buttons so you can easily interact with Home Assistant, without having to open anything.

  • Media Player: use HASS.Agent as a mediaplayer device: see and control what’s playing and send text-to-speech.

  • Quick Actions: use a keyboard shortcut to quickly pull up a command interface, through which you can control Home Assistant entities - or, assign a keyboard shortcut to individual Quick Actions for even faster triggering.

  • Commands (currently 24): control your PC (or other Windows based device) through Home Assistant using custom- or built-in commands.

  • Sensors (currently 37): send your PC’s sensors to Home Assistant to monitor every aspect of your device.

  • WebView: quickly show any website, anywhere - no browser required, for instance a HA dashboard.

  • Satellite Service: use the service to collect sensordata and execute commands, even when you’re not logged in.

  • All entities are dynamically acquired from your Home Assistant instance.

  • Commands and sensors are automatically added to your Home Assistant instance.



Getting Started

I’ve spent quite some time on streamlining the user experience, mostly by providing an onboarding process that’ll guide you through configuring the agent. So getting everything up & running shouldn’t be a problem.

Different parts of the agent use different methods of communicating with Home Assistant (API, MQTT …). They’ll be explained during onboarding, and if you don’t want to use something, you can just skip it.

The recommended way of installing is using the installer; it’ll make sure you have .NET 6 installed, prepares the service for you and launches HASS.Agent afterwards.



Notifications

If you want to receive notifications (one of the main reasons I created this), you need to install a small integration. This can easily be done through HACS, just search for HASS.Agent. You can of course also install manually by downloading and extracting the .zip package to the custom_components folder. For help, check the integration section of the docs.

After installing, if you have HASS.Agent running with MQTT configured, your device should be automatically detected. Otherwise, manually add it using HASS.Agent’s local API.

Be sure to read the notifications section of the docs. It contains some usage examples as well.


Notification examples:

image

Text-based toast notification



Quick Actions

Another reason I created this is Quick Actions. I wanted to quickly call services from my PC, so I could toggle lights, start my TV, pull up a video stream, etc. without having to open the app/website. Just a quick keyboard hotkey and an interface shows up with specific buttons.


This is the Quick Action window you’ll see when using the hotkey. It’ll automatically resize to the amount of buttons you’ve added:

Quick Actions

You can easily configure a new Quick Action, HASS.Agent will fetch your entities for you:

While you can assign a global hotkey to show the Quick Actions form, as you can see in the screenshot above, you can also assign a hotkey to every individual Quick Action. This way, for instance, I can toggle a light by simple pressing CTRL-ALT-NumPad9.



Info & Support

More info can be found on the GitHub readme or in the documentation. Feel free to post questions on this thread or on our Discord channel.

Discord-Logo+Wordmark-Color

HASS.Agent has been working quite well so far, but if you encounter issues, please submit a ticket.

You’ll need to have .NET 6.0 installed. The installer will install it for you (no reboot required), otherwise you can download the redistributables here.

To see what’s planned and actively worked on, you can check the HASS.Agent YouTrack Dashboard. You can see all open ideas (and issues) on the right column, and the ones that are actively worked on for the next release on the left. If your idea isn’t on there yet, please create a ticket or discuss on Discord!

Thanks for reading, and hopefully it’ll be useful :slight_smile:


logo_128


Latest installer: click here


HASS.Agent is completely free, and will always stay that way without restrictions.

However, developing and maintaining this tool (and everything that surrounds it) takes up a lot of time. Like most developers, I run on caffeïne - so a cup of coffee is always very much appreciated!

ko-fi "Buy Me A Coffee" paypal
43 Likes

Thanks for sharing, works great.

1 Like

Saw this with the latest HACS update, can’t wait to test it out. Really hope the pc mic in use can be used as a sensor to trigger automations.

You can! I use it to mute TTS messages when I’m on a teams meeting.

This is an example script, it only proceeds when the mic binary_sensor is off:

tts_test:
  alias: Test TTS
  mode: single
  sequence:
    - condition: state
      entity_id: binary_sensor.test_pc_mic_active
      state: "off"
    - service: notify.mycroft_tts
      data_template:
        message: >-
          {{ message }}
1 Like

This is awesome!
It works great for me.

A few findings / requests to report:

  • When I first setup MQTT i put in wrong connecton info. The application then spams you with a lot of notifications that the config is wrong. This makes is hard to change the config because the notification window is overlapping with the tray icon. Perhaps a single notification is enough, or you could increase the time between notifications.
  • The quick actions shortcut is working for me. It owuld be nice if you could use the keyboard to switch between possible quick actions and press enter to select the one you want. Using a keyboard shortcut and then switching to mouse input is not that nice of a user experience.
  • The shortcuts bound to a specific quick actions are not working for me.
  • Are there any plans to move to .NET 6, and perhaps a Mac version of the app? My issue with the HASS app for Mac is that it cannot run in the ‘background’. I would love to use the mic sensor to use in a MS teams indicator light automation.

But it’s great the amount of features you have already built in this first release, awesome!

1 Like

Hi @freakshock,

Thank you! Good to hear :smiley:

And thanks for the report!

The application then spams you with a lot of notifications that the config is wrong … Perhaps a single notification is enough, or you could increase the time between notifications.

Agreed, excellent point. Will do.

It owuld be nice if you could use the keyboard to switch between possible quick actions and press enter to select the one you want.

Good idea! Noted.

The shortcuts bound to a specific quick actions are not working for me.

Did you try restart HASS.Agent after setting the shortcuts? What shortcuts are you using (so I can try to reproduce).

Are there any plans to move to .NET 6, and perhaps a Mac version of the app?

Yep had it in the back of my mind. .NET 6 wasn’t out yet when I started developing, but since I’m doing everything in 6 now it’d make sense to port.

Making a Mac version would require some extra work, as currently I fetch the mic status from the Windows reg. So I’d have to do some research on how to do the same for Linux and Mac.

As soon as I’ve ported to .NET 6 I’ll bug you (if that’s ok) to do some tests. Might be a few weeks though with the holidays coming up.

1 Like

Thanks for your response !

Did you try restart HASS.Agent after setting the shortcuts? What shortcuts are you using (so I can try to reproduce).

I tried just now, that does not fix it. I tried both CTRL + ALT + L and CTRL + ALT + O.

Making a Mac version would require some extra work, as currently I fetch the mic status from the Windows reg. So I’d have to do some research on how to do the same for Linux and Mac.

I understand it’s not trivial to implement this :wink:

As soon as I’ve ported to .NET 6 I’ll bug you (if that’s ok) to do some tests. Might be a few weeks though with the holidays coming up.

Yeah no problem, I can run some tests for you. Let me know.

Hey @freakshock,

There’s a new release which fixes the MQTT disconnect-spamming and adds keyboard navigation to the Quick Actions. Thanks again for the tips :slight_smile: There are also some new features like multi-value sensors.

I’m unable to replicate the key bindings, they work fine on my machine and test vm’s. Perhaps they’re already taken? Could you try using CTRL + ALT + NumPad1 for example?

Hi. This looks very promising but my company PC’s firewall (not the Windows one) seems to block the incoming traffic. I suppose there is no easy way to implement a websocket connection from the Agent to HA?!

1 Like

Hey @FPro,

Not really, but I’m currently looking into registering HASS.Agent as a ‘native app’, which would make configuring easier and solve connection issues. But that’ll take a while.

In the meantime, if your company’s policy allows it, you could use something like Tailscale or ZeroTier to make a direct connection from HA to your machine. They both have an HA add-on ready and are very easy to setup.

That way, you can just enter your company machine’s Tailscale or ZeroTier IP and bypass all other firewalls.

They are both on the same network, so a VPN won’t help. The PC itself has another firewall. But thanks for the suggestions :slight_smile:
Looking forward to the improvements. I’ll try again then.

Ah right, bummer! You could try using port 80 or 443, but that’s a long shot.

Very nice application thankyou

A thought… Showing the current state of a device (on|off) in quickactions would be neat, especially for a toggle action.

One issue - having setup a hotkey (I mistakenly used an ordinary alpha key) - if you then remove it then when pressing that key the app crashes.

Having a problem with hotkeys not working too. It does intercept the keypress (in that it can no longer be typed) but it doesn’t perform the action.

Hi @xAPPO, thank you :smiley:

Showing the current state is indeed on my wishlist, I’ll add it in one of the upcoming versions!

I’ll look into the crash, it probably doesn’t unbind the hotkey when you remove it. Thanks for letting me know.

Did you restart HASS.Agent, and is it still not working afterwards? What keys do you use for the hotkey?

Thanks, these new features work great :slight_smile:

Must be something on my system indeed, I tried one other combination but it was not working.
I don’t mind because I don’t really need this feature.

Thanks again for the great app!

An Awesome app! Thanks for creating it!

Thanks @freakshock and @brad.trout! Nice to hear :smiley:

Hey! It works out of the box, no issues!!
Nice job and thanks for the effort! Just what I was looking for :slight_smile:

Thanks for the positive feedback @rickvanelk :smiley: Glad you like it. Oh and welcome to the forums!

1 Like

Thank you for sharing your work.
I added the storage sensor but I won’t get any in HA. Other sensors like cpu load or memory usage are working.