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

I had the same issue. Installing the beta PLUS manually hitting the execute port reservation button after installation solved it.

Before installing the beta, there firewall rule had been created and it appeared to be correct.

1 Like

I have the Notifier component working great with some logic I’ve built in Node-RED, but the duration parameter seems to have no effect.

I can change the duration number to whatever I like, but the notification window always pops up for only about 5 seconds, which barely gives me enough time to look at the attached image from my front door camera.

Does duration actually work the way it was intended or is there some Windows setting that is overriding the duration in the Notifier?

I forgot to mention that when I changed my ip_ban_enabled to false, everything worked as advertised. I want this feature enabled though, for security.

I use the Android HA app on my phone and a tablet, both of which connect using the external url. That’s how I noticed the issue… The tablet couldn’t connect to HA. The tablet is wifi only, and my phone is on my wifi when I’m home, and data when I’m not.

I use the internal ip on my PC, and that still connected to HA. So to try and isolate the issue, I tried opening a browser tab and entering my external ip… No connection to HA. Then I turned off wifi on my phone, which put it outside my local network, and the app connected.

I don’t plan on using HASS Agent outside my network, but if it’s preventing me from using my devices INSIDE my network…

I tried clicking the port reservation button in Agent, but that was after I’d already set everything up and run into the issue. I’ve since uninstalled Agent, but I’ll try a fresh install later today, and report back.

Hi @Bohemian,

That’s a Windows setting, please see this issue.

So just to doublecheck; you use Home Assistant’s internal ip when connecting to the mqtt broker?

Thanks.

I fooled around with that Windows setting, but the duration parameter still makes zero difference. It appears that whatever is set in Windows is what determines the duration - pity.

In the MQTT section of the configuration, I enter the ip address of the RPi4 that my HA instance is running on, as well as the username and password for the HA user that all my other MQTT devices use.

In the Home Assistant API section, I’ve tried the following for the url (in addition to generating a long-lived access token in HA):

192.xxx.xxx.xxx
https://192.xxx.xxx.xxx
homeassistant.local:8123
https://homeassistant.local:8123

None of those connect when I use the test button.The only way it’ll connect is if I use:

https://xxxxxxxx.duckdns.org

And when I use that, I run into the issues I’ve described.

I tried a fresh install, using the port reservation button, with the same result.

EDIT: Ok, checking the TLS box in the MQTT section seems to have things working. However, Mosquitto is still generating the same error every 5 seconds.

EDIT 2: Meh. The fact that not all the media streaming service apps I use, utilize the Microsoft API that allows media control (and thus related actionable sensors), defeats my intended purpose for this add-on. I know this is a Windows issue, not an issue with HASS Agent.

So, I guess troubleshooting this is a moot point. Thanks for your input, regardless.

Hey @ExHempKnight,

Since you’re only focussing on the mediaplayer part; did you at least add one sensor or command? If not, that can explain the logs - so you could either add a single sensor, or remove the mqtt url completely (since the mediaplayer integration doesn’t require it).

Now regarding your second edit; you can still control them, just not see what they’re playing. You could create an Audio multivaluesensor and monitor the audio_sessions sensor to see what application’s playing, and perhaps their windowtitle to see what’s playing. If you give the names of the application, I could see if there’s a neater way to determine it.

Thanks for creating this awesome application! I am using it for a while now and I am very happy with it.
Unfortunately, since a couple of days the application randomly crashes after several clicks in the interface. Inspecting my event viewer logs tells me the following;

Faulting application name: HASS.Agent.exe, version: 2022.12.0.0, time stamp: 0x6283e0e1
Faulting module name: coreclr.dll, version: 6.0.622.26707, time stamp: 0x6283d982
Exception code: 0xc0000005
Fault offset: 0x00000000001d1fdd

Seems coreclr.dll is faulty at my side, but I am not sure if it is due to the HASS application itself or some configuration on my host machine.

Any thought where I should seek for a solution?

I believe I have everything set up right for MQTT sensors (just the default), but none of the sensors show up in the devices on the MQTT integration in HA. I’m not sure if it’s related, but I do receive this error below in the log. The system status show MQTT as OK. Any help much appreciated.

2022-07-11 06:33:03.555 -04:00 [FTL] [PROGRAM] FirstChanceException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request…
System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request…
—> System.Net.Sockets.SocketException (995): The I/O operation has been aborted because of either a thread exit or an application request.
— End of inner exception stack trace —
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error, CancellationToken cancellationToken)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.System.Threading.Tasks.Sources.IValueTaskSource<System.Int32>.GetResult(Int16 token)
at System.Net.Security.SslStream.ReadAsyncInternal[TIOAdapter](TIOAdapter adapter, Memory`1 buffer)

Hey @bdoe and @ShoQue92 (and the rest), I’m currently on vacation for two weeks, so give me a few days to reply please :grin:

1 Like

Hey @ShoQue92,

You could try installing the latest .NET 6 runtime:

If that doesn’t work, try the latest beta as well:

https://github.com/LAB02-Research/HASS.Agent/releases/download/2022.13.0-beta1/HASS.Agent.Installer.exe

Hey @bdoe,

What’s the device name you’re using? It can’t contain whitespaces (will be checked for in the next version).

I have tried both, unfortunately no change.
full event-viewer log for the crash;

Faulting application name: HASS.Agent.exe, version: 2022.13.0.0, time stamp: 0x6283e0e1
Faulting module name: coreclr.dll, version: 6.0.722.32202, time stamp: 0x62b2f16b
Exception code: 0xc0000005
Fault offset: 0x00000000001d1fdd
Faulting process id: 0xe98
Faulting application start time: 0x01d897ab54d08610
Faulting application path: C:\Users\<USERNAME>\AppData\Roaming\LAB02 Research\HASS.Agent\HASS.Agent.exe
Faulting module path: C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.7\coreclr.dll
Report Id: 0949dd9a-0452-493c-ae7c-e0b39d469af0
Faulting package full name: 
Faulting package-relative application ID:

I do have to say, I am using my Homeassistant with MFA. Could it be that it crashes because of that?
Ill try without MFA as well.

Just tried with an password-only account. Same result.

Try sfc scannow to see if something’s wrong, and optionally DISM /Online /Cleanup-Image /RestoreHealth.

I’ve tried several because I saw that could be an issue, but right now it’s “TOBY_PC”

but my home assistant MQTT integration isn’t discovering it.

Is it worth trying to listen to the topic (I’m not sure what that would be for a sensor)? Thanks for your help.

Done that, sfc found corrupted files and fixed them. Executed the DISM command aswell, went fine.
Although still same result that HASSagent crashes because of this coreclr.dll.

Seems to happen after a couple of second when the application starts. I click around a bit, close it, and crashes while attempting to reopen.

Hi all, didn’t find an answer anywhere on here. How do you create two notify endpoints?

notify: 
  name: "Dummy1"
  platform: hass_agent_notifier
  resource: http://192.168.1.19:5115/notify

notify: 
  name: "Dummy"
  platform: hass_agent_notifier
  resource: http://192.168.1.20:5115/notify

and

notify: 
  name: "Dummy1"
  platform: hass_agent_notifier
  resource: http://192.168.1.19:5115/notify

  name: "Dummy2"
  platform: hass_agent_notifier
  resource: http://192.168.1.20:5115/notify

Any solution to that?
Many thanks

notify: 
  - name: "Dummy1"
    platform: hass_agent_notifier
    resource: http://192.168.1.19:5115/notify

  - name: "Dummy2"
    platform: hass_agent_notifier
    resource: http://192.168.1.20:5115/notify
1 Like