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

Hello,

I have a new PC (Windows 11) and cannot connect to the Media Player with HASS.Agent. HA Auto Discovery always offers the connection to the old switched-off PC, but not to the new one. Other PC sensors are mapped in HA. Even multiple restarts of HA have not helped.

A special feature: The new PC - like the old one - is in a different subnet (192.168.1.x) than HA (192.168.2.x). Do I have to manually add a rule in the Windows firewall? However, other PCs in this subnet work with HASS.Agent, and I don’t remember having to configure anything extra.

Does anyone have any tips?

Regards, Eckart

Hi all, I’ve been banging my head against something and would appreciate advice. My HA runs on a Raspberry Pi, and sends time series information to a PC running TimeseriesDB inside a Docker container. I’m trying to get healthcheck information on the Docker containers back in to Home Assistant via HACS so I can see how the whole ecosystem is working.

Advice I’d appreciate
(1) Is there an easier way than using HACS that I’m missing? If so we can ignore the below
(2) Is there a way to make a multisensor payload using PowershellSensor?

What I’ve done so far is create a Powershell sensor that gets status information from Docker as a JSON file and then manipulates the JSON to get just the info I care about:

docker container ps -a --filter name=timescaledb --format '{{json .}}' | ConvertFrom-Json | Select-Object -Property Names,State,Size | ConvertTo-Json

This gives me the following:

{
    "Names":  "timescaledb",
    "State":  "running",
    "Size":  "648MB (virtual 1.87GB)"
}

However, this is all sitting as a string in the “state” of the sensor, whereas I’d ideally like the state to be “running” with Names and Size sitting in attributes.

If I can’t make this happen then I guess I’ll create a template sensor to parse the information out of the state text, but I’d love to check whether I’m missing anything simpler before taking this route.

Thanks in advance, lovely HASS people!

If you append a pipe and ‘jq .State’ you will get the string “running” which is the value of state. You can use this in a command_line sensor with the appropriate value_template. You could use similar commands to get the value of size for the attribute. Since Names is static, not sure the value of saving that.

1 Like

Hello and thank you for this FANTASTIC application!

I’m trying to add a command to move the active window to the right screen, I have looked at the SendKeys Class commands but I can’t find the WINDOW key.

I need to make a command that is WIN+SHIFT+RIGHT ARROW:
[??+{RIGHT}]

What should i replace ?? with for the WINDOW key? I have tried with WIN, WINDOW and WINDOWS both with and without {}. I’ve tried {Ctrl+Esc} and APPSKEY

Edit: I’ve found this command which seems to trigger window key: ^{ESC}. But when i put it like this [^{ESC}+{RIGHT}] it only brings up start window, not moving the window.

Edit 2: If i try physically press window key down and use the command [+{RIGHT}] it will move the window, so how do i format it?!

Thank you!

I am struggling to get multiplekeys to work correctly. I have a lot of hotkeys that use ALT + CTRL + something else. I can’t get the alt and control to go at the same time. I went over the instructions multiple times and no combination seems to work. What is the correct format for pressing alt, ctrl, and a letter at the same time?

The Sendkeys Class does not support the WIN key.
Also, [^{ESC}+{RIGHT}] actually send Ctrl + Esc + Right key and not WIN key + Right. Ctrl + Esc is not the same as the Win key even though both command open the start menu. The only option I have seen is an Autohotkey script which moves the active window to the next monitor.
Autohotkey move window script

1 Like

Thank you for the explanation and that makes sense

Aaaaha, why didn’t i think of AutoHotkey, only using it to control Spotify atm

I want my computer to turn on when i get near home and set up all windows at their correct spot on the screens so I don’t have to do it manually, and was thinking of my original idea. Maybe I need to use a macro software

I haven’t played with it yet, but isn’t that one of the core features of PowerToys? You could probably use HASS to trigger a PT script.

2 Likes

I have never heard of PowerToys, FancyZones looks interesting. Have not touched this matter since my last post but i will read up on powertoys, thank you for the tip!

I’m no expert and am under the influence of stuff, but shouldn’t it be [%^key] ? Unless it’s a special key, then add {key}

That is what I thought, but I tried that combo multiple times and no luck.

I’ve loved this app for a long time, but I’ve just realised how awesome it is with WMIQuery… <mind blown!>

I’ve got Libre Hardware Monitor working with the examples, but I’m struggling to work out what the list of sensors and sensortypes are for my PC, eg the examples on the Hass Agent page work fine for some, eg:

Fetch CPU temp from LibreHardwareMonitor

Scope: \\.\ROOT\LibreHardwareMonitor

Query: SELECT value FROM Sensor WHERE Name LIKE "%CPU Core%" AND SensorType = "Temperature"

but other ones return null values.

Is there an easy way to see a table of sensors and sensortypes that are available on my PC through Libre Hardware Monitor - otherwise it’s kinda like I’m writing sql queries without access to a database…l!

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.