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
72.55k stars 30.35k forks source link

Error while setting up platform netatmo #22254

Closed naamah75 closed 5 years ago

naamah75 commented 5 years ago

Home Assistant release with the issue: 0.90.0

Last working Home Assistant release (if known): 0.89.2

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

Component/platform: Netatmo Thermostat / Climate

Error while setting up platform netatmo
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/netatmo/climate.py", line 96, in setup_platform
    for room_id in room_data.get_room_ids():
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/netatmo/climate.py", line 342, in get_room_ids
    if not self.setup():
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/netatmo/climate.py", line 355, in setup
    self.update()
  File "/usr/local/lib/python3.7/site-packages/homeassistant/util/__init__.py", line 224, in wrapper
    result = method(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/netatmo/climate.py", line 379, in update
    homestatus_room['therm_setpoint_temperature']
KeyError: 'therm_setpoint_temperature'
SNoof85 commented 5 years ago

Could you post your yaml config of the netatmo integration and are you using the climate part (if yes would be nice to see the config as well if any)

naamah75 commented 5 years ago

Now it works! It was an unlucky coincidence with a temporary unavailability of a netatmo server. Thanks for your time!

SNoof85 commented 5 years ago

That may happen 👎 You can close issue then !

pmdhaussy commented 5 years ago

Exact same error for me but persistent.

pmdhaussy commented 5 years ago

I got it. If reachable is false. room object is not complete.

    {
        "id": "1824307100",
        "reachable": true,
        "therm_measured_temperature": 22,
        "heating_power_request": 0,
        "therm_setpoint_temperature": 16,
        "therm_setpoint_mode": "schedule",
        "therm_setpoint_start_time": 1554059734,
        "therm_setpoint_end_time": 0,
        "anticipating": false,
        "open_window": false
    },
    {
        "id": "2369613104",
        "reachable": false
    }

So therm_setpoint_temperature isn't available when valve is unreachable (connection issue, batteries depleted, ...).