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

Greate Job :sunglasses:
I have developed remote unlocker using MQTT and Raspberry pi pico (w).
It allowes you to remotely unlock your computer by publishing MQTT topic.

2 Likes

Try WMI Explorer
https://github.com/vinaypamnani/wmie2/releases

1 Like

Thanks for your reply. I finally got a chance to try this and didn’t have any success; if you’re able to point me in the right direction I’d be grateful. I have a workaround, so this is more out of curiosity.

I tried using the | jq .State in the Powershell command, and this didn’t work - “jq not recognised”. Similarly I tried using it in HA dev tools with {{ states('sensor.juba_hass_agent_timescaledb_status') | jq .State }} and it says “No filter named jq.State”. Googling didn’t seem to come up with anything.

I’ve worked around this with a template sensor using a temporary variable as follows – it seems to work, but is a little clunky:

{% if has_value('sensor.juba_hass_agent_timescaledb_status') %}{% set tempJSON = states('sensor.juba_hass_agent_timescaledb_status') | from_json %}{{tempJSON.State}} {% else %}unknown{% endif %}

Hello. I want to setup notification. When I click on the show test notification button, no popup. The log shows this warning.

2024-05-04 09:36:35.306 +09:00 [INF] [SERVICE] Local install path: C:\Program Files\HASS.Agent\Service\
2024-05-04 09:36:35.317 +09:00 [WRN] [NOTIFIER] Showing notifications might fail, reason: DisabledForUser  <----------------
2024-05-04 09:36:35.329 +09:00 [INF] [MEDIA] Ready
2024-05-04 09:36:35.346 +09:00 [INF] [NOTIFIER] Ready
2024-05-04 09:36:35.581 +09:00 [INF] [MQTT] Connected
2024-05-04 09:36:35.780 +09:00 [INF] [HASS_API] Home Assistant version: 2024.4.4
2024-05-04 09:36:36.075 +09:00 [INF] [HASS_API] System connected with http://homeassistant.local:8123
2024-05-04 09:36:37.314 +09:00 [INF] [MQTT] Initial registration completed
2024-05-04 09:36:45.629 +09:00 [INF] [NOTIFIER] Attempting to show test notification ..
2024-05-04 09:36:45.638 +09:00 [INF] [NOTIFIER] Test notification attempt completed
2024-05-04 10:10:00.805 +09:00 [INF] [NOTIFIER] Attempting to show test notification ..
2024-05-04 10:10:00.805 +09:00 [INF] [NOTIFIER] Test notification attempt completed

I am on 2024.4.4 with hass.agent install in HA. I think I need to run it but what do I input in host field? I have tried added the ip address of my pc machine with no success.

2024-05-04_10-14-52

In the installer for the unofficial HASS.Agent, it says:

The installer has an option to migrate current installation configuration for seamless transition, please remember that some settings (like MQTT configuration) may need to be changed if you’d like to run two instances of HASS.Agent - forked and original one.

Just be sure to check the option to migrate on the last dialog of the installer.
(it’s not checked by default)

I just installed it and the migration seemed to work correctly.

1 Like

Update: Issue fixed as provided by this post. Need to have Notification to be on.

@ ozstone Ok. Thanks for that tip. I saw that when I installed on a another pc.

My current issue now is I cannot get notification to work. The test notification does not popup a message. I can see a notify. desktopxxxxx entity has been created. Installing hass.agent on Windows 11. The log says below. Where do I enable for user??

[WRN] [NOTIFIER] Showing notifications might fail, reason: DisabledForUser

I’d love to have an alternative option to display and interact with notifications.
Windows notifications are not always working or suitable.
I’d love to have a more customizable option.
Features I’d wish to see:

  • positioning: I’ve one ultra wide screen and 2 more screens and I’d love to put specific notifications onto specific screens and there to a specific position.
  • stay visible until user interaction: show the notification until the user closes the notification or interacts with it (close, or action buttons)
  • show notification text as transparent overlay in different sizes - for example, almost full-screen in the middle of the may monitor. Maybe dimming away after some time if user is active.

I can think of either several message receivers, which are configured and published from HASS.Agent - or just a bunch of props being filled as arguments for the notifications from within home assistant.

I can’t seem to configure my Sattalite service on my Windows 11 device:

This is when I go to the “manage sattelite service” config item:

The logs don’t help very much:

2024-05-17 15:33:58.361 +02:00 [WRN] [RPC] [GetDeviceName] Invalid auth ID
2024-05-17 15:33:58.362 +02:00 [WRN] [RPC] [DeviceName] [-] Request denied or failed: invalid auth id

The result is I cannot connect from my HA instance to my laptop. The FW allows it (while NMAP shows it is filtered) in all profiles on port 5115. The port is also open (checked with netstat -aon | findstr 5115 command). When I stop the service, the port is gone.

So I don’t know where I can find this Auth ID. Does anyone know where to find this?

Using version 2.1.0-beta1 from HASS.Agent and integration is also version 2.1.0-beta1 ( HASS.Agent 2 Integration). On 2024.5.3 of HA.

You might reach out on discord or GitHub of the hass.agent 2. They’re maintaining a fork while the original developer is unable to.

https://www.hass-agent.io/

Does the main (not satellite service) part work?

Do you have the service installed on the PC? That error seems to me like it’s the configuration part of the app trying to authenticate with the service part of the app.

As far as authentication between HA and Hass.Agent, it’s either via MQTT or API, and in ether case I think it would give you an error for the main. Part of the app as well as the satellite part as they probably share the same authentication records.

By enabling extended logging I found the directory for the service. Which holds a json file with the authID inside it. So found it.

but although now everything seems to be ‘green’, HA still can’t connect to my laptop.

image

Very annoying. Going to dig further.

That’s a good lead I’d imagine. I didn’t set up with API however so I can’t really help with that. MQTT has been working well though.

My goal is to send notifications to my laptop, for example if someone is at the door, but can’t seem to get that working. Am I mistaken I need to do this by Local API? Because commands and stuff work great, but there is no notify. registered.

Got stuff working. Apparently there was still an old config in my HA installation. After removing it from the config.entries file it started to rediscovering my device again and now it works. Without LocalAPI so might as well shut it down.

Thanks!

You’re welcome, glad you got it worked out.

1 Like

Hello, I’m having some issues with getting notifications working. When clicking the test button in Hass.Agent I correctly get a Windows notification. However, from what I can figure out, there should also be a notify.hass_mypc service in the Home Assistant developer tools, but I don’t have that.

I’m not sure if there’s something I should do first or if anything is wrong?

I do use MQTT to publish opening apps on Windows and to change audio, light/dark mode and get sensor data, so everything is setup correctly as far as I know.

Did you install Hass.agent integration in HA via HACS or manually? Also, there seems to be a break after updating to 2024.5 HA core where the notifcation stopped working. A hotfix provided by user atax112 where you manually edit the init.py should fix the issue until the integration is updated.

Thank you very much, I was indeed being dumb and didn’t install the Hass.agent intergration (thought I could send the notifaction using MQTT), and then changed the init.py file and it all works now

1 Like

Hi there!

I am using hass.agent to capture the powerstate from my pc… and it seems to be working. The idea is to know when screens are on and when it enters standby mode (some seconds after locking the screen).

powerstate

As you may see, it works (PowerOn state as blue, PowerOff state as magenta).

The goal: i have a TV connected to this pc and the idea is to automate switching it on and off. When the PC wakes up - turn TV on. When the PC goes to sleep, turn tv off.

I already have TV control working inside HA, but I can’t see the entity state inside an automation (it only shows “unavailable” or “unknown” as states).

As you can see, there are no “PowerOn” or “PowerOff” states.

What am I doing wrong? Ideas?

In my experience, certain integrations do not populate their various states into the automation GUI, however if you match the state shown in developer panel (case-sensitive) it will work. I suggest giving it a try.

2 Likes

It worked! Although not listed, I just created the rule conditions writing “PowerOff” and “PowerOn” as the state appropriately. Thank you!

1 Like

:ok_hand:t3: you’re welcome.

1 Like