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

hmmm, after upgrading to HA 0.94 the vaillant component fails to load:

Unable to install package https://github.com/samueldumont/netatmo-api-python/archive/v1.4.1-vaillant.zip#pyatmo==1.4.1-vaillant: ERROR: Could not satisfy constraints for 'pyatmo': installation from path or url cannot be constrained to a version

Got the same message since upgrading to HA 0.94.

I have been looking into this and found a possible solution. Will do some further testing first, stay tuned…

@rudgr, @Derk

A quick update: I got the component working again with HA >= 0.94, after refactoring the pyatmo-vaillant component a bit.

However, since a few days, the pyatmo library stopped working for me, and produces the following error:

  self.temp = self.modList[0]['measured']['temperature']
  KeyError: 'temperature'

I have looked into this, and it seems like the netatmo API no longer returns the measured temperature and the preferred temperature for my MiGo device. The only ‘measured’ value I still got is the estimated preferred temperature, but I have not found a workaround yet for getting the actual inside temperature.

I am not sure if this is a problem with my MiGo device, or if it is a general problem. It could be that netatmo changed its API, which broke support for Bulex and Vaillant. As a side note, the official MiGo API also no longer shows the inside temperature, so the error has nothing to do with the HA integration.

I will wait a few days to see if Bulex/Vaillant fix this issue. I already modified the code a bit, to get rid of the error (just take 0 when there is no temperature available) but off course this makes the component kind of useless as the thermostat needs to know the inside temperature in order to know when to turn the heating on or off.

Will keep you posted…

I can confirm that inner temp shows an empty value in Migo official app. At same time, the old configuration in HA of the thermostat also shows an error on temperature request (0.86). But is interesting that the true inner temp is well registered over the official app graphs. Seems to be a bug from netatmo-vaillant servers.

Great @pjmaenh , thank you so much :slight_smile:

I would be more than happy to test this for you, unfortunately restoring my hass.io resulted in a malformed database disk image, still hoping that I can some repair this file so I’ll not lose my history data (https://community.home-assistant.io/t/db-image-malformed-how-to-fix-it/76413/4)

Quick update:
The issue with inside temperature no longer showing seems to be a general issue, cfr. https://play.google.com/store/apps/details?id=com.vaillantgroup.migo.thermostat&showAllReviews=true and https://play.google.com/store/apps/details?id=com.vaillantgroup.vaillant.thermostat.

Recently, a lot of users have been complaining that they no longer get the indoor temperature in the app, so probably netatmo changed its API, breaking the functionality of the Bulex MiGo and Vaillant vSmart apps.

Let’s hope that Bulex/Vaillant fixes this quickly.

@pjmaenh Thank you for the effort and time. After you latest message i noticed in my Vsmart app that the inside temp is indeed not shown.
Have send Valliant a message about it, probably won’t get an answer, but it the least i can do.

UPDATE.
Checked the Vsmart app today and it is reporting the inside temp again.

@pjmaenh Today MiGo App returned again the inside temp at about 11AM. Using the old version with pyatmo and HA 0.84.3 is now working well again.

Just pushed a new version to GitHub, that should work with the latest version of HA (tested on 0.94.3). It’s a temporary fix, as I will soon be refactoring and updating the pyatmo-vaillant library.

@Derk @Dixietoom @rudgr

2 Likes

Hello @pjmaenh I am trying to get this working on my HA.
Please can you share with me the private key for Vaillant?
Thank you

@filipfajmon I’ve sent you a message

Component is no longer working in Home Assistant 0.96, most likely due to refactoring of climate component (https://www.home-assistant.io/blog/2019/07/17/release-96/).

Currently working on a fix…

4 Likes

Thanks for the effort!

awesome @pjmaenh :slight_smile:

Apologies for the slow reply, here’s a quick update:

It didn’t take long before I got the component working again with 0.96+, but with very limited functionality. As the climate component changed a log with HA 0.96 I decided to go back to the drawing board…

The netatmo API is nowadays very different from the Vaillant API due to the introduction of valves and rooms. Both netatmo and vailland/bulex use the same base URL, but that is the only thing they share. Therefore I decided to investigate the API a bit and developed a custom library specifically for Vaillant and Bulex/SaunierDuval to replace the pyatmo library.

Next, I started rewriting the Home Assistant component, and it now seems to be working again. Thanks to the new library, I could add a lot of functionality:

  • The component now supports 3 HVAC modes: heat (manual heat, for example when setting a new desired temperature), auto (following predefined program) and off (frostguard mode). The component will automatically update the HVAC mode based on the current thermostat state

  • The component now has 4 working presets, which can be activated through Home Assistant: away (similar to button in app), hot water boost (turn on hot water for 1 hour, similar to button app), summer (switch to summer system mode: only hot water, no heating) and winter (switch to winter system mode).

  • The component has 3 working HVAC operations: Auto (switch back to predefined program for current system mode), Boost (Hot Water Boost for 1 hour) and OFF (switch to frost guard system mode).

  • When using the Lovelace climate component, the thermostat will display whether it is heating or idle, and also the current preset.

Some screenshots:
32


I have been testing the component now for a few days, and so far it seems to be working fine. Had some minor issues in the beginning, but I was able to fix them.

Some remaining issues:

  • Sometimes, the component will give a warning in HA when triggering an action (e.g. activating a preset). This warning can be ignored, and I could easily implement a quick workaround, but I’m working on a cleaner solution. The issue is that sometimes the API returns an incomplete response, and it also sometimes takes some time before it returns an updated state of the thermostat.
  • The component currently supports only a single thermostat. Extending the component to support multiple thermostats is possible, but I cannot test this as I only have a single thermostat. If someone needs support for multiple thermostats, send me a message and I’ll make this high priority.

TL;DR: Got the component working again in HA 0.96+, with more functionality.

EDIT updated component now available on GitHub: https://github.com/pjmaenh/home-assistant-vaillant

5 Likes

Hi all!
@pjmaenh, I think should be a good idea to pull the final code as an official platform on Hassio.

Thanks for your job! :wink:

2 Likes

I am a bit confused by this one. Away mode should be independend of the summer/winter mode I would think? Normally there should be an away on and off? (while keeping winter of summer in the background)
(the same for hot water boost. On/or off and auto off after one hour?)

@huuub away mode and hot water boost are indeed independent of the mode (summer/winter) and will not change the current system mode. After these presets are deactivated (manually or after time period), the thermostat returns to the schedule belonging to the current system mode.

How I currently implemented it:

  • away mode stays on until deactivated (I can change this if needed)
  • hot water boost is enabled for 1 hour
  • a manual temperature is set for 2 hours
    (This behaviour mimics the official app).

When switching between summer and winter mode, the thermostat will clear all other presets (away, hot water boost and custom target temp) and returns to the default schedule.

I agree that it seems a bit confusing at first, but the official climate component is a bit limited (there are only HVAC modes and presets available, and I cannot use HVAC modes for switching between summer and winter). The official climate component is not (yet) designed to support only water heating, therefore I had to be a bit creative when implementing the component for Vaillant and Bulex.

However, once you get the hang of it, you’ll notice that you now can do most most normal operations as with the official app.

1 Like

And how do I turn off away mode?