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

Hi, i can’t get MonitorWake to work. When the pc turns the screen off either with windows internal setting or with monitorsleep from HASS.Agent i can’t run any commands from HA, i have tried with monitorwake and differnt key commands such as enter and space. It seems like no commands from HA works when the state of the pc is ‘Locked’ Any ideas? thanks.

Does anyone know if there is a way to trigger Focus Assist in Windows using HASS.Agent? It would be really useful to be able to switch it on/off when going into/out of Teams meetings, especially for when sharing your screen.

I’m not quite sure why this isn’t a built in option in Windows settings, as they have one for ‘When I’m duplicating my display’, but that only works when you are physically duplicating your display to another screen. With so many meetings and presentations taking place online these days, it really ought to be built into Windows, but alas it is not. So I’m wondering if I can do this using HASS.Agent and Home Assistant instead.

I’ve already got ‘meeting detection’ working with the MicrophoneActive and MicrophoneProcess sensors, which turns one of my smart bulbs red/off and plays an annoucement on an Amazon Echo when entering/exiting a meeting. Would like to add this as additional functionality. :slight_smile:

I notice that the author hasn’t been active on this discussion for years, so I’ll post this question on GitHub as well. Nonetheless, maybe someone can help me?

I have set up an HA automation where the trigger is on a sensor of the type UserNotificationStateSensor and I have configured it to activate the action on “NotPresent”:

Something like this:

platform: state
entity_id:
  - sensor.laptopuserstate
to: NotPresent

However, it almost never activates, except when I turn on my computer.

But what I actually need is a notification when my computer goes into Sleep mode or when it is shut off. What is the trigger for this use case?

In other words, what is the trigger that will activate whenever the screensaver or similar is activated?
Has anyone used something like this?

1 Like

Ok, now I see from this reply that maybe SessionStateSensor would be better for this purpose, so I’ll check.

If it works, then … stupid me :frowning:
… and thank you @ScottS !

And I’ll also try with

platform: state
entity_id:
  - sensor.laptopuserstate
from: AcceptsNotifications

@cvladan; years is a bit much :wink:

Been busy in december, things are calming down now. Hope to get some github/forum tickets done this weekend. Sorry everyone!

3 Likes

Hehe, sorry :slight_smile:

It’s not my fault. I haven’t been reading messages one-by-one.

I don’t know why, but the system still displays the warning “It’s been a while since we’ve seen SamKr — their last post was 2 years ago” at the top of the discussion, so I concluded you were not active for 2 years.

Thank you again for the great project.

.

Have you deleted my GitHub suggestion entered as issue?

I hope you’ve read my suggestion for improvement that I posted as an issue on GitHub, but I later saw that there is a separate YouTrack project for that.

By the way, how do I “dig up” the content of that issue I’ve entered because I think you deleted it and I want to enter it again, but this time in YouTrack, as you request. In that way I don’t have to type it again, since English is not my native language, and typing messages involves utilizing spelling, grammarly, and similar crap.

… really strange that GitHub does not notify user when issue is deleted via email :frowning:

Yeah, I find it strange he/they have not responded herein or github lately. Not sure what I donated for/to. One reason I’m drifting from IoTLink was the lack of support.

That’s weird, probably because I didn’t post much when I wrote that. I’ll look into your gh suggestion tomorrow - it’s actually the right way to do things; post suggestions on gh, then I’ll add them to youtrack :smiley:

1 Like

Bit harsh don’t you think? I’ve worked hundreds of hours on this project; in coding, in support and in docs. I have a full time job and a gf/social life, so I sink all my spare time into this. Last month was busy for me both professionally and personally, so yea I responded a bit slower since there’s not much wiggle room the amount of spare time.

Like I said in my previous post: things are getting back on track and I’ll do my best to catch up on tickets this weekend

6 Likes

I am often stingy with praise, but I want to specifically praise the author of this tool. I don’t know how he is with support, but the implementation of the application and the idea itself are absolutely phenomenal, in my opinion - which probably doesn’t matter too much :slight_smile:

So, all praise!
And thank you for your hard work.

That’s it.

I suppose; just frustrating. I did donate because of your efforts to-date, just started reminding me of IoTLink. Not that a small donation is going to cover your work, but just thinking from my end.

Truth be told, I just put 2-and-2 together as I believe you had responded to my Discord inquiry… my bad.

1 Like

Would you share the chrome custom command @duceduc ? Exactly what I’m trying to do. Thanks!

It does matter, that’s really nice to hear, thanks!

It’s been awhile. I think these are the steps needed to create the swtich.

If you want to open the url in incognito, you will need to enable it first on hass.agent on pc. The below screenshot is where you will find it.

After, goto commands config tab and create your url to launch. Choose LaunchUrl if you only want to open urls. Choose custom if you want to open url and programs.

LaunchUrl sample

yahoo.com msn.com fb.com

If you want to open combination of url and windows program, you will need to create a .bat file and store locally on pc. Select the Custom as type.

sample.bat file

@echo off
start chrome https://msn.com --incognito

start C:\Users\Duc\AppData\Roaming\Zoom\bin\Zoom.exe
exit

Save your changes. Home Assistant should created your switches like so.

switch.desktop-fddl8i4_jcb
switch.desktop_fddl8i4_litalico

You can create a shortcut key to use on your pc to launch it. Goto quick actions tab to create your shortcuts.

That is it. Test your shortcut.

2 Likes

404 occurs when the entity you binded on the quickaction doesn’t exist anymore. Did you perhaps rename it?

1 Like

HASS.Agent’s integration has its own topic: hassagent/#. If you didn’t change anything and use the default mqtt integration in ha, it should be ok. You could use mqtt explorer to see if there’s anything published in those topics.

You can do that using a CustomCommand, just link it to the bat file

Yep that’s a known bug, working on it :slight_smile:

2 Likes

That’s correct, that’s a safety feature of Windows. No application can (without nasty hacks) emulate keys in the lock screen, because otherwise it could maliciously login the user, or listen to key presses and steal the password.