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

Fantastic. I’m in no rush (short on time) so can easily wait and test out later. Thanks!!!

Hi @bverkon, I’ve published the beta. If you have some spare time, it’d be great if you could test! Let me know if it doesn’t fit your requirements.

I am looking at the list of available sensors, but do not see one that can tell me if my pc is on or offline? Does anyone know how to create this sensor??

You can use the ping or nmap sensors to show what is online. I also have one automation testing if the sensors are unavailable

1 Like

ok. I will add a ping sensor.
Maybe an online status sensor can be added to the wishlist ??

Hey @duceduc, yea I can add a ‘reverse ping’ sensor so you can check when that was last sent, and deduce the state from there.

@bverkron and any others that installed the last beta: it didn’t include the latest code and -ironically- ‘notify on beta updates’ doesn’t yet work. If you have it installed, please update manually last one time. Sorry!

Thank you.
I figured out how to create a template switch to turn on and off the pc using wake_on_lan integration. I also created a custom command to open multiple webpages in chrome incognito. Waiting on the temp sensor now :stuck_out_tongue:

Had to park my work on this for now as life has been busy. Not sure when I will have time to get to this again but looking forward to it whenever it happens. Thank you!

@duceduc: I’ve published a beta which includes scopes for wmi, you can download it here - so you can now fetch sensors from AIDA64 or openhardwaremonitor.

The release notes include an example on how to get CPU temp from openhardwaremonitor (you have to have that running in the background).

@bverkron: no worries of course, best of luck :slight_smile:

I’ve published a beta which includes scopes for wmi, you can download it here - so you can now fetch sensors from AIDA64 or openhardwaremonitor.

Thanks. How can I get it to display °C ?

2022-02-19_22-11-19

You can do that with a template sensor in HA, but being able to define the unit of measurement from within HASS.Agent is actually a really good idea - I’ll add it :slight_smile:

Question/request: Would a sensor that shows whether a monitor/display is powered on or off?

I don’t think Windows knows whether a monitor is powered off (by the physical power button). Or do you mean turned off by Windows?

By physical button yeah. After some searching, I found the following information which may help:

I’ve tested these and some other samples, but they only detect when Windows puts the monitor in sleep mode, not when you toggle the power button yourself. Really don’t think Windows gets notified of that :frowning:

Finally getting around to setting this us as we’ve just built my middle son’s first gaming PC. So far it’s FANTASTIC!

Submitted one issue related to the agent setup and have a suggestion about the logged-users feature.

In IoTLink the ...current_username value was the username of the user who is currently logged in, i.e. actively logged into a desktop sessions. HASS.Agent on the other hand seems to report all users who are logged in whether or not they’re “actively” logged in and viewing the desktop session. For my use case this will not work as my automations rely on wether the user is actively logged in or not.

For example right now I can track now long someone is using the computer for based on how long the ..._current_username value equals their name. Once they lock the PC or logout the ..._current_username value goes to unknown or unavailable so I can stop tracking time against that user. With HASS.Agent I can’t really do that since any user who is logged in gets returned by the loggedusers sensor even if they’re not actively using the desktop session (i.e. PC is locked or another user is actively using it). Returning a JSON list adds extra overhead for me as well since I’d have to parse things out even if there is only a single user value there.

Is it possible to have another sensor that just reports which user current has an active session and is a single string value of their username?

Aside from that (so far) things are AWESOME! Setup was quite easy and the sensors showed up right away in HA.

Quick question? Can the PC side sensors be configured via configurations files as well or only via the GUI? I’m all about tracking everything as code and if I roll HASS.Agent out to my other PCs to replace IoT Link I surely don’t want to manually configure all 4 of them via the GUI each time :slight_smile:

Thanks for the kind words!

Is it possible to have another sensor that just reports which user current has an active session and is a single string value of their username?

Sure, no problem:

Yep. Go to this folder (assuming you installed in the default location):

%appdata%\LAB02 Research\HASS.Agent\config

You can copy all config files. Some notes:

  • Change appsettings.jsondevicename if it’s custom, or make it empty so HASS.Agent will get the Windows name
  • Change all Id values in both commands.json and sensors.json. Nothing fancy, just 1 letter different is enough.
  • For clarity, change the names of the commands & sensors as well
  • You don’t have to change them in quickactions.json, they’re for internal use only

I’ll put an export/import function on the to-do list that automates this, can imagine more people wanting to do this, and could double as a backup function.

2 Likes