home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.19k stars 29.85k forks source link

evohome Round Thermostat: fails with IndexError: list index out of range #27161

Closed pieterbos closed 4 years ago

pieterbos commented 4 years ago

Home Assistant release with the issue: 0.99.3

Last working Home Assistant release (if known): 0.94.1

Operating environment (Hass.io/Docker/Windows/etc.): Hass.io

Integration: Both honeywell and evohome have problems with this version

Description of problem: I used the honeywell component in version 0.94.1 to control my Honeywell Round Connected Wireless On/Off thermostat. And this has worked for many versions. It stopped working, in the sense that it does not even add an entity. All it does is printing:

019-10-03 22:25:09 INFO (SyncWorker_10) [homeassistant.loader] Loaded honeywell from homeassistant.components.honeywell
2019-10-03 22:25:15 INFO (MainThread) [homeassistant.components.climate] Setting up climate.honeywell
2019-10-03 22:25:15 WARNING (SyncWorker_12) [homeassistant.components.honeywell.climate] The honeywell component has been deprecated for EU (i.e. non-US) systems. For EU-based systems, use the evohome component, see: https://home-assistant.io/components/evohome
2019-10-03 22:25:43 DEBUG (SyncWorker_3) [homeassistant.util.json] JSON file not found: /usr/src/homeassistant/homeassistant/components/honeywell/.translations/climate.en.json

I noticed this component was deprecated in favor of evohome. I tried switching to evohome. I can now see the temperature, I can switch hvac_mode from heat to off and back. I can set preset modes. But there is no possible way to set a temperature, other than controlling hvac_mode with off and heat.

there is also no temperature setpoint visible in the state of the entity at all. It does not matter which present_mode I select.

The log contains a traceback with the evohome component, see below.

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant): When trying with evohome:


evohome:
    username: secret
    password: secret

And with honeywell:

climate:
  - platform: honeywell
    username: secret
    password: secret
    region: eu

Traceback (if applicable):

With evohome, the following traceback appears:

2019-10-03 22:09:15 ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.thermostat fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 261, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 439, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 414, in async_update
    await self._update_schedule()
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 405, in _update_schedule
    or parse_datetime(self.setpoints["next"]["from"]) < utcnow()
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 309, in setpoints
    day = self._schedule["DailySchedules"][day_of_week]
IndexError: list index out of range

Note that there is no entity 'climate.thermostat'. There is only 'climate.huis'. I tried renaming the location to 'thermostat'. That did not help at all, it merely changes the error to 'Update for climate.thermostat_2 fails'.

Also sometimes:

2019-10-03 22:29:23 DEBUG (MainThread) [coap] New unique message received
2019-10-03 22:29:23 DEBUG (MainThread) [coap] Exchange removed, message ID: 31443.
--
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 363, in device_state_attributes
    status["setpoints"] = self.setpoints
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 309, in setpoints
    day = self._schedule["DailySchedules"][day_of_week]
IndexError: list index out of range

Additional information:

State of evohome entity climate.huis:

{
  "hvac_modes": [
    "off",
    "heat"
  ],
  "current_temperature": 20.5,
  "min_temp": 7,
  "max_temp": 35,
  "preset_mode": "home",
  "preset_modes": [
    "away",
    "Custom",
    "eco",
    "home",
    "Reset"
  ],
  "status": {
    "systemId": "3520721",
    "activeFaults": [],
    "systemModeStatus": {
      "mode": "DayOff",
      "isPermanent": true
    }
  },
  "friendly_name": "Huis",
  "icon": "mdi:thermostat",
  "supported_features": 16
}

Note the lack of a temperature setpoint. Also note that I set the preset mode to 'home', but evohome set the systemModeStatus to 'day off'!

Log with evohome:

2019-10-03 22:29:06 INFO (MainThread) [homeassistant.setup] Setting up evohome
2019-10-03 22:29:14 DEBUG (MainThread) [evohomeasync2] Debug mode is not explicitly enabled (but may be enabled elsewhere).
2019-10-03 22:29:19 WARNING (MainThread) [homeassistant.setup] Setup of evohome is taking over 10 seconds.
2019-10-03 22:29:22 DEBUG (MainThread) [homeassistant.components.evohome] Config = {'systemId': '3520721', 'modelType': 'EvoTouch', 'zones': [{'zoneId': '3520720', 'modelType': 'RoundWireless', 'setpointCapabilities': {'maxHeatSetpoint': 35.0, 'minHeatSetpoint': 5.0, 'valueResolution': 0.5, 'canControlHeat': True, 'canControlCool': False, 'allowedSetpointModes': ['PermanentOverride', 'FollowSchedule', 'TemporaryOverride'], 'maxDuration': '1.00:00:00', 'timingResolution': '00:10:00'}, 'scheduleCapabilities': {'maxSwitchpointsPerDay': 6, 'minSwitchpointsPerDay': 0, 'timingResolution': '00:10:00', 'setpointValueResolution': 0.5}, 'name': 'Thermostat', 'zoneType': 'Thermostat'}], 'allowedSystemModes': [{'systemMode': 'Auto', 'canBePermanent': True, 'canBeTemporary': False}, {'systemMode': 'AutoWithEco', 'canBePermanent': True, 'canBeTemporary': True, 'maxDuration': '1.00:00:00', 'timingResolution': '01:00:00', 'timingMode': 'Duration'}, {'systemMode': 'Away', 'canBePermanent': True, 'canBeTemporary': True, 'maxDuration': '99.00:00:00', 'timingResolution': '1.00:00:00', 'timingMode': 'Period'}, {'systemMode': 'HeatingOff', 'canBePermanent': True, 'canBeTemporary': False}]}
2019-10-03 22:29:22 DEBUG (SyncWorker_17) [homeassistant.helpers.storage] Writing data for evohome
2019-10-03 22:29:23 DEBUG (MainThread) [homeassistant.components.evohome] Status = {'systemId': '3520721', 'zones': [{'zoneId': '3520720', 'temperatureStatus': {'temperature': 20.5, 'isAvailable': True}, 'activeFaults': [], 'setpointStatus': {'targetHeatTemperature': 20.5, 'setpointMode': 'PermanentOverride'}, 'name': 'Thermostat'}], 'activeFaults': [], 'systemModeStatus': {'mode': 'Auto', 'isPermanent': True}}
2019-10-03 22:29:23 INFO (MainThread) [homeassistant.setup] Setup of domain evohome took 16.5 seconds.
2019-10-03 22:29:23 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=evohome>
2019-10-03 22:29:23 DEBUG (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: service=load_platform.climate, platform=evohome, discovered=>
2019-10-03 22:29:23 INFO (MainThread) [homeassistant.components.climate] Setting up climate.evohome
2019-10-03 22:29:23 DEBUG (MainThread) [homeassistant.components.evohome.climate] Found Location/Controller, id=3520721 [EvoTouch], name=Huis (location_idx=0)
2019-10-03 22:29:23 DEBUG (MainThread) [homeassistant.components.evohome.climate] Found Thermostat, id=3520720 [RoundWireless], name=Thermostat
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 363, in device_state_attributes
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 309, in setpoints
probot-home-assistant[bot] commented 4 years ago

Hey there @zxdavb, mind taking a look at this issue as its been labeled with a integration (honeywell) you are listed as a codeowner for? Thanks!

probot-home-assistant[bot] commented 4 years ago

Hey there @zxdavb, mind taking a look at this issue as its been labeled with a integration (evohome) you are listed as a codeowner for? Thanks!

zxdavb commented 4 years ago

@pieterbos

As you indicate, the honeywell integration no longer supports the Round Connected Thermostat. However, evohome is intended to fully support it.

evohome offers a lot more functionality than honeywell (except, currently, for high-precision temperatures), and as part of that the entity name (and thus entity_id) changed to climate.<location name> from climate.thermostat. Feel free to change it back to 'Huis' as this is not the cause of your issue.

I have tested someone's Round Connected Thermostat system on 0.99.3, and as you can see (screenshot below) it is working for me.

However, there are known problems with this part of the code:

  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 309, in setpoints
    day = self._schedule["DailySchedules"][day_of_week]

... that have been addressed in HA 0.100 (currently in beta).

So, two questions for you:

I am happy to work with you to get this working, and if it remains an issue with v0.100, then the best/quickest way froward would be for you to give me temporary access to you system via the TCC website:

DM me via the forum, if you're willing to take that option, and I'll provide my email address - you can easily remove my access when we're finished.

Untitled

zxdavb commented 4 years ago

Further info: all my testing has been on RoundModulation, but your system is RoundWireless.

So there is this bug:

    if broker.config["zones"][0]["modelType"] == "RoundModulation":

Which I can fix:

    if broker.config["zones"][0]["zoneType"] == "Thermostat":
pieterbos commented 4 years ago

Thank you for the detailed explanation and fixing the bug. It sounds like that could very well be the cause. I indeed have the wireless on/off, as the district heating system here does not work with a modulating thermostat. the valve I have can only be opened or closed, not set halfway.

I have no schedule set - I use automations for that.

I'm willing to test a beta version. I'm not sure how to do that with hass.io though.

zxdavb commented 4 years ago

the district heating system here does not work with a modulating thermostat. the valve I have can only be opened or closed, not set halfway.

I think it's the modulation of the temperature of the circulating volume (like OpenTherm)? On/off switches do TPI (turn pump on/off more/less often per hour), and the boiler will modulate that (i.e. throttle the burner). In neither case is a water valve open halfway - although smart TRVs will do this.

Your issue is that you have no control over the district heating - you have to take the heated water from them at whatever temp they have decided, no?

Anyway, closing this Issue as I think I am sure it has been fixed with #27168, which will be part of 0.100.0b1. I will leave it up to you to work out hoe to use the latest beta with hass.io (I have been told this is possible, but I don't use hass.io personally).

Thanks for your very useful debug logs.

pieterbos commented 4 years ago

Exactly, I have to take the heated water at whatever temperature it comes, although usually it's very hot. The only thing the thermostat can control is whether to fully open or close the valve. That's why I have to use the wireless on/off model.

Anyway, thanks for fixing this!

pieterbos commented 4 years ago

Just updated to 0.100b3. It works, I can now control the temperature again!

Zynth-dev commented 4 years ago

EDIT: Created new issue #27768 for this, since this one is closed

Using Home Assistant 0.100.2 on hassio, I also get this error.

From the first line below, it can be seen that the code which is delivered in the issue above, is already active (because of the "(EvoTouch)" being printed).

Unfortunately it still does not seem to work with the round wireless connected.

2019-10-16 23:20:02 DEBUG (MainThread) [homeassistant.components.evohome.climate] Found the Location/Controller (EvoTouch), id=1228617, name=huiskamer (location_idx=0)
2019-10-16 23:20:02 DEBUG (MainThread) [homeassistant.components.evohome.climate] Found the Thermostat (RoundWireless), id=1228616, name=Thermostat
2019-10-16 23:20:02 ERROR (MainThread) [homeassistant.components.climate] evohome: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 292, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/components/evohome/climate.py", line 396, in async_update
    await super().async_update()
  File "/usr/src/homeassistant/homeassistant/components/evohome/climate.py", line 268, in async_update
    await super().async_update()
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 463, in async_update
    self._device_state_attrs = {"setpoints": self.setpoints}
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 415, in setpoints
    day = self._schedule["DailySchedules"][day_of_week]
IndexError: list index out of range