New Netatmo climate component supporting multiple thermostats/valves

Resolved. Thank you

1 Like

i try to activate this automation with xiaomi switch but not work

could someone help me?
thank you?

- alias: spegni riscaldamneto
trigger:
platform: event
event_type: xiaomi_aqara.click
event_data:
entity_id: binary_sensor.switch_158d0000f0373b
click_type: long_click_press
action:
- service: climate.turn_off
data:
entity_id: climate.cucina
turn_off: 'on'

the error is:
ERROR (MainThread) [homeassistant.helpers.entity] Update for climate.cucina fails
Traceback (most recent call last):
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 221, in async_update_ha_state
await self.async_device_update()
File “/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity.py”, line 349, in async_device_update
await self.hass.async_add_executor_job(self.update)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/netatmo/climate.py”, line 287, in update
self._data.update(no_throttle=True)
File “/usr/local/lib/python3.7/site-packages/homeassistant/util/init.py”, line 224, in wrapper
result = method(*args, **kwargs)
File “/config/custom_components/netatmo/climate.py”, line 381, in update
self.homestatus = pyatmo.HomeStatus(self.auth, home=self.home)
File “/config/deps/lib/python3.7/site-packages/smart_home/Thermostat.py”, line 126, in init
raise NoDevice(“No device found, errors in response”)
smart_home.NoDevice: No device found, errors in response

Quick Fix for V0.89 Climate Component
This component breaks when upgrading to V0.89, but if you like me only use the Climate part of Netatmo, then find a quick fix below:

  1. Download the const.py file from Home Assistant on Github and place it in the custom_components/netatmo folder
  2. Edit climate.py and look for the following line:
    from homeassistant.components.climate import (
  1. Change that line to
    from .const import (
  1. Save the file, and restart Home Assistant

Remember to set discovery: false in your Netatmo configuration or you will get errors saying that all the other sensors from Netatmo cannot be found.

Here is an example on how I set it up, and that works also with version 0.89.0 of Home Assistant:

# Netatmo
netatmo:
  api_key: !secret netatmo_api
  secret_key: !secret netatmo_secret
  username: !secret netatmo_user
  password: !secret netatmo_pass
  discovery: false

climate:
  platform: netatmo
1 Like

So does everything break now every two weeks, kind of annoying ^^

Thanks! I’ve updated the files/procedure in this post. (Essentially just changed the importing place to homeassistant.components.climate.const.)

Since the PR has been merged to dev, I think it won’t take a long time for this to be included in the official releases.

1 Like

I don’t complain, but lastly an ha Update always took some time to fix everything again.

But I can understand because ha is an ongoing opensource project.
Updates are good, but a lot breaking changes in the last weeks.

I have learned something new today: Did not know I could just do the direct import like you describe @Baosong_Shan.

Excellent component: I do have Netatmo thermostats and Netatmo weather station, since the official Neatmo component for climate does not work, I installed this custom_component (climate) and in my config I have as below.
The climate works perfectly, but the weather station is now nowhere, am I missing something?

netatmo:
  api_key: !secret netatmo_api_key
  secret_key: !secret netatmo_secret_key
  username: !secret netatmo_username
  password: !secret netatmo_password
  discovery: False

climate:
  - platform: netatmo

sensor:
  - platform: netatmo
    station: Home
    modules:
       Outdoor:
         - temperature
       Bedroom:
         - temperature
         - min_temp
         - max_temp
         - co2

do I have to rename one of the two? Like one Netatmo and other Netatmo2??

With 0.89 I get this error

Platform not found: sensor.netatmo

I don’t know if this has something to do with this component. When I comment out the sensors from my wheater station, than the config is ok.

Does someone here know how to fix this?

For this custom component I already added the new files to the netatmo folder in custom_components.

Error: Unable to find platform netatmo. Search path was limited to path of component: custom_components

Sorry I don’t have weather station so I cannot test this myself. Possible workaround:

Trying to remove __init__.py from the directory netatmo.

If not working, then you probably have to think about pulling the other files from core/homeassistant/components/netatmo at 0.89.0 · home-assistant/core · GitHub

So thirst thing I should do is removing the init file in the custom_components/netatmo folder?
Without replacing it with something?

And if it doesn’t work where should I put the files from link?

EDIT: @Baosong_Shan you really are a rockstar, deleted the init.py file in the netatmo folder and works again.

BUT one more thing:
I get this with 0.89.

I had this before with the old way we had it (think was home).

you need to add other files, otherwise, you will not have neatmo climate component

This means you should put back __init__.py, and download others from gitlab as well, as @Molodax pointed out.

I think I will need some more information, where should I put which files? I use hassio.

  1. re-add init.py to custom_components/netatmo from @Baosong_Shan
  2. ?
  3. ?

Let’s make everything simple! Just download all the files from core/homeassistant/components/netatmo at dev · home-assistant/core · GitHub and put into your custom_components/netatmo directory, then restart your HA. By this way you would be able to test the possible next release which includes this change.

1 Like

Did that, works again. Thanks!

like putting sensor.py in your custom_component/netatmo directory? binary_sensor.py too?

Why don’t you ask to put your code as the official netatmo component?

He did “asked” and it should be official soon, this is why the files from the dev link above work when you copy it in your custom comp directory. The code from @Baosong_Shanis already in there.

1 Like

great thanks, now changed all the code from the dev branch