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
73.63k stars 30.78k forks source link

evohome fails with IndexError: list index out of range #27768

Closed Zynth-dev closed 5 years ago

Zynth-dev commented 5 years ago

Home Assistant release with the issue: 100.2

Last working Home Assistant release (if known): unknown

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

Integration: evohome

Description of problem: Similar to issue #27161, which supposedly should have been solved but still seems to have a problem. I use a "round wireless connect".

From the first line below, it seems that the code which is delivered in issue #27161 is already active (because of the "Location/Controller (EvoTouch)" being printed), but still produces the same error. The line number of the error is also different from the line number in the other issue.

Also no climate.*** seems to be created; which should happen if I'm correct. I did not use this integration before...

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
probot-home-assistant[bot] commented 5 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 5 years ago

[edited] this is a distinct issue to #27161

@Zynth1 thanks for your useful post, I am sure we can get this sorted for you.

I can see you have a RoundWireless, and it appears to be picked up correctly. This issue is that the thermostat's schedule is not being processed without causing an exception. Because that exception occurs during HA startup, the climate entity is not created.

So, questions:

The best/quickest way forward 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.

Zynth-dev commented 5 years ago

@zxdavb Thanks for your kind reply and useful suggestion. I have checked, and indeed there was one entry in the schedule.

I have removed it, and now it works perfectly.

Can I assist in further debugging, or is this a known limitation for now?

zxdavb commented 5 years ago

That's great you're back up and running. I'm not surprised with what you found and that what you did resolved the issue.

It is a logic error in my my code.

The next version of evohome, in HA v101, has an extra debug line that would have have been very helpful.

The problem is that I don't have full access to any thermostats (single zone locations) with which I can do extensive testing - merely read-only access.

Anyway I think there's a change I can make which will will resolve the issue, albeit at the cost of additional I/O.

zxdavb commented 5 years ago

Please don't close this issue, I will be submitting a PR to address it.

Zynth-dev commented 5 years ago

@zxdavb please let me know if I can provide you with additional debug information.

avlemos commented 1 year ago

fyi, this is still happening to this day