Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a second evohome location creates error during setup #15

Open
jwmaas opened this issue Dec 15, 2023 · 7 comments
Open

Adding a second evohome location creates error during setup #15

jwmaas opened this issue Dec 15, 2023 · 7 comments

Comments

@jwmaas
Copy link

jwmaas commented Dec 15, 2023

I have added a second evohome location exactly following the steps in the wiki.
I have two separate accounts on the Total Connect website.
I am running Home Assistant 2023.12.3

I get the following error:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 332, in _async_setup_component
result = await task
^^^^^^^^^^
File "/config/custom_components/customevohome3/init.py", line 265, in async_setup
await broker.save_auth_tokens()
File "/config/custom_components/customevohome3/init.py", line 445, in save_auth_tokens
user_id = self.client_v1.user_data["userInfo"]["userID"] # type: ignore[index]
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'userInfo'

In this case the error is in setting up the custom component (the evohome component loads as it should). But sometimes I get the same error in setting up the evohome component itself (but then the custom component loads successfully). I have been running the main and custom approach for a few years without any issues. The problem first appeared in HA 2023.12.1 (not 100% sure).

@jwmaas
Copy link
Author

jwmaas commented Dec 15, 2023

I solved this issue by painstakingly following the wiki for multiple evohome locations. Then I decided to change the execution rights of the custom component files as follows, as suggested by @sesame26 :
image

I also changed the call frequency to 600 seconds.
One of these solutions did the trick.

@Ingo-Klein
Copy link

same problem:

Logger: homeassistant.setup
Source: setup.py:332
First occurred: 18. Dezember 2023 um 00:44:54 (1 occurrences)
Last logged: 18. Dezember 2023 um 00:44:54

Error during setup of component evohome_1
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 332, in _async_setup_component
result = await task
^^^^^^^^^^
File "/config/custom_components/evohome_1/init.py", line 265, in async_setup
await broker.save_auth_tokens()
File "/config/custom_components/evohome_1/init.py", line 445, in save_auth_tokens
user_id = self.client_v1.user_data["userInfo"]["userID"] # type: ignore[index]
~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'userInfo'

I have the same problem..

I have already re-downloaded several times.. set chmod rights to 777... set the frequency to 600 seconds.. all without success

@Ingo-Klein
Copy link

What I also noticed:

location_idx integer (Optional, default: 0)

Only 0 is accepted now... that wasn't the case before either... that's not a problem for me because I have separate accounts. but I noticed this when testing

@jwmaas
Copy link
Author

jwmaas commented Dec 19, 2023

Other things I always do:

  • delete all references to evohome in the .storage directory
  • delete the files in the __ pycache__ directory in your custom evohome directory in custom components
  • do a real cold start

@Ingo-Klein
Copy link

the solution was:

delete all references to evohome in the .storage directory

(then it works again with the old chmod rights)

Excellent ! Thanks alot

@smarthomefamilyverrips
Copy link

smarthomefamilyverrips commented Dec 24, 2023

I solved this issue by painstakingly following the wiki for multiple evohome locations. Then I decided to change the execution rights of the custom component files as follows, as suggested by @sesame26 : image

I also changed the call frequency to 600 seconds. One of these solutions did the trick.

@jwmaas nice to see my suggestion did help you, I also had same problem but just downloading the raw files from HA core files on github and replace the files in custom folder with these (after first manual adjusting the const.py and manifest.json with correct values) did do the trick for me.

Out of curiosity with call frequency you mean setting the scan_interval?

@jwmaas
Copy link
Author

jwmaas commented Dec 24, 2023

That was my usual approach that did not work this time for some reason.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants