Adding support for Netatmo Thermostat

@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

I first noticed that my sensor doesn’t work any more. It looks like this:

    netatmo_thermostat_mode:
      value_template: >-
        {% set devices = [  states.climate.netatmo_device1,
                            states.climate.netatmo_device2,
                            states.climate.netatmo_device3,
                            states.climate.netatmo_device4,
                            states.climate.netatmo_device5 ] %}
        {% set auto_amount = devices | selectattr('attributes.operation_mode','eq','auto') | list | length %}        
        {{ 'auto' if auto_amount == devices | length else 'manual' }}

It stays at manual, but it has to show auto, because all sensors are in “auto” mode.

After that I checked the climate entities. the following happens:

  • When I change a device in the netatmo app it DOESN’T get reported to home assistant any more. So it stays at auto even if it is in manual.

  • When I change the device in home assistant I can see the temp change in the App

So both systems are still connected but something is wrong.

Before opening a new issue, I’d like to ask if someone here can reproduce this behaviour.

Thanks

There is no attribute operation_mode since the climate refactor.

Try:

    netatmo_thermostat_mode:
      value_template: >-
        {% set devices = [  states.climate.netatmo_device1,
                            states.climate.netatmo_device2,
                            states.climate.netatmo_device3,
                            states.climate.netatmo_device4,
                            states.climate.netatmo_device5 ] %}
        {% set auto_amount = devices | selectattr('state','eq','auto') | list | length %}        
        {{ 'auto' if auto_amount == devices | length else 'manual' }}

1 Like

Thanks, this works. But I still have my second issue.

Hm, that works fine here also.

No issues for me either…change temp/schedule in App and it’s refelcted in HA after a few minutes

1 Like