zxdavb / evohome-async

An asyncio Python client to access the Evohome web service
http://evohome-client.readthedocs.org/en/latest/
Apache License 2.0
11 stars 11 forks source link

Multiple Locations: `Config error: 'location_idx' = 1, but the valid range is ...` #14

Closed HonestJohn61 closed 9 months ago

HonestJohn61 commented 9 months ago

Hi, Thanks for doing the work on developing this solution. I followed the instruction carefully, including the check items, but it seems something failed. I'm running HA in a Docker container on a Synology NAS with a macvlan IP address. I logged in as root to the container using Portainer's container console to execute the various instructions. Below are the error logs, summary and detailed. I've also attached an extract from my configuration.yaml and the session. Any help much appreciated.

Summary

Setup failed for custom integration 'evohome_1': Integration failed to initialize.
10:23:37 PM – (ERROR) setup.py
Config error: 'location_idx' = 1, but the valid range is 0-0. Unable to continue. Fix any configuration errors and restart HA
10:23:37 PM – (ERROR) evohome_1 (custom integration)

configuration.yaml redacted extract

evohome:
  username: "username1"
  password: "password1"
  location_idx: 0

evohome_1:
  username: "username2"
  password: "password2" [Includes special characters &#%+]
  location_idx: 1

Checking the custom_component changes:

67ab0b7e9d3b:/config/custom_components/evohome_1# **cat manifest.json**
{
  "version": "0.0.1",
  "domain": "evohome_1",
  "name": "Honeywell Total Connect Comfort (Europe)",
  "codeowners": ["@zxdavb"],
  "documentation": "https://www.home-assistant.io/integrations/evohome",
  "iot_class": "cloud_polling",
  "loggers": ["evohomeasync", "evohomeasync2"],
  "requirements": ["evohome-async==0.4.6"]
}

67ab0b7e9d3b:/config/custom_components/evohome_1# **cat const.py | grep 'DOMAIN'**
DOMAIN = "evohome_1"
STORAGE_KEY = DOMAIN
zxdavb commented 9 months ago

This is the base error message:

Config error: 'location_idx' = 1, but the valid range is 0-0.

This says that your account ("username2") has access to only one location: 0-0 is a range (the first location is 0, and the last is 0). For two locations, it would have been 0-1 (for 3 locations: 0-2, and so on).

So: the obvious thing to do is this:

evohome_1:
  username: "username2"
  password: "password2"
  location_idx: 0

Or maybe "username1" has access to both locations, try (on evohome:):

evohome:
  username: "username1"
  password: "password1"
  location_idx: 1
HonestJohn61 commented 9 months ago

Brilliant! Thanks Dave. I adopted your first suggestion and that worked. Looking at it now, it's obvious that location_idx refers to the TCC login and selection of the location from all those available to that user. I'd set up a second user as suggested, but only granted access to the second location - so to that second user, the location is the first available, location_idx 0.

It's maybe worth reviewing your instructions since your suggested method is the one I followed. That results in the second user having access only to the second location - which is then at odds with Step 6 referring to location_idx: 1.

Many thanks again for the quick response, and such a great integration. Cheers

HonestJohn61 commented 9 months ago

That's fixed it. Thanks

zxdavb commented 9 months ago

Good point - I have changed the wording subtly.

HonestJohn61 commented 9 months ago

Sorry to raise this supplementary point, but the secondary controller/location on evohome_1 is reporting precise temperatures to 0.1 C whereas the primary controller/locaction is reporting to the nearest 0.5 degrees. Both are on location_idx 0 as discussed. Is it possible to reverse the arrangement so the primary location is reported precisely? I also noted that your comment at the top of the Wiki on this suggests that something else may be going on:

_NOTE: The high precision feature (temps measured to 0.01 C rather than 0.5 C) only works with locationidx 0.

zxdavb commented 9 months ago

What you request is not supported.

Just create another secondary account, and that should give you want you want.