Added support for Vaillant Thermostat, how to integrate in official release

Hi Tarbax,

From what I can see, it’s because it doesn’t load my fork of the lnetatmo lib, and uses the standard one : I had to change the login to add support for vaillant thermostat (2 supplementary parameters)

What’s strange is that is should be automatically downloaded :

REQUIREMENTS = [
    'https://github.com/samueldumont/netatmo-api-python/archive/'
    'v0.9.2-vaillant.zip#lnetatmo==0.9.2-vaillant'] 

I always use a docker containter and did not test on a “regular” server, but I see that at first launch, it tries to download the lnetatmo lib I specified.

What I could do is change the name of the lib instead of the version, so it wouldn’t impact the currently installed lnetatmo but I thought HA would download automatically my version.

Can you manually install my version ? It’s backward compatible so if you have a netatmo device, it will still work. You can do it with this command :

pip install --upgrade git+git://github.com/samueldumont/netatmo-api-python.git

Hi Samueldumont,

i tried to manually install netatmo api python git but hassio locked root and has a limited CLI.
can it be installed manually?

Hi samueldumont, I think i have the same issue as tarbax!
I read through your github files and found the required section and then manually installed it
using the way you suggested to tarbax see below
:/home/pi $ pip3 install --upgrade git+git://github.com/samueldumont/netatmo-api-python.git

Collecting git+git://github.com/samueldumont/netatmo-api-python.git
Cloning git://github.com/samueldumont/netatmo-api-python.git to /tmp/pip-t4qyn0me-build
Installing collected packages: lnetatmo
Found existing installation: lnetatmo 0.9.2-vaillant
Uninstalling lnetatmo-0.9.2-vaillant:
Successfully uninstalled lnetatmo-0.9.2-vaillant
Running setup.py install for lnetatmo … done
Successfully installed lnetatmo-0.9.2-vaillant
the log entry is now
2018-01-02 16:47:23 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.5/asyncio/tasks.py”, line 239, in _step
result = coro.send(None)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py”, line 399, in async_process_entity
new_entity, self, update_before_add=update_before_add
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_component.py”, line 247, in async_add_entity
yield from entity.async_update_ha_state()
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 231, in async_update_ha_state
attr)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity.py”, line 333, in _attr_setter
value = getattr(self, name)
File “/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/climate/init.py”, line 736, in supported_features
raise NotImplementedError()
NotImplementedError

From reading this : https://github.com/home-assistant/home-assistant/issues/10928
it could have something to do with the version of HA - I’m running the latest
Home Assistant
0.60.0

Which version are you running?

Thanks again

Hi Sampras,

Did you take the last version in my repo :

It contains the needed changed for version 0.60.0. I’m running that one at home so I can confirm it’s working with those changes.

BTW, the state (Idle or running) is not working with Vaillant. This specific element is not present in the results given by the API

i added netatmo.py files in the custom compoments and subfolder climate and now everything is working fine!
just put everything in custom components and it should work.

Thanks for your contribution Samueldumont.

Cooool ! I’m glad that it’s working :slight_smile: I will try to see if we can integrate this in the main codebase. I’ll keep the code updated with future releases anyway so keep an eye on the repo when a new version of HA is released.

1 Like

Hi,
Yes that’s working now :- so for me on a rpi3 with a python virtual env
I put the above files into the /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/climate/vaillant.py
and the other in
/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/vaillant.py
and manually installed the netatmo, after activating my virtual env
with
pip install --upgrade git+git://github.com/samueldumont/netatmo-api-python.git
then followed config that samueldumont suggested.

Thanks for this samueldumont - Brilliant!

Hello Samuel,

Great job that you did!
I contacted Vaillant a few weeks ago asking for “Google Home”, “Apple HomeKit” or “Amazon Alexa” support and they replied : “no way, we will never do that, just use IFTTT”.
I’m so happy to see that there is an alternative.

I’ve questions for you:

  • Where in the Android app do I find the API key that you’re talking about?
  • There is no need for the IP of the Gateway?
  • Can you please send me the “secret_key”, please?

Thank you so very much !

Hi Olivier,

You can find it if you decompile the APK and search for “na_client_android_vaillant”. The key will be somewhere around that.

I will send it to you by PM so you don’t have to worry to much about finding it.

The IP of the gateway is not needed : the communication is done directly to Netatmo’s API, which sends the control back to the gateway (same way as when you use the app)

Have fun !

Hi Samuel,

Thank you for the feedback.

If I put the vaillant.py in components/climate (and do “pip install --upgrade …” as suggested by sampras):
2018-01-05 10:55:39 ERROR (MainThread) [homeassistant.loader] Unable to find component climate.vaillant
2018-01-05 10:55:45 ERROR (MainThread) [homeassistant.loader] Circular dependency detected: vaillant -> vaillant
2018-01-05 10:55:45 ERROR (MainThread) [homeassistant.setup] Setup failed for vaillant: Unable to resolve component or dependencies.

If I put it in components directly (as suggested by you):
2018-01-05 10:58:21 ERROR (MainThread) [homeassistant.loader] Unable to find component vaillant
2018-01-05 10:58:21 ERROR (MainThread) [homeassistant.setup] Setup failed for vaillant: Component not found.
2018-01-05 10:58:23 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of climate.vaillant. Setup failed for dependencies: vaillant
2018-01-05 10:58:23 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform climate.vaillant: Could not setup all dependencies.

I’m using HA 0.60.0 as well.

Thank you for your help so far.

Hi Olivier,

Don’t forget that you have to put two files :

vaillant.py in components, (https://raw.githubusercontent.com/samueldumont/home-assistant/added_vaillant/homeassistant/components/vaillant.py)
and vaillant.py in components/climate (https://raw.githubusercontent.com/samueldumont/home-assistant/added_vaillant/homeassistant/components/climate/vaillant.py)

You can see the same thing with netatmo, with a netatmo.py in each of those folders.

After that, it should work :slight_smile:

Thank you, I was confused by the name that was the same.
Now it seems better but something is wrong with the configuration … Maybe I did not get correctly what to put in the configuration.yalm file.

2018-01-05 12:00:55 WARNING (MainThread) [homeassistant.setup] Setup of climate is taking over 10 seconds.
2018-01-05 12:00:59 ERROR (Thread-6) [homeassistant.components.vaillant] Unable to connect to Netatmo API
2018-01-05 12:00:59 ERROR (MainThread) [homeassistant.setup] Setup failed for vaillant: Component failed to initialize.
2018-01-05 12:01:00 ERROR (MainThread) [homeassistant.setup] Unable to setup dependencies of climate.vaillant. Setup failed for dependencies: vaillant
2018-01-05 12:01:00 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform climate.vaillant: Could not setup all dependencies.
2018-01-05 12:01:01 WARNING (MainThread) [homeassistant.setup] Setup of sensor is taking over 10 seconds.
2018-01-05 12:01:03 WARNING (MainThread) [homeassistant.setup] Setup of tts is taking over 10 seconds.

# Vaillant vSmart
vaillant:
  api_key: na_client_android_vaillant
  secret_key: <what you provided me>
  username: <my mail address as it is in the smartphone app>
  password: <my secret vaillant password>
  discovery: False

climate:
  - platform: vaillant

api_key is the part that is not clear to me (sorry to bother you with my problem)
I have an android Samsung J5 and don’t know where to find the info neither in my iPhone 6s.
I’m feeling that I’m very close to the solution but not quiet yet.

Hey Olivier,

The api_key should stay like that, this is fixed. The issue here is that it can’t connect to the API but it would be good to have a tracelog for this error, so I would know what’s the issue.

Did you install my version of lnetatmo ?
When installed, it appears at this place : /config/deps/lib/python3.6/site-packages/lnetatmo.py (but this may vary per system so take it with a grain of salt)

You can run :
pip -v install --upgrade git+https://github.com/samueldumont/netatmo-api-python.git
then
pip show lnetatmo

This should output

Name: lnetatmo
Version: 0.9.2-vaillant
Summary: Simple API to access Vaillant vSmart thermostat data (rebranded Netatmo thermostat)
Home-page: https://github.com/samueldumont/netatmo-api-python
Author: Samuel Dumont, forked from Philippe Larduinat
Author-email: [email protected], [email protected]
License: Open Source
Location: /usr/local/lib/python3.6/site-packages
Requires:

After that, it should be able to connect

1 Like

Thank you for your help Samuel.
It works now.
The library was the good one but I thought that my password, containing some special characters, needed to be escaped with some backslashes.
That was the issue, it is not needed.

Excellent job Samuel, All running here now. :smiley:

Hi all,

All working here also !!

Nice job !!

I had same issues as the other folks and I needed to re-install Netatmo.

but at the end it worked !!

merci Samuel.

Hi all,

something happened and now stopped working…

when I take a look at the daemon status I can see this:

pi@raspberrypi:/home/homeassistant/.homeassistant $ sudo systemctl status homeassistant.service
● homeassistant.service - Home Assistant
Loaded: loaded (/etc/systemd/system/homeassistant.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2018-01-08 12:55:28 CET; 12s ago
Main PID: 2643 (hass)
CGroup: /system.slice/homeassistant.service
├─2643 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant
└─2674 /srv/homeassistant/bin/python3 -m pip install --quiet https://github.com/jabesq/netatmo-api-python/archive/v0.9.2.1.zip#lnetatmo==0.9.2.1 --upgrade --constraint /srv/homeassistant/lib/python3.5/site-packages

which seems to update the Netatmo to 9.2.1

after this I can see:

● homeassistant.service - Home Assistant
Loaded: loaded (/etc/systemd/system/homeassistant.service; enabled; vendor preset: enabled)
Active: active (running) since Mon 2018-01-08 12:55:28 CET; 35s ago
Main PID: 2643 (hass)
CGroup: /system.slice/homeassistant.service
├─2643 /srv/homeassistant/bin/python3 /srv/homeassistant/bin/hass -c /home/homeassistant/.homeassistant
├─2693 /srv/homeassistant/bin/python3 -m pip install --quiet https://github.com/samueldumont/netatmo-api-python/archive/v0.9.2-vaillant.zip#lnetatmo==0.9.2-vaillant

any clue ?

now it is not working :frowning:

Hi macmanu,

I’ll look into that, HomeAssistant was upgraded a few days ago and I’m working on keeping my version up to date. I bumped the lnetatmo lib version and it’s currently building on dockerhub. As soon as it’s finished, I’ll check everything and keep you posted :slight_smile:

Hi macmanu,

I updated the files so the version of my fork is now higher. I tested with HA 0.60.1 and I don’t have any issue. Should be good for you after an update :slight_smile:

is it working in HA v0.64 ?
my configuration gives error after the update :-/