Failure setting up integration
Hi everyone,
Since the last update of the integration to 2.1.0-beta1 I get the following error message in my log in home assistant:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, 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 tried fiddleing around in the script myself, when commenting/removing the line I get this error:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 575, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/hass_agent/__init__.py", line 167, in async_setup_entry
hass.async_create_background_task(handle_apis_changed(hass, entry, apis))
TypeError: HomeAssistant.async_create_background_task() missing 1 required positional argument: 'name'
I tried reinstalling the integration, I rebooted home assistant multiple times, I restarted the the Client and the PC its running on multiple times, and I also tried changing some random setting in the client like the name, some IDs, turning on and off some of the functionalities, but nothing seems to be working and I cant find anything regarding my issue online.
Any help would be appreciated.
I run home assistant yellow on the newest stable version of that matters.
And my client runs on the newest version of windows 11.8 Replies
You need to head over to our docs and follow the new installation instructions for the integration
Seeing as you are on the beta version you will need to select beta documentation as well, Ive posted a link below
Installation - Hass Agent Documentation
Access your homeassistant from any windows machine - send notifications, collect data and automate repetitive tasks
I have no idea why, but the auto discovery always popped up with the name of my old computer
When setting up the entity/configuration via auto-discovery, it will add an entity without any issues, but nothing will work (media player, notifications, etc. everything shows up as unavailable)
When ignoring the auto discovery and/or deleting the entry of the auto discovery and adding a new one manually, it will obtain the name of my new PC (the name being what I configured in the settings of the windows client) but I get the error from my inital post
After I renamed the name of my new PC to the name of my old PC, so to the name that pops up in the auto-discovery, everything works without any issues.
But only if I add it via the auto discovery, if I try to add it manually by entering the IP adress of my machine, it results in the same error as from my inital post.
Any idea what might cause this kind of behaviour?
(Also also re-did and reinstalled everything, deleting all configs and what not I could find on my machine but the issue still persists)
So basically:
- Setting up the configuration manually always results in the error from my initial post, no matter what
- Auto discovery shows wrong/old device name for some reason
- Setting the device name to the old device name in the windows client and then adding the configuration via auto-discovery works without any issues
First of all, hass.agent is mainly designed to communicate via MQTT. However it is still possible to use the old local api method, this is the method you saw when typing in the ip. TLDR; don't type in IP, only allow autodiscovery to create devices
Second; there are some autodiscovery issues with the integration that are extremely difficult to debug. Would you be able to get mqtt-explorer and see if you can delete the old device? That should stop it from getting confused between the two.
Thanks for the clarification.
After removing all the old devices/sensors etc. with mqtt-explorer everything works as expected.
Just to summarize:
- Always use auto discovery
- If auto discovery shows the wrong device(name), use mqtt-explorer to delete the old/wrong device/sensor
Yep, although I would love if you report cases of the second point because it helps us remove it happening in future
Not sure if I understand, do you need some additional information/examples from me or can this be "closed"?
Oh this is fine, I'm just saying that hass.agent should not create wrong names, it should be deleting payloads and stuff. So if it happens again just tell me in #🛰・general just so I know it's still hallening