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

If I may ask, what’s wrong with using the local ip? Since it’s not going outside of your lan, that should be fine?

Have you tried connecting to the broker through the nabu casa url using a mqtt tool, just to check if it works, for instance mqtt explorer?

If my computer is not home then it will be rather useless.
Geolocation sensor is not very useful if I can only use it locally

I have not tried that. This is the first time I even install MQTT.
I can’t connect with MQTT explorer either.

Looks like you can’t access mqtt over nabucasa (only home assistant’s api). So you need to open a port on your router (not very safe), or use a vpn to connect to your network (and then keep using the local ip).

It seems I can only connect over my external IP, and only on port 1883, if I choose TLS then it fails to connect.

Must be some setting I have missed.

Did you open port 8883 on your router as well?

There is however a bug with self-signed certs which I’ll have fixed in the next beta. So if you can’t get it to work, but you can connect using MQTT explorer, wait for that release :slight_smile:

I’m using Tailscale which is installed on HA and my laptop - logged into the same account. This is an externally accessible IP specific when Tailscale is online on both devices. I have it working with both my MQTT and HA API - using the appropriate ports next to the Tailscale IP for my HA instance.

1 Like

I couldn’t get MQTT explorer to connect either.
It’s probably something I messed up. But yes I opened “all” ports during the test

Nice! That’s a great and safe option

I just installed HASS.Agent on my PC after seeing a video on the Everything Smarthome Youtube channel. I had one issue that took my quite some time to sort out. I set device name to Office PC which was prepended to all of my local sensors which resulted in an error message from the MQTT broker. After reading here that about an issue with a decimal point in the device name, I realized that the issue was the space in my Office PC. I changed the device name to Office_PC and modified each sensor to replace the space with an underbar. Worked like a champ!

A few enhancements suggestions that might improve the user experience:

  1. Add validation to device name to ensure that no illegal characters are included. Alternatively, replace each illegal character in device name with an underbar when using in things like sensor names.
  2. Validate sensor names to ensure that they do not include illegal characters.
  3. Give user the options, after changing the device name, to automatically update the sensor names to match the new device name.

Now that I have it working, I am looking forward to getting these data onto my dashboard.

Thank you for taking the time to make this great tool available!

Hi, I’ve also just installed this after watching “that” video, as I’d started writing my own but wanted to see if this did what I needed.

First of all, thanks for building this and making it available.

Since I’m tied to my PC most of the time, I was looking for
a) hotkeys to interact with entities in HA
b) something to happen on my PC when it received certain MQTT messages (eg. “close window”). (Main reason being, I work from home but deal with very sensitive data and imagery).

I’ve set up a bunch of hotkey quick actions, but while I can get it to run scripts, and toggle lights, I can’t find any way of toggling a fan. So, I set up an automation to toggle it (triggered by an MQTT message) but I can’t fire it from the hot key.

I know the automation does what I want, but it’s not running.

Any ideas ? The log file shows the following:

2022-07-06 21:12:14.605 +01:00 [INF] [HASS_API] [automation.toggle_floor_fan] Performing action: turn_on
2022-07-06 21:12:14.619 +01:00 [INF] [HASS_API] [automation.toggle_floor_fan] Action completed: turn_on

Many thanks.

ps. I would love to be able to minimise a window based on an MQTT message… :slight_smile:

Hi, thank you for making this, awesome app!
I do have an issue though upon launch, HASS.Agent gives me an error “Error trying to bind to API port”.
There is no other instance running, and I’ve tried the standard port and then 5225. Same issue.
Under settings, Local API, clicking “execute port reservation” gives two green ticks.

I have a question/suggestion regarding the external MQTT.

I can live with not having the sensors update when not at home.
But, if this sends all sensor updates ever x seconds while I’m not in my home network then it’s not really good.

Could there be a home wifi setting? So if you are not on the network called blabla, then don’t send any messages?

Hi @RamonaSteve,

Since the last version, devicename sanitation has been added, so it should already fix that. Checking the sensor/commands names for illegal chars is a good addition though :slight_smile:

There’s an open ticket to propagate a namechange to the satellite server, but it makes sense to do that for the commands/sensors as well (if the user agrees), so I’ve added it to the ticket.

Thanks :slight_smile:

Hi @echo_Mark,

Could you please install the latest beta:

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

It should then work, optionally hit the execute port reservation button again. If not we’ll debug a bit more, let me know.

Did you try installing Tailscale like @BlackCatPeanut suggested? It’s really easy to do.

Otherwise, yea, there’s a ticket open for seperating networks: [hassagent-119].

I have not done that yet.
But that FR looks to be a good workaround if I don’t get around to install that.

Awesome! Thank you, @SamKr.

I’m having the same issue as Hellis.

After installing Agent on my PC, and inserting all my credendtials, I was no longer able to access HA via my external url, on any device connected to my home network.

I found that my IP was getting banned. I deleted the ip_bans yaml file, restarted HA, and it was immediately banned again.

I use Mosquitto as my MQTT broker. Plenty of other devices playing nice. I looked at the log for the Mosquitto add-on, and saw literally dozens of this message:

1657217056: New connection from xxx.xxx.xxx.xxx:xxxx on port 1883.
error: received null username or password for unpwd check
1657217056: Client <unknown> disconnected, not authorised.

There were errors for the IP’s of both my PC on my local subnet, and for (what I’m assuming is) my IP from my ISP.

I know my MQTT username/password are entered correctly in HASS Agent. What else could be causing this?

1 Like

Thank you, found the wrong url in the logs.
I had several mismatches together and vice versa, some of them i inserted while trying to fix it like missing ’ ', : rather then . and such, maybe also not escaped characters in different template declarations.
After removing the spelling errors and using variables for parts of the url its working now.

1 Like

I don’t know why it’s receiving empty values based on the info you’re giving me.

Do you use your external ip for all those devices you mention? Are you outside of your local network when this happens? Are you planning on using hass.agent outside of your local network?

Please explain your setup a bit more :slight_smile: