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

I think the best idea is to try to merge Migo and vSmart with Netatmo thermostat. I send an email to its developer but I never got an answer.
I’ll take a look to the new format in a few days :wink:

Regards!

1 Like

Still having issues - thought it worked well on HA 0.88.0 but it is not stable. Restarting causes issues. I think it is because HA is updating pyatmo (to version 1.8) when starting HA.

So after running pip3 -v install --upgrade git+https://github.com/samueldumont/netatmo-api-python.git that version is removed and pyatmo 1.8 is installed.

Could that be the reason?

I hope I can get some feedback on this issue. Again, see below for the logs after restarting HA (it runs on a Pi3).

Error during setup of component vaillant
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 154, 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/lib/python3.5/site-packages/homeassistant/components/vaillant.py", line 61, in setup
    config[DOMAIN][CONF_APP_VERSION], config[DOMAIN][CONF_USER_PREFIX])
TypeError: __init__() takes from 1 to 6 positional arguments but 8 were given
1 Like

As of Home Assistant 0.89.0 this component is no longer working.

@Dixietoom @samueldumont any ideas on how to get this working again?

custom_components/vaillant.py and custom_components/climate/vaillant.py now need to be in a separate (dedicated) folder, e.g. custom_components/vaillant/ but this most likely requires some refactoring.

2 Likes

I tried to find the client id decompiling the Android app. However I keep getting a 302 response (invalid client) from the API. Can someone send me the client_id?

Finally got time to look at this.

To get the code from @samueldumont working in Home Assistant >= 0.89.0, change the following lines in climate/vaillant.py:

Old:

from homeassistant.components.climate import (
    STATE_HEAT, STATE_IDLE, ClimateDevice, PLATFORM_SCHEMA,
    SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE, SUPPORT_AWAY_MODE)

New:

from homeassistant.components.climate import ( DOMAIN,
    ClimateDevice, PLATFORM_SCHEMA)
from homeassistant.components.climate.const import (
    STATE_HEAT, STATE_IDLE, SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE, SUPPORT_AWAY_MODE)

(Source files: https://gitlab.com/samueldumont/home-assistant/blob/added_vaillant/homeassistant/components/vaillant.py
and
https://gitlab.com/samueldumont/home-assistant/blob/added_vaillant/homeassistant/components/climate/vaillant.py
)
After changing this, the component works again, but still yields the following error:

Integrations need to be in their own folder. Change climate/vaillant.py to vaillant/climate.py. This will stop working soon.

I will try to look into this soon.

@Dixietoom just pinning your name here

Hello @pjmaenh,

Tried your modification but I must be missing something.
The 2 files of @samueldumont are located there on my installation:

  • /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/vailant.py
  • /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/climate/vailant.py

I did the modification in the climate/vaillant.py file without success (error is “entity unavailable: climate.vaillant”)
And, validating the configuration : Platform not found: climate.vaillant
Should I put one, the other, or both of the files somewhere else? Like custom_components directory?

Thank you if you can help

@pjmaenh
Concerning Integrations need to be in their own folder. Change climate/vaillant.py to vaillant/climate.py. This will stop working soon.

Just move climate/vaillant.py to vaillant/climate.py and vaillant.py to vaillant/init.py

It works for me !

@Olivier1974
Sure the names are correct? Because vaillant should be with double L instead of a single L.
Note that I have put these files inside the config/custom_components folder, instead of the components folder (less issues with future update) but this shouldn’t make too much of a difference…

Also check your log files, you might find more details about the error there. Platform not found can also be an error in the python file (the file exists, but python cannot execute it for some reason).

@mrgoodfriend
Thanks for the suggestion, I tried moving vaillant.py to vaillant/_init_.py but that doesn’t work. Will try your solution. Just renaming climate/vaillant.py to vaillant/climate.py does not work, because then there’s a conflict between vaillant.py and the vaillant directory.

As a workaround, I am now using a different folder for the component (e.g. customvaillant/climate.py) and updated the config, using the new folder name:

climate:
  - platform: customvaillant

Just to be sure: you are sure that you don’t have a compiled (cached) version of the components somewhere in a _pychache_ directory? Because when moving / renaming python files, you should make sure that these directories are empty or removed.

just tried to remove the pycache and restart. still work
in my side I have issue with the Inetamo v.1.4.1 which does not “compile” and move back to v.0.0.8.2

Yes, sorry, did a copy/paste of the path and wrote vaillant at the end but vaillant is with 2 l’s of course. It is the right name on my Pi.

I’ll move everything in the custom_components directory and let us know.

I’ll change the permission to 777 for good measure as well.

Hey everybody,

I’m deeply sorry for the radio silence. I changed my thermostat and don’t use a vaillant anymore (I have a boxx from engie, same component as toon) so did not take any time to update the component.

I’m glad to see that some people took over my humble changes and I hope youll be able to continue. If you need some info about the way i extracted the keys I can help you.

Regards and sorry,

Sam

Hello Vaillant vSmart community

To summarize what worked for me:
I kept @samueldumont 's files in the components directory of home assistant.

  1. Create a directory named “vaillant” in the components directory (e.g.: /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/vaillant )
  2. In this directory,
    a. Get the file https://gitlab.com/samueldumont/home-assistant/blob/added_vaillant/homeassistant/components/vaillant.py and renamed it __init__.py
    b. Get the file https://gitlab.com/samueldumont/home-assistant/blob/added_vaillant/homeassistant/components/climate/vaillant.py and renamed it climate.py
  3. Updated the file climate.py like mentionned by @pjmaenh here above.
  4. Update rights (if needed) to -rw-r--r-- with chmod 644 *

I kept the configuration.yaml as before

climate:
  - platform: vaillant

P.S.: My directory looks like that after starting HA:
-rw-r--r-- 1 homeassistant homeassistant 6148 Apr 6 12:32 climate.py
-rw-r--r-- 1 homeassistant homeassistant 2210 Apr 6 12:49 __init__.py
drwxr-xr-x 2 homeassistant homeassistant 4096 Apr 7 15:56 __pycache__

Hi Olivier, I followed your instructions.
I am using : image: homeassistant/home-assistant
And these 2 files I put into : /usr/src/app/homeassistant/components/vaillant
However after starting this is in my log, any ideas?

2019-04-09 17:30:40 ERROR (MainThread) [homeassistant.components.climate] Error while setting up platform vaillant
Traceback (most recent call last):
  File "/usr/src/app/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/app/homeassistant/components/vaillant/climate.py", line 42, in setup_platform
    vaillant = get_component('vaillant')
TypeError: get_component() missing 1 required positional argument: 'comp_or_platform'

Hi @huuub,

I had this error a few monthes ago.
In my opinion, you did not take the latest version of @samueldumont 's files.
The files did change from the first message of this post and my last comment.
Please check again that you took from the links I gave.

When I take the code from your links, I dont see:

from homeassistant.components.climate import (
STATE_HEAT, STATE_IDLE, ClimateDevice, PLATFORM_SCHEMA,
SUPPORT_TARGET_TEMPERATURE, SUPPORT_OPERATION_MODE, SUPPORT_AWAY_MODE)

But there is :

from homeassistant.components.climate import (
STATE_HEAT, STATE_IDLE, ClimateDevice, PLATFORM_SCHEMA)

I also don’t need to do anything in the …/components folder? Only in …/components/vaillant/, right?

@Olivier1974 , would you mind making a tar file with the files needed to make it work?

Hey MacManu,
having exactly this error now. How did you fix it?

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

That resolved it… I am using the standard homeassistant docker repo btw

You must take the files from:
https://gitlab.com/samueldumont/home-assistant/blob/added_vaillant/homeassistant/components/vaillant.py
and from:
https://gitlab.com/samueldumont/home-assistant/blob/added_vaillant/homeassistant/components/climate/vaillant.py
with this version and the instructions given from @Olivier1974 all now is OK
I have copied in the custom-components folder.

But I have a question:
How can I integrate 2 thermostast at the same time. How must i declare in my configuration.yaml.
One is from netatmo and the other from vaillant.
Thanks in advance.

@myerdacom,

Thanks for the links, I’ve updated my post.
Good question, I don’t know, for the 2 thermostats, I’d try:

climate:
- platform: vaillant
- platform: netatmo

It is a valid yaml configuration, but I’ve no idea if it will work :slight_smile:

I hace tried this:
climate:

  • platform: vaillant
  • platform: netatmo
    But I can only see one at the same time. The other disapear