New Netatmo climate component supporting multiple thermostats/valves


#65

Resolved. Thank you


#66

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


#67

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

#68

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


#69

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.


#70

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.


#71

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


#72

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

#73

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


#74

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


0.89 netatmo sensor don't work anymore
#76

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 https://github.com/home-assistant/home-assistant/tree/0.89.0/homeassistant/components/netatmo


0.89 netatmo sensor don't work anymore
#77

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).


#78

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


#79

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


#80

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. ?

#81

Let’s make everything simple! Just download all the files from https://github.com/home-assistant/home-assistant/tree/dev/homeassistant/components/netatmo 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.


#82

Did that, works again. Thanks!


#83

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?


#84

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.


#85

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