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

Hi @SamKr . Thank you for the reply and hopefully your vacation went great.

In case you have time to help with NUC LEDs WMI query (powershell script sounds great) - that would be perfect! Also it has a byte to read the current LED state which is also helpful and could be used as WMI sensor. Thank you

Vacation was perfect, thanks :slight_smile:

Sure, no problem! I’ll be publishing a new release later this weekend with a new powershell command. When that’s done, I’ll write some examples for you to test.

1 Like

@SamKr I’ve noticed that the created local sensors don’t contain the device name. And only with drives and network sensors, it created 40+ entities that never contains the device name:

image

With the next update, could you normalize it ? Because with 3 computers in my home with your app installed, it’s going to be a mess to find which entity is the good one when monitoring things.

Something like sensor.deviceName_drive_c_avalaible_space ?

PS: I’ve tested on on both W10 and W11, and this app is awesome.

Hi @renaiku, glad you like it! Yep that was a flawed design. There’s an update coming tomorrow that’ll fix exactly that :slight_smile:

You can try the beta on the release page if you’re bored, otherwise you’ll see the notification tomorrow

1 Like

Hey @amplitur, I just published a new release that addresses all of your issues/tips (I think).

Only one small difference; I chose to make the dropdown menu the same color as the textboxes (instead of other way around), to preserve the dark mode theme. Does that look ok? Or still not intuitive?

The multisensor-sensors now get proper naming, but make sure to read the ‘breaking changes’ in the release notes.

Lastly; the sensor names are indeed hidden behind the values. I’ll be adding ‘attributes’ for sensors in one of the upcoming versions, which allows sending the values as attributes for one sensor instead of x sensors with single values. It’ll be a setting so users can choose which type they want (the one sensor per value is easier to implement in automations/scripts), but with the attributes you’ll have way less clutter.

1 Like

Yes I saw that, perfect thank you !

I’ve updated my Plex script to show playing notifications on desktop:

image

It’s awesome thank you

1 Like

Great! Thanks for sharing, looks handy (nice choice of movie :wink:).

Wishlist
Commands: command to open URL on default browser

I was looking at your wishlist. The current version to open url in a browser isn’t available yet?
When you get to this wishlist, please have the option to open in incognito as well. Thanks.

How can I use the lastactive sensor to trigger an action if lastactive value decreases to a value below 10 seconds?

The sensor belongs to a stationary PC so can be used as presence detection.

Using a Numeric State trigger with “below 10” does not work.

Hi @duceduc, it’s not public yet no, but I have a test working, so shouldn’t be long before it gets released. The incognito part is a good idea, will add :slight_smile:

1 Like

Hi @amplitur, currently all sensor data gets transmitted as ‘string’ values (it’s on the to-do list) so I’m guessing it has something to do with that. You’d have to cast it to an integer value first, something like this:

Entity states (as opposed to attributes) are always strings, so that’s most likely not the problem.

What is the exact state of the entity?
Open your Home Assistant instance and show your state developer tools.

This is a little bit more complicated that I had hoped :slight_smile:

The state of sensor is a datetime string:

In order to get the delta to the current time I have to convert LastActive and now() to Unix timestamp and subtract LastActive from now:

{{ now() | as_timestamp - states.sensor.ll2020_lastactive.state | as_timestamp }}

This will return the number of seconds since LastActive:

Still have to figure out how to best use this as a trigger when I only want the automation to be triggered when the value falls below e.g. 60 seconds, not every time the it is below 60 seconds.

1 Like

Use the template trigger.

Template triggers work by evaluating a template when any of the recognized entities change state. The trigger will fire if the state change caused the template to render ‘true’ (a non-zero number or any of the strings true, yes, on, enable) when it was previously ‘false’ (anything else).

1 Like
alias: example
trigger:
- platform: template
  value_template: "{{ (now() - states('sensor.ll2020_lastactive')|as_datetime).total_seconds() < 60 }}"
action:
   ... etc ...

EDIT

Alternate version of the template:

  value_template: "{{ now() - states('sensor.ll2020_lastactive')|as_datetime < timedelta(minutes=1) }}"
2 Likes

Is there a list of the built-in commands somewhere? I checked the readme and wiki but it just see broad mention of it “Aside from the builtin commands, you can use your own custom command”. I am considering migrating from IoTLink and want to know how what I can replicate out of the box and what will require writing custom commands.

Edit: I see a list here in the source code. Are those all the built-in ones?

Hey @berkron, yep that’s the list. The upcoming version will also have a set-volume command and launch-url command.

Let me know if there are others you’d miss!

Expanding the wiki with more detailed info is my todo list, but HASS.Agent itself is already a lot of work so might take some time.

1 Like

At first glance the main thing missing is sleep. Most of our gaming PCs sit on standby and can sometimes either get woken up accidentally or left on after use so sleeping them remotely is very handy in a multi level house.

I was planning to implement some process monitoring sensors so record how long certain apps / processes are running but haven’t done that yet and debating if I’m going to so that’s not necessarily a deal breaker for migration.

Thank you so much for the huge amount of work you’ve undoubtedly put in. It’s so great to see something like this so active. IoT Link has been pretty great but seems abandoned so a replacement like this is huge.

Actually I am also reading which user is currently logged into the machine to record how long the kids are logged on for and remind them to get off (via RGB light bulbs and notifications) if they’re screen time is up. Kind of a DIY screen time control system for the gaming PCs. Does HASS.Agent have sensors for current username?

Sleep is a good idea, already has hibernation but will add that as well.

Coincidental stuff; I’ve added process/service monitoring and logged-users to the latest beta build :slight_smile: I’ll be releasing the beta soon, so you could test it, otherwise you can wait for the regular release.

1 Like