Error with Netatmo Climate

Tags: #<Tag:0x00007f326eda4510> #<Tag:0x00007f326eda43a8>

Hi everybody,

since yesterday, I’ve got the following error with the Netatmo thermostat…
I tried to reinstall the integration, reset the Netatmo credentials, reboot again and again…

Logger: homeassistant.components.climate
Source: components/netatmo/climate.py:319 
Integration: Thermostat (documentation, issues) 
First occurred: 21:32:34 (1 occurrences) 
Last logged: 21:32:34

Error while setting up netatmo platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 201, in _async_setup_platform
    await asyncio.gather(*pending)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 310, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 481, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 522, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 322, in _async_write_ha_state
    attr.update(self.state_attributes or {})
  File "/usr/src/homeassistant/homeassistant/components/climate/__init__.py", line 258, in state_attributes
    if self.hvac_action:
  File "/usr/src/homeassistant/homeassistant/components/netatmo/climate.py", line 319, in hvac_action
    return CURRENT_HVAC_MAP_NETATMO[self._boilerstatus]
KeyError: None

Could you help me ?

Thank you in advance !

This is a bug and needs to be fixed. If you’re happy to mess with your installation I can provide you a fix early (for testing). Otherwise you’d have to wait for the PR to get merged.

Hi cgtobi !

I could try your fix with pleasure if you wish !! :slight_smile:

It’s a very tiny change:

I never done this kind of modification, could you tell me where I have to change ?

Depending on how you’re running HA you have connect to that (e.g. core on a Raspberry Pi, use ssh) to open /usr/src/homeassistant/homeassistant/components/netatmo/climate.py in an editor (e.g. nano or vi) and navigate to line 318.

If you tell me how you’re running HA I can give you more specific instructions.

My HA is running on a NUC, with a docker installed on Debian 10.
My /usr/src/ is empty… (tested with a ls -a)

I tried to create a /custom_component/netatmo/ and the modification you’ve done is working !
So I will wait for the deployment !

Thank you for your reactivity !!

Great. The PR is approved and will get merged soon. It should land in .116 I think.