Cannot get HASS/integration working

Long time user... first time complainer. 😛 Brand new computer. Installed the agent on windows using https://github.com/hass-agent/HASS.Agent/releases/latest/download/HASS.Agent.Installer.exe Added the custom repo to HACS (this one right?)
No description
25 Replies
Fielmacrits
Fielmacrits4mo ago
When I first installed this computer, I migrated my config files from appdata and did the migration process. I couldn't get it working... I think at one point mabye media player was working but I can't remember for certain now. I got frustrated and put this on the back burner for a while. 😄 I have since uninstalled HASSagent completely, deleted (move) all the files from Program Files and appdata and fresh installed it
Fielmacrits
Fielmacrits4mo ago
I verified my MQTT settings are correct, the logs files are verifying that MQTT is connecting I created a new long lived token and testing the API connection was successful
No description
Fielmacrits
Fielmacrits4mo ago
Local API is enabled satelite service is running My hair is falling out please god help me I need my hotkeys back 😄
Fielmacrits
Fielmacrits4mo ago
Should I be adding this or waiting for auto discovery?
No description
Fielmacrits
Fielmacrits4mo ago
because when I try to add that it fails. if that means anything. My understanding is this is the old integration and HACS is the new one
Fielmacrits
Fielmacrits4mo ago
well now I am not sure of that haha... I clicked the (?) button and it took me to the current github repo. So it wouldn't let me connect. I checked windows firewall. Saw there was no inbound rule for 5115. Added a rule. Boom... Home Assistant can connect! Dont get too excited for me though... Logs show this
2024-07-16 00:37:25.049 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry PANZER for hass_agent
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_agent/__init__.py", line 135, in async_setup_entry
_logger.debug("setting up device from config entry: %s [%s]", entry.data["device"]["name"], entry.unique_id)
~~~~~~~~~~^^^^^^^^^^
KeyError: 'device'
2024-07-16 00:37:42.143 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry THE_TANK for hass_agent
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_agent/__init__.py", line 135, in async_setup_entry
_logger.debug("setting up device from config entry: %s [%s]", entry.data["device"]["name"], entry.unique_id)
~~~~~~~~~~^^^^^^^^^^
KeyError: 'device'
2024-07-16 00:37:25.049 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry PANZER for hass_agent
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_agent/__init__.py", line 135, in async_setup_entry
_logger.debug("setting up device from config entry: %s [%s]", entry.data["device"]["name"], entry.unique_id)
~~~~~~~~~~^^^^^^^^^^
KeyError: 'device'
2024-07-16 00:37:42.143 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry THE_TANK for hass_agent
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_agent/__init__.py", line 135, in async_setup_entry
_logger.debug("setting up device from config entry: %s [%s]", entry.data["device"]["name"], entry.unique_id)
~~~~~~~~~~^^^^^^^^^^
KeyError: 'device'
I thought maybe it didn't like that the name was the same as before, so I changed the name, reloaded the integration, got the same error. so close I can feel it lol
No description
Fielmacrits
Fielmacrits4mo ago
also I am on the most recent release of Home Assistant....
No description
Fielmacrits
Fielmacrits4mo ago
I used MQTT explorer and saw that my old computer was still setting there in hass.agent, so I deleted all entries under hass.agent from my MQTT broker.
Restarted hassagent, restarted home assistant... still no dice. giving up. going to bed. defeated... depressed... distraught....
Fielmacrits
Fielmacrits4mo ago
Here the logs from Hassagent from when I restarted it ``````
Amadeo
Amadeo4mo ago
I'm away from home for the next +-8h but when I'll be back I'll take a closer look. In general the steps that you've followed should more or less be ok, the specific ones are: 1. Turn off hass.agent 2. Remove device from Home Assistant 3. Restart HomeAssistant 4. Remove the device topic via mqtt explorer 5. Start HASS.Agent 6. Restart HomeAssistant Then the device should be discovered I'll need to get around fixing the integration once and for all, it's going to be a pain but it needs to be done + when I'm back I'll also upgrade my HomeAssistant to see if it may have something to do with your issues, maybe they've changed something...
Martijn Hoogenbosch
I have exactly the same thing. I can't get my new laptop going. But I'm running in circles. I remoeved everything from my old laptop (which worked fine) but can't get that to work either.
Martijn Hoogenbosch
GitHub
KeyError: 'device' when adding my new laptop · Issue #5 · hass-agen...
I'm trying to add my new laptop to HA by utilizing this integration. Unfortunately, I'm getting the following error presented: Logger: homeassistant.config_entries Bron: config_entries.py:5...
Martijn Hoogenbosch
GitHub
New laptop doesn't allow me to send notifications / doesn't get di...
Describe the bug I have a new laptop. Old laptop works fine. Goal is to receive notifications. On my new laptop the test notification works fine. When API is enabled and I want to add it as HASSAge...
Martijn Hoogenbosch
becuase I honestly don't understand whare things break. It seems to be related to MQTT discovery, but when API it shouldn't use that.. I think this is related. Synthetex is running latest version too. It also seems to retain information form somewhere. In my search for the issue I changed the name of my device a couple of times. But all those get added back to \hass.agent\devices in MQTT. Even when deleted the entire Hass.Agent install folder. had a spare ha instance laying around (2024.2.2) and after installing hacs, adding the repo it discovered the devcies immideately. So there is something with 2024.7.2. For me, what I don't understand, it discovers my new laptop on a name it doesn't hold anymore. This has to do with the retain setting. It doesn't seem to be deleting the old devices when changing name. It seems to be locked somewhere in the hass.agent installation too. But this is beyond my knowledge. Hopefully the information above makes sense for you guys. and my apologies for 'stealing' the topic, but it is the same issue. If not, please let me know and I'll remove and reopen a new one
Amadeo
Amadeo4mo ago
Most likely an mqtt message still being there on the broker, one of beta versions for 2.1.0 fixes that (old message is removed upon device being renamed) Thank you for the research and information!
Martijn Hoogenbosch
Yes I think that is it, but for some reason it didn't remove correctly by pressing the delete button. I specifically needed to remove the retained tag (from within MQTT explorer). I'm running on beta2 of 2.1.0, and did all my testing with that. But I have a working hass agent now, with 2024.2.2 of HA. so that's something 😉
Fielmacrits
Fielmacrits4mo ago
I believe I had 2024.5, upgraded to 2024.7 last night as troubleshooting step, FYI. Stealing? Lolol Sounds like we are in the same boat. In the grand scheme of things it’s better that have more than a sample size of one for tracking down bugs. 😉 On the retained thing, I used MQTT Explorer which in my experience makes it SOOO simple to delete retained topics on your broker. I deleted all topics (aka it publish an empty payload or whatever) and that removed all my hassagent devices But even after that I still couldn’t get it working. I’m going to try Amadeos suggestions later when I’m off work. 😁
Martijn Hoogenbosch
The weird thing is my old laptop does get discovered sometimes. I went through the settings in hass but also char by char in mqtt explorer, don’t see any difference except for the guid
Fielmacrits
Fielmacrits4mo ago
My current theory, based on nothing but a hunch, is there is some stored on home assistant that is persisting even after removing the devices. Need to figure out how to purge all memory of hassagent ever existing on my home assistant instance and start from scratch. just don’t know where to find what I’m looking for. And I’m also not to the point of going scorched earth policy and starting Home Assistant from scratch… though I have not started fresh since … Hassio 0.7#? Been here for a while… lol *new installs yes, but restored from backups
Amadeo
Amadeo4mo ago
Need to figure out how to purge all memory of hassagent ever existing on my home assistant instance and start from scratch. just don’t know where to find what I’m looking for.
that's rough 😄 there is a file that stores all devices and entities let's start with me doing some basic tests since I'm finally at PC good and bad news:
1. upgrade to 2024.7.2 - media player & notifications work
2. remove my pc (AMADEO-PC) from the integration (delete option after clicking on 3 dots)
3. close HASS.Agent
4. remove the "hass.agent/devices/AMADEO-PC" topic & messages via MQTTExplorer
5. restart HomeAssistant
6. start HASS.Agent & wait for it to load (elements either "stopped" or "running")
NOTE: at this moment HomeAssistant integration detected AMADEO-PC but I followed with next points
7. configure AMADEO-PC in HomeAssistant (discovered by the integration) - media player & notifications work
1. upgrade to 2024.7.2 - media player & notifications work
2. remove my pc (AMADEO-PC) from the integration (delete option after clicking on 3 dots)
3. close HASS.Agent
4. remove the "hass.agent/devices/AMADEO-PC" topic & messages via MQTTExplorer
5. restart HomeAssistant
6. start HASS.Agent & wait for it to load (elements either "stopped" or "running")
NOTE: at this moment HomeAssistant integration detected AMADEO-PC but I followed with next points
7. configure AMADEO-PC in HomeAssistant (discovered by the integration) - media player & notifications work
the steps that I followed I'd like both of you to try to follow them step by step in case you don't have the device added, separate step:
X. remove the HASS.Agent 2 Integration from HACS
X2. restart HomeAssistant
X3. install the HASS.Agent 2 Integration
X4. restart HomeAssistant
X. remove the HASS.Agent 2 Integration from HACS
X2. restart HomeAssistant
X3. install the HASS.Agent 2 Integration
X4. restart HomeAssistant
DrR0x
DrR0x4mo ago
That add feature is what I would like to call deprecated but is technically still working. It involves using an API running on the PC instead of mqtt for notifications. So it requires you input an IP address during setup. Whereas mqtt can only be Autodiscovered, there is no data to be input during setup.
Martijn Hoogenbosch
I've got things working too. The point for me was that in core.config_entries file there was a persistant hass_agent entry. Even when I deleted the integration, it stayed there. This entry was a wrongly used name by myself (i'd like to add -hassagent to the identifier). After removing manually, it is gone. Thanks for your support!
Fielmacrits
Fielmacrits4mo ago
THAT DID IT! THANKS! My original computer was still in that core.entity_config file even though I had deleted the integration so long ago.
Amadeo
Amadeo4mo ago
I need to get and dig To find out why HomeAssistant does it
Martijn Hoogenbosch
If there is anything I can check or test just let me know. the entry which I removed was the following: { "data": {}, "disabled_by": null, "domain": "hass_agent", "entry_id": "01J2VV840EAZ1CF6C41YZ6YG3N", "minor_version": 1, "options": {}, "pref_disable_new_entities": false, "pref_disable_polling": false, "source": "ignore", "title": "DESKTOP-1Q0ER13", "unique_id": "470a9b23-afa7-4983-a8c6-d4cc49d300b4", "version": 1 }, so it has a really different look and feel compared to my correct entity..
Want results from more Discord servers?
Add your server