Adding support for Netatmo Thermostat

@gieljnssns

The netatmo module isn’t loading anymore :

Error during setup of component netatmo
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/setup.py", line 146, in _async_setup_component
    component.setup, hass, processed_config)  # type: ignore
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/homeassistant/components/netatmo.py", line 48, in setup
    import lnetatmo
ImportError: No module named 'lnetatmo'

If your on 0.71 the module lnetatmo is replaced by pyatmo

What do I need to do to fix it ?

How did you install home-assistant? Hassio, hassbian?
Are you only using netatmo climate?

@gieljnssns
I’ve installed HA on raspbian using this method:

Yes, I’m using only climate.

@MickBru
do you still have a lnetatmo-....egg-info folder in

/srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/

try to delete this and restart

@gieljnssns
Done! The Netatmo component is loaded!

But I still have an issue, I see only one thermostat in the dashboard, and two in the state dev tool, but both with the same values (relay A shows values A ; relay B shows values A) (I’ve set different target values to be sure)

01

@MickBru
Do you have set Discovery to false

How did you fix this?

@gieljnssns

I’ve deleted the lnetatmo folder in /srv/homeassistant/homeassistant_venv/lib/python3.5/site-packages/

No.
I didn’t set climate parameters too (relay and thermostat).
It was working like this before the HA update.
Maybe I need to set it in a different way ?

I had some time, and I’ve tried to rewrite the netatmo-api for the new Energy API.
I only have 1 Thermostat, no valves.

In my home-assistant this is working.

If someone can test this:
Make a custom_components folder in /config
place this file in the folder https://gist.github.com/gieljnssns/9406291de78d19a8732b2dab6ac2a813
Make a climate folder in the custom_components folder and place this file in there https://gist.github.com/gieljnssns/4ff4d0d5548c614c548de8b77dcd11d2
Make another app in https://dev.netatmo.com/myaccount/
In your configuration.yaml:

netatmo2:
  api_key: !secret netatmo2_api_key
  secret_key: !secret netatmo2_secret_key
  username: !secret netatmo2_username
  password: !secret netatmo2_password
  discovery: False

climate:
  - platform: netatmo2

Please report here what’s working and what’s not.

I have this error

2018-08-23 19:01:43 ERROR (MainThread) [homeassistant.setup] Error during setup of component netatmo
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/setup.py”, line 148, in _async_setup_component
component.setup, hass, processed_config) # type: ignore
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/netatmo.py”, line 46, in setup
import pyatmo
File “/usr/local/lib/python3.6/site-packages/pyatmo.py”, line 18, in
from smart_home.PublicData import PublicData
ModuleNotFoundError: No module named ‘smart_home.PublicData’
2018-08-23 19:01:43 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of climate.netatmo. Setup failed for dependencies: netatmo
2018-08-23 19:01:43 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform climate.netatmo: Could not setup all dependencies.
2018-08-23 19:01:43 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of sensor.netatmo. Setup failed for dependencies: netatmo
2018-08-23 19:01:43 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform sensor.netatmo: Could not setup all dependencies.

Hello,

I have a netatmo thermostat and this is my config in HA in climate.yaml:

- platform: netatmo
  relay: relay_T
  thermostat:
    - Termostato

Also in configuration.yaml i have this:

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

And all works fine…

The problem is that when i see logs i can see few errors:

2018-09-06 22:58:31 ERROR (MainThread) [homeassistant.components.binary_sensor] Error while setting up platform netatmo
Traceback (most recent call last):
File “/usr/src/app/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/components/binary_sensor/netatmo.py”, line 73, in setup_platform
if not data.get_camera_names():
File “/usr/src/app/homeassistant/components/netatmo.py”, line 82, in get_camera_names
self.update()
File “/usr/src/app/homeassistant/util/init.py”, line 325, in wrapper
result = method(*args, **kwargs)
File “/usr/src/app/homeassistant/components/netatmo.py”, line 113, in update
self.camera_data = pyatmo.CameraData(self.auth, size=100)
File “/usr/local/lib/python3.6/site-packages/smart_home/Camera.py”, line 79, in init
self.default_camera = list(self.cameras[self.default_home].values())[0]
AttributeError: ‘CameraData’ object has no attribute ‘default_home’
2018-09-06 22:58:31 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform netatmo
Traceback (most recent call last):
File “/usr/src/app/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/components/climate/netatmo.py”, line 50, in setup_platform
for module_name in data.get_module_names():
File “/usr/src/app/homeassistant/components/climate/netatmo.py”, line 164, in get_module_names
for module in self.thermostatdata.modules[self.device].values():
KeyError: ‘relay_T’
2018-09-06 22:58:38 WARNING (MainThread) [homeassistant.setup] Setup of config is taking over 10 seconds.
2018-09-06 22:58:43 ERROR (SyncWorker_14) [homeassistant.components.sensor.nut] NUT Sensor has no data, unable to set up
2018-09-06 22:58:43 WARNING (MainThread) [homeassistant.components.sensor] Platform nut not ready yet. Retrying in 30 seconds.
2018-09-06 22:58:48 ERROR (MainThread) [homeassistant.components.camera] Error while setting up platform netatmo
Traceback (most recent call last):
File “/usr/src/app/homeassistant/helpers/entity_platform.py”, line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File “/usr/local/lib/python3.6/asyncio/tasks.py”, line 358, in wait_for
return fut.result()
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/src/app/homeassistant/components/camera/netatmo.py”, line 40, in setup_platform
for camera_name in data.get_camera_names():
File “/usr/src/app/homeassistant/components/netatmo.py”, line 82, in get_camera_names
self.update()
File “/usr/src/app/homeassistant/util/init.py”, line 325, in wrapper
result = method(*args, **kwargs)
File “/usr/src/app/homeassistant/components/netatmo.py”, line 113, in update

In binary_sesnor i don’t have any configuration about netatmo, just i have to see battery about my xioami sensors.

What can i do to take out this error logs?

thanks

Since this component is not working witrh multiple devices I am going to abandon it. Will try Netatmo and IFTTT.

Anyone knows how to use it with IFTTT?

I did with webhooks

with ifttt.trigger in HASS and calling Netatmo Set thermostat value

Based on gieljnssns’s work, I revised a version which supports multiple devices. It has been tested with 1 thermostat + 1 valve, and 0 thermostat + 2 valves (thanks to briis). All are welcome to test and report the results. Thanks!

with two thermostat is not working (answered in other thread)

Hey there…
nobody actually can make two or more thermostat work together?
thanks

I don’t have multiple thermostats or valves from Netatmo so I can’t verify, but from what I can read on this thread I have the impression that it is working now.

Oh thanks… now it’s working also for me!! Thanks a lot!

1 Like