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.56k stars 30.73k forks source link

Evohome fails with ghost zones #30945

Closed eavanvalkenburg closed 4 years ago

eavanvalkenburg commented 4 years ago

Home Assistant release with the issue: 0.104.2

Last working Home Assistant release (if known): --

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

Integration: Evohome

Description of problem: I just started using the Evohome integration after that was installed in my house, but I have an issue where I get a Unknown zone that is not filtered out but does throw an error that seems to throw off the whole thing. I ran it with Debug and in the trace got the config from Evohome and noticed this extra zone:


        {
            "zoneId": "5534575",
            "modelType": "Unknown",
            "setpointCapabilities": {
                "maxHeatSetpoint": 30,
                "minHeatSetpoint": 5,
                "valueResolution": 0.5,
                "canControlHeat": "True",
                "canControlCool": "False",
                "allowedSetpointModes": [
                    "PermanentOverride",
                    "FollowSchedule",
                    "TemporaryOverride"
                ],
                "maxDuration": "1.00:00:00",
                "timingResolution": "00:10:00"
            },
            "scheduleCapabilities": {
                "maxSwitchpointsPerDay": 6,
                "minSwitchpointsPerDay": 1,
                "timingResolution": "00:10:00",
                "setpointValueResolution": 0.5
            },
            "name": "",
            "zoneType": "Unknown"
        }

the problem comes when it tries to query for that from the API, see this ID coming back in the erroring uri request below in the trace. Probably the fix is to filter out zone with ZoneType: Unknown, unless that also has meaning.

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

evohome:
  username: !secret evohome_email
  password: !secret evohome_pass
  scan_interval: 300

Traceback (if applicable):

evohome: Error on device update!
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 299, in _async_add_entity
    await entity.async_device_update(warning=False)
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 459, in async_device_update
    await self.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 515, in async_update
    await self._update_schedule()  # no schedule, or it's out-of-date
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 506, in _update_schedule
    self._evo_device.schedule(), refresh=False
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 414, in _call_client_api
    if not _handle_exception(err):
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 104, in _handle_exception
    raise err
  File "/usr/src/homeassistant/homeassistant/components/evohome/__init__.py", line 412, in _call_client_api
    result = await api_function
  File "/usr/local/lib/python3.7/site-packages/evohomeasync2/zone.py", line 22, in schedule
    response.raise_for_status()
  File "/usr/local/lib/python3.7/site-packages/aiohttp/client_reqrep.py", line 946, in raise_for_status
    headers=self.headers)
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url='https://tccna.honeywell.com/WebAPI/emea/api/v1/temperatureZone/5534575/schedule

Additional information:

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

@eavanvalkenburg Thanks for your submission - we should be able to sort you out.

I think I know what's going on (they're called ghost zones), but before we go there, can I ask you to send the two debug lines from your log file in full:

2020-01-18 17:34:09 DEBUG (MainThread) [homeassistant.components.evohome] Config = {'systemId': '3432522', 'modelType': 'EvoTouch', 'zones': [{'zoneId': '3432521', 'modelType': 'HeatingZone', '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': 1, 'timingResolution': '00:10:00', 'setpointValueResolution': 0.5}, 'name': 'Main Room', 'zoneType': 'RadiatorZone'}, {'zoneId': '3432576', 'modelType': 'HeatingZone', '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': 1, 'timingResolution': '00:10:00', 'setpointValueResolution': 0.5}, 'name': 'Front Room', 'zoneType': 'RadiatorZone'}, {'zoneId': '3432577', 'modelType': 'HeatingZone', 'setpointCapabilities': {'maxHeatSetpoint': 24.5, 'minHeatSetpoint': 5.5, 'valueResolution': 0.5, 'canControlHeat': True, 'canControlCool': False, 'allowedSetpointModes': ['PermanentOverride', 'FollowSchedule', 'TemporaryOverride'], 'maxDuration': '1.00:00:00', 'timingResolution': '00:10:00'}, 'scheduleCapabilities': {'maxSwitchpointsPerDay': 6, 'minSwitchpointsPerDay': 1, 'timingResolution': '00:10:00', 'setpointValueResolution': 0.5}, 'name': 'Kitchen', 'zoneType': 'RadiatorZone'}, {'zoneId': '3432578', 'modelType': 'HeatingZone', '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': 1, 'timingResolution': '00:10:00', 'setpointValueResolution': 0.5}, 'name': 'Bedroom', 'zoneType': 'RadiatorZone'}, {'zoneId': '3432579', 'modelType': 'HeatingZone', 'setpointCapabilities': {'maxHeatSetpoint': 24.5, 'minHeatSetpoint': 5.5, 'valueResolution': 0.5, 'canControlHeat': True, 'canControlCool': False, 'allowedSetpointModes': ['PermanentOverride', 'FollowSchedule', 'TemporaryOverride'], 'maxDuration': '1.00:00:00', 'timingResolution': '00:10:00'}, 'scheduleCapabilities': {'maxSwitchpointsPerDay': 6, 'minSwitchpointsPerDay': 1, 'timingResolution': '00:10:00', 'setpointValueResolution': 0.5}, 'name': 'Beans Room', 'zoneType': 'RadiatorZone'}, {'zoneId': '3432580', 'modelType': 'HeatingZone', 'setpointCapabilities': {'maxHeatSetpoint': 24.5, 'minHeatSetpoint': 5.5, 'valueResolution': 0.5, 'canControlHeat': True, 'canControlCool': False, 'allowedSetpointModes': ['PermanentOverride', 'FollowSchedule', 'TemporaryOverride'], 'maxDuration': '1.00:00:00', 'timingResolution': '00:10:00'}, 'scheduleCapabilities': {'maxSwitchpointsPerDay': 6, 'minSwitchpointsPerDay': 1, 'timingResolution': '00:10:00', 'setpointValueResolution': 0.5}, 'name': 'Noos Room', 'zoneType': 'RadiatorZone'}, {'zoneId': '3449703', 'modelType': 'HeatingZone', 'setpointCapabilities': {'maxHeatSetpoint': 24.5, 'minHeatSetpoint': 5.5, 'valueResolution': 0.5, 'canControlHeat': True, 'canControlCool': False, 'allowedSetpointModes': ['PermanentOverride', 'FollowSchedule', 'TemporaryOverride'], 'maxDuration': '1.00:00:00', 'timingResolution': '00:10:00'}, 'scheduleCapabilities': {'maxSwitchpointsPerDay': 6, 'minSwitchpointsPerDay': 1, 'timingResolution': '00:10:00', 'setpointValueResolution': 0.5}, 'name': 'Bathroom', 'zoneType': 'RadiatorZone'}, {'zoneId': '3449740', 'modelType': 'HeatingZone', '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': 1, 'timingResolution': '00:10:00', 'setpointValueResolution': 0.5}, 'name': 'Zone Valve', 'zoneType': 'ZoneValves'}], 'dhw': {'dhwId': '3933910', 'dhwStateCapabilitiesResponse': {'allowedStates': ['On', 'Off'], 'allowedModes': ['FollowSchedule', 'PermanentOverride', 'TemporaryOverride'], 'maxDuration': '1.00:00:00', 'timingResolution': '00:10:00'}, 'scheduleCapabilitiesResponse': {'maxSwitchpointsPerDay': 6, 'minSwitchpointsPerDay': 1, 'timingResolution': '00:10:00'}}, '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': 'AutoWithReset', 'canBePermanent': True, 'canBeTemporary': False}, {'systemMode': 'Away', 'canBePermanent': True, 'canBeTemporary': True, 'maxDuration': '99.00:00:00', 'timingResolution': '1.00:00:00', 'timingMode': 'Period'}, {'systemMode': 'DayOff', 'canBePermanent': True, 'canBeTemporary': True, 'maxDuration': '99.00:00:00', 'timingResolution': '1.00:00:00', 'timingMode': 'Period'}, {'systemMode': 'HeatingOff', 'canBePermanent': True, 'canBeTemporary': False}, {'systemMode': 'Custom', 'canBePermanent': True, 'canBeTemporary': True, 'maxDuration': '99.00:00:00', 'timingResolution': '1.00:00:00', 'timingMode': 'Period'}]}
2020-01-18 17:34:09 DEBUG (MainThread) [homeassistant.components.evohome] Status = {'systemId': '3432522', 'zones': [{'zoneId': '3432521', 'temperatureStatus': {'temperature': 20.0, 'isAvailable': True}, 'activeFaults': [], 'setpointStatus': {'targetHeatTemperature': 20.0, 'setpointMode': 'FollowSchedule'}, 'name': 'Main Room'}, {'zoneId': '3432576', 'temperatureStatus': {'temperature': 20.0, 'isAvailable': True}, 'activeFaults': [], 'setpointStatus': {'targetHeatTemperature': 20.0, 'setpointMode': 'FollowSchedule'}, 'name': 'Front Room'}, {'zoneId': '3432577', 'temperatureStatus': {'temperature': 20.5, 'isAvailable': True}, 'activeFaults': [], 'setpointStatus': {'targetHeatTemperature': 19.5, 'setpointMode': 'FollowSchedule'}, 'name': 'Kitchen'}, {'zoneId': '3432578', 'temperatureStatus': {'temperature': 20.5, 'isAvailable': True}, 'activeFaults': [], 'setpointStatus': {'targetHeatTemperature': 18.5, 'setpointMode': 'FollowSchedule'}, 'name': 'Bedroom'}, {'zoneId': '3432579', 'temperatureStatus': {'temperature': 18.5, 'isAvailable': True}, 'activeFaults': [], 'setpointStatus': {'targetHeatTemperature': 18.5, 'setpointMode': 'FollowSchedule'}, 'name': 'Beans Room'}, {'zoneId': '3432580', 'temperatureStatus': {'temperature': 18.5, 'isAvailable': True}, 'activeFaults': [], 'setpointStatus': {'targetHeatTemperature': 18.5, 'setpointMode': 'FollowSchedule'}, 'name': 'Noos Room'}, {'zoneId': '3449703', 'temperatureStatus': {'temperature': 18.5, 'isAvailable': True}, 'activeFaults': [], 'setpointStatus': {'targetHeatTemperature': 18.5, 'setpointMode': 'FollowSchedule'}, 'name': 'Bathroom'}, {'zoneId': '3449740', 'temperatureStatus': {'temperature': 20.0, 'isAvailable': True}, 'activeFaults': [], 'setpointStatus': {'targetHeatTemperature': 21.0, 'setpointMode': 'FollowSchedule'}, 'name': 'Zone Valve'}], 'dhw': {'dhwId': '3933910', 'temperatureStatus': {'temperature': 44.0, 'isAvailable': True}, 'stateStatus': {'state': 'Off', 'mode': 'FollowSchedule'}, 'activeFaults': []}, 'activeFaults': [], 'systemModeStatus': {'mode': 'Auto', 'isPermanent': True}}

You can PM me the data if you prefer, I am here: https://community.home-assistant.io/u/zxdavb

zxdavb commented 4 years ago

Are you technical enough to edit HA's source files? You could search for evohome\climate.py and do this in async_setup_platform():

    zones = []
    for zone in [z for z in broker.tcs.zones.values() if z.name]:
        _LOGGER.debug(
            "Found a %s (%s), id=%s, name=%s",
            zone.zoneType,
            zone.modelType,
            zone.zoneId,
            zone.name,
        )
        if zone.zoneType != "Unknown":
            new_entity = EvoZone(broker, zone)
            zones.append(new_entity)
eavanvalkenburg commented 4 years ago

Was able to fix it after learning that is called a ghost zone, the fix is to delete your thermostate from your location in the web portal of TCC and then readd it, rebooted HA and no more error, thanks for the pointer!

zxdavb commented 4 years ago

Great - I will add some intelligence to the integration so these zones don't break HA!

zxdavb commented 4 years ago

@eavanvalkenburg FYI (this may or may not be true):

Most evohome Wi-Fi systems receive automatic upgrades and the vast majority are on the latest version of the software and therefore will not experience this issue. In some minor cases the software update has not completed for some reason. Customers who are experiencing a Ghost Zone can quickly be fixed with a push of the new software. To initiate this process please email customer services via getconnected.honeywell.com detailing your Honeywell login address (DO NOT Include your password) detailing the subject heading ‘Ghost zone’

eavanvalkenburg commented 4 years ago

Yeah, that was one of the comments I found as well, but I also found someone who said you can just remove and then re-add your system in the webportal and the ghost zones are gone then as well. I'm currently traveling so when I'm back I'll dubblecheck the version it is running to see if this was a cause as well.

cconiac commented 4 years ago

This clip from Honeywell helped me remove the ghost zone: https://www.youtube.com/watch?v=59t4indBdOE

antald commented 1 year ago

I had problems with the error unknown/invalid zone type. In my app I could see a zone with the temperature from the Opentherm module (water boiler temperature). After removing the system from Locations via [https://international.mytotalconnectcomfort.com/Locations] and adding it again with the MAC and CRC this "Opentherm" zone was gone.

After restarting Home Assistant everything started working with the climate entities.