Guide: Vallox Digit Ventilation to Home Assistant (Part 2/2 – Home Assistant)

In previous post I wrote a guide, how to create hardware to control Vallox Ventilation Machines (the dumb ones) through wifi. In this second part, we are going to integrate the newly created hardware into Home Assistant.

NOTE: Home Assistant 2021.12 caused a breaking change that caused commands not being sent to Ventilation Machine from HA. This has now been fixed and new custom component can be installed from GitHub repository (v0.8.2).

Requirements

Since our hardware sends all the events to the MQTT pipe, of course we should have MQTT installed into our system. Check this post out if this is a new thing for you. You should already have MQTT installed though, since you were able to complete the 1/2 part of this guide 🙂

Another thing we need is a SSH in home assistant. We need to be able to install custom components to the system (there might be other ways as well, but this guide uses SSH connection). SSH add-on can be installed from supervisor -> “Add-on store”.

Custom component installation (UPDATED 3/2021)

Next thing is the actual component installation.

SSH into the home assistant system (either with web ui or native ssh) and enter following commands:

cd /config/custom_components 
wget -O - https://raw.githubusercontent.com/kotope/valloxesp/master/install_to_home_assistant.sh | bash

First row changes our directory to custom_components folder inside home assistant. Custom components are third party components that are not integrated into home assistant by default.

Second row downloads the software from GitHub repository and runs installation right through into the custom_components folder. No need to do any other commands anymore.

Now restart the home assistant and our new component should be loaded in the system.

(Coming later: HACS installation)

Configuration (UPDATED 3/2021)

Latest version of integration is done via Home Assistant integrations page direclty from UI and differs a lot from older version. If you have the old version still installed, remove the configuration related to vallox2mqtt from configurations.yaml. Also you can now safely remove templated sensors since they are provided through configuration procedure automatically now.

Our platform currenty offers three components: thermostat (climate) control, binary sensor and swuich. Climate control has heating, fan support and target temperature setters.

Binary sensor is just a status on/off, but has rest of the values as attributes that can be used as template sensors if needed.

Switch is either boost or fireplace switch as selected from Vallox Ventilation machine. Note that once either boost or fireplace mode is activated, it cannot be turned off until the timer expires in vallox (boost 60min, fireplace 15min). This is restriction in the interface and “can’t” be implemented. Also please note that at the moment you cannot switch fireplace/boost mode from HA, only in the device itself (something I still need to implement).

Latest version (0.8.1+) also provides other sensors straight through device now.

So let’s setup the platform.

Go Home Assistant configurations tab -> integrations and press ‘+ Add Integration’ in down right.

Search for vallox2mqtt and click it.

Configuration dialog should pop up and you can leave the values default unless you have changed your valloxesp mqtt topics to something else. You can also change the friendly name as you like (e.g. in your localized language).

After pressing the ‘submit’ button you are asked the area of the device. When finishing the setup you should see 1 device with 15 entities in the integrations view. You can now start adding those in your Lovelace UI.

RH1 and RH2 are only available if your Vallox ventilation machine has those. Otherwise those statuses will be unavailable.

Testing

Enter some of your views and try to add thermostat entity into it. You should find your “Ventilation” item.

Just experiment a bit and do anything you would like to see with those 🙂

In images below is an example how I’ve configured of those Lovelace cards (sensors, history graph of all four temperature sensors and ventilation control)

Again, if problems, feel free to drop a comment below and I’ll try to help as much as I can.

72 Replies to “Guide: Vallox Digit Ventilation to Home Assistant (Part 2/2 – Home Assistant)”

  1. Thank you so much for fun and great step-by-step guide for this home automation project! Yesterday I successfully got it working with Vallox Digit SE without any problems. You could add it to Github -page for other users if they are unsure if this is working or not.

    I did only one change to setup, and installed the system besides the ventilation machine. This way I was able to leave the boxing for a later date, and my wife is happier when she doesn’t see my tunings on the walls.

    I’d love to have option for fireplace switch, which turns exhaust fan off for 15minutes. I think there is “build-in switch” in protocol for that, I can see that the control panel (Digit SED) has option for it in menu.

    Big thanks again for your kind sharing this guide!

    1. Thanks for your nice comments 🙂
      I added your Vallox Digit SE as verified device aswell.

      By the way, updated software with some read only variables added to github.
      Mostly implemented because of motor_in to see when heat cell is being unfrozen.

      1. Already did OTA -update, so convenient! Also added configurations initially for motor_in, motor_out and extra_func. Working great!

        Didn’t quite understand what’s the relationship between motor_in and heat cell being frozen?

        1. At least my machine stops the incoming motor when defrosting starts. That way no more cold air is being pushed from outside and heat cell uses indoor warm air to defrost the cell.

          Some models uses front heating also on defrosting.

          I just wanted to analyse how often and how long periods there are for defrosting 🙂 Not tested fully yet though, since it’s still warm outside.

          Next task is the 15min fireplace/boost startup, hopefully I’ll have some time to implement it in this week.

    1. Great success 🙂

      Actually humidity should work already, try to add new template sensor with attribute “rh”. Never tested though, since I don’t have humidity sensor my self.
      Also fireplace switch is in progress, should be ready this week hopefully.

      1. Hi!

        First of all, thanks for the great project.

        Tested the rh attribute, it’s giving me -999% with two humidity sensors on my Vallox Digit SE. The humidity control and display work correctly on the LCD controller.

        I tried adding:

        vallox_rh:
        value_template: “{{ states.binary_sensor.ventilation_status.attributes.rh }}”
        friendly_name: Ventilation humidity sensor
        unit_of_measurement: “% rh”

        to my config.

        1. Hi and thanks for the feedback!

          RH feature might not be working, since I don’t have RH sensor(s) at all so it’s untested code completely. It’s implemented according specifications, but there might be some special cases, since you have two RH sensors connected.
          I can try to fix it, if you are able send me some packet logs from your machine?

          To get the logs you need to send ‘{ “DEBUG” : true }’ message to ‘vallox/set’ topic and then subscribe to ‘vallox/#’ topics with some client.
          If you are able to do that and get the logs (about 20-30 lines should be enough), please send and I’ll check if I can make RH feature working properly 🙂

  2. Could you have any suggestions what might be wrong: my MQTT packets have “freezed”, so I only get exactly same values every time I subscribe for a topic. I have flashed the software couple of times, no luck with that. I doubt the problem is with rs485-ttl -module, but it seems to be the only option. ESP01 might be bricked too, but it lets me flash it with ftdi-programmer, but not with OTA. I checked voltages and setups, and Vallox Control Panel is working as it should. I can’t say when this problem occured, but I’ve hazzled a lot with Home Assistant lately.

    I ordered ESP01 for other reasons couple weeks ago, so it should arrive soon, making troubleshooting easier.

    1. Mqtt messages on that code are retain, so old messages are received if no newer ones are not available. I should change that someday not to be retain..

      My guess would be somehow messed rs485 converter that it cant read all required messages and won’t get the initialization done. However, OTA flash should still work …

      Try to send “{ ‘DEBUG’: true }” message to vallox/set topic. It then should send all raw data through mqtt aswell. If no messages are received, something must be wrong on modus (RS485).

    2. And one more thing. If you have flashed esp8266 again, ensure wifi/mqtt values at valloxesp.h. File might be overridden when updated from github. Happened me once and I wondered why OTA won’t work anymore (was not even on wifi because of wrong credentials)

  3. Hi,

    It took some time to receive missing components and find the time to tinker this to be finished, but now the HW side is ready and works great with my Digit SE. The MQTT communications works bidirectionally, and everything seems to be OK.

    However, I’m experiencing problems with the HA configuration. The thermostat card works great with “climate.ilmanvaihto” as set entity. I can see the set and actual temperature and e.g. change the fan speed. However, the sensors defined under platform: template are not working.

    Sensors, defined in configuration.yaml are listed under “Entities” of HA Configuration view, but each sensor has a red exclamation mark with comment “Unavailable” . The sensors are of course not showing any data either.

    Installation (Custom component cloning from git + two sections of configuration.yaml-file) are done as explained above.

    As I’m bit unfamiliar with the template concept of HA, I would appreciate if you could point me a starting point for debugging.

    Many thanks in advance!

    1. Hi!

      Those templated sensors are fetched from Vallox binary_sensor attributes (I did not want to make too many (possibly not needed) entities in the integration so I decided to add them as attributes).

      I see you’re using ‘ilmanvaihto’ as a name so the binary sensor should be found in your system as “binary_sensor.ilmanvaihto”.
      Most probably your templated sensor name is just wrong, so double check that your templated sensor configuration is something like this:
      ventilation_outside_temp:
      value_template: “{{ states.binary_sensor.ilmanvaihto.attributes.temp_outside }}”
      friendly_name: Ventilation outside temperature

      If still not working, check that you see the ‘binary_sensor.ilmanvaihto’ in your Home Assistant and check the attributes from that entity.

      1. What a moment of embarrassment =:-o.

        I had configured the Vallox2mqtt custom component to configuration.yaml already last year, and didn’t recall/realize I had changed the name back then.

        I changed the name of the component to the same which is used in the example above, and now everything works like a charm!

        Thanks for your quick support and great work!

        1. Glad to hear it was just a naming issue. 🙂

          Have a nice day and feel free to drop a message in any situation and I’ll help as much as I can.

  4. Thanks to the great integration, it works with Vallox digit SE 2. Is it possible to set the fan speed (1-8) with the Home Assistant? for example, create automation that sets the fan speed to the fastest setting as the humidity in the washroom increases?

    1. Hi,

      Yes, of course it is possible to automatically set fan speed based on humidity (as long as you have humidity sensor in the washroom).

      You could either use the Vallox boost/fireplace switch as an action, if you have configured your vallox switch as a boost rather than fireplace switch.
      ..or you could manually automate speed change and a timer for it in Home Assistant. All the required components should be in place already (in HA and in Vallox ESP8266 module).

      Unfortunately I don’t have an example of that yet. I’ve been planning to create a similar automation for myself as well, but haven’t had time to do it yet.
      I’ll write a new post about it when I got time to do it 🙂

      1. ..one more thing, the event action for the automation is “climate.set_fan_mode” that can be used for entity “climate.ventilation”, if you wish to try it out already.

        1. Thanks. It worked.
          For automations:
          Action type: Call service
          Service: climate.set_fan_mode
          Name of entitie to change: climate.ventilation
          Service data:

          entity_id: climate.ventilation
          fan_mode: 4

  5. Hi, Thanks for all the work you have put into the project and also keeping it up to date. Today I updated to latest version that you can setup trough the Home Assistant integrations and it is working well. One small thing I would like to point out though. I noticed that fan speed display attribute from climate component is not present in the default list of entities and I had to enable it old fashioned way from configuration.yaml template sensor. Maybe it is worth displaying as default because it is quite essential information.

  6. Hi, i had vallox working via old tutorial (costum component), but today i updated HASS and vallox failed to load.
    If i follow new guideline for installing: Go Home Assistant configurations tab -> integrations and press ‘+ Add Integration’ in down right.

    Search for vallox2mqtt and click it.

    It doesn’t find it. What i’m doing wrong?

    1. Hi,

      Sorry for the late reply, I’ve somehow missed this comment totally.
      Have you updated the latest version of vallox2mqtt component from GitHub https://github.com/kotope/valloxesp in your custom_components folder?

      Double check that everything is there. I’d recommend to delete old folder and re-download it to be sure that you don’t get any conflicts with the old one 🙂

      You could also delete the old version from custom_components folder and go through installation again according this guide:
      https://www.creatingsmarthome.com/index.php/2020/08/31/guide-vallox-digit-ventilation-to-home-assistant-part-2-2-home-assistant/

  7. Went over it again and got it to work 🙂
    Must have one smth wrong first time (not very experienced with HASS).

  8. Hi Toni, Been using this integration now several months, and all fine!

    Now, when colder days are here, i noticed that entity “Ventilation front heating” stays off, even front heater is ON on a Vallox. Have you experienced this one by your self?

    Thanks!

    1. Hi,

      I don’t have the front heating on my machine, but will ask from a friend of mine that has front heating and is also using this DIY module.
      It worked ok last year, but the code has changed a bit since then.

      I will get back to you when I get the result from him 🙂

    2. Just to be sure:
      Front heating is for keeping the cell non-frozen, not to heat the incoming air so if your cell is not frozen (or the setting in Vallox is set to bypass the cell) then the front heating should stay off.
      The heating itself is done in “back heating” (jälkilämmitys) and as far as I remember Vallox does not pass that status in modbus.

      And now the question, are you sure you are not mixing up front and back heating (etulämmitys / jälkilämmitys) ? 🙂

      1. Hi Toni,

        Ok that must be the case then of course! I am talking about the back heating/jälkilämmitys, which heats the incoming air to certain temperature. So all clear now, thank you for fast support!

        1. Good to hear 🙂
          I will re-check if actual state of heating could be somehow retrieved at some point.
          Would be a good feature to see when the heating is actually heating or idle.

  9. Hi Toni,

    once again thanks for this great project and tutorial.

    As Home Assistant now supports long term statistics, would be a big effort to make an update where the sensor metadata would include the required sensor_state – parameters in order to have the sensor mean/min/max -values to be stored in the long term database tables?

    1. Good morning!

      Thanks for the kind words 🙂

      That feature should not be too difficult to implement, I’ll try to add support for it this week once I’ll find some free time to do it.

  10. Hi,

    First big thanks for this project!
    I now got this working on my Vallox ValloPlus 350 SE 🙂

    One feature I wanted to request would be the ability to turn off the ventilation completely. I tried that a while ago with openhab and a RS485 USB stick and it seemed to work fine to turn off and turn on again. It just would be a nice addition to have the on/off switch controllable as well. (e.g. have it turned off during the night)

    1. Hi and thanks 🙂

      The feature you are requesting should not be too difficult to implement. However, when I first wrote the code I intentionally left out the turn on/off feature, since it’s generally a (really) bad idea to turn off ventilation completely. It’s not good for your health or for the health of house structural.

      However, maybe I could add it as an optional to be configured through configuration flow if someone really needs it. I’ll try to do it next week while having a small holiday break 🙂

      Have a merry Christmas!

      1. That would be perfect!

        And yes, the idea would be to use it in combination with CO2 and humidity sensors around the house. Turning off during the night while it is very cold outside saves energy and more importantly avoids that the air is getting too dry while sleeping.

        Thanks!

        1. Hi,

          On/off feature has been a bit problematic, because of different Home Assistant approach compared to Vallox control panel itself (separate button for the heating on vallox and Home Assistant as off/heat/fan modes).
          It’s almost ready, but I still need to do some tweaking. Will try to finalize it tomorrow, sorry for the delay 🙂

          1. Hi, any update on this? Maybe some “beta” branch I could help testing?

            (Worst case, maybe just map the on/off button to a switch in HA and I could take care of the logic needed myself there 🙂 )

          2. Hi!

            Unfortunately not much of an updates of this issue, I’ve been quite busy on and off work so had no progress of it.
            As I said earlier the problem is indeed state state change.

            Even though I managed to get the start working (with some hickups), one major problem is that the default vallox panel won’t wake up if ventilation is started from the esp8266.
            I’ll created a separate branch for you from the current ‘work-in-progress’ version if you like to, but as I said it’s not pretty and has some major issues that needs solving assuming that they can be solved 🙂

            https://github.com/kotope/valloxesp/tree/experimental_turn_off (requires both esp and custom component updates)

            I will continue with this branch when I find a proper timeslot to actually debug and investigate it more 🙂

  11. I’m having trouble with Vallox 121 SE. I get “väylävika” on the controlbox and just some of the entities are active in HA. I checked the wiring and flashed ESP-01 again but still the same. Any ideas?

    1. ‘Väylävika’ means that the bus is not functioning properly so it’s most likely a hardware issue.

      I’ve seen this on my ventilation machine aswell while I was constructing/developing the hardware.
      If I recall correctly, I had A and B in short circuit and that caused the issue.

      I’d suggest that you ensure A and B are not short with a multimeter. The device should be disconnected from ventilation machine and out of power.
      If that is ok, ensure that A and B are in correct pins.

      One more thing you could try, is to add a terminator resistor at the end of bus. Meaning that you could add 120 ohm resistor between A and B at the end of the bus line => between RS485 module A and B pins. (see picture below).
      Usually this terminator are not if using short cables, but when going to longer it could be useful.

      RS485 terminator

      1. My RS485 was bad, luckily i had another 🙂 Now it seems to work. Thanks for the help.

      2. Excellent tip regarding the terminator.
        Earlier I had regular issues (after a few days) with the ventilation not reacting anymore even though the cables are relatively short.
        However now with the terminator it is just rock-solid, no issues at all.

  12. Thanks for the software!

    Seems to work but why does this “Failed to call service. coroutine was expected got none” error appear every time I change some settings? I have quite old Home Assistant version.

    One of most interesting things here is to calculate the heat recovery efficiency. I know the math but how should I do this ( some kind of separate script?) I suggest adding that as feature. Would be cool to monitor that over time.

    1. Current version of my Vallox custom component is tested only with latest 2021.12 Home Assistant release, so I suggest to upgrade your system 🙂
      Most probably some core features of HA has been changed between your HA version and latest HA.

      Heat recovery efficiency is a good idea, but I think it should be done outside of the device component: e.g. a new template sensor and data collection through influx db.
      If you decide to create a template sensor for that, please comment here so that others could use it as well 🙂

  13. First of all, thank you very much for your effort.

    I’ve added your custom component to my Home Assistant 2021.12.9 but I do not get any entities from it. Also, I cannot get the configuration popup when I click on vallox2mqtt in HACS. When I listen to the MQTT messages, I see them appear, and I can even control my unit with the set. What can I do to get the UI components working? No errors are found in the log.

    I also “converted” the code to compile for ESP32. I only needed to replace a few libraries to get it working. I also switched over to Serial2 because I wanted to use Serial for debugging. As I’m using an ESP32 development board with a lot more I/O than your ESP-01 module, I was thinking of adding an BME280 sensor. Could I get this to report in your MQTT messages and show up in the Home Assistant UI as well? This would be great!

    1. Have you done it like this:

      – HACS -> add custom repository -> https://github.com/kotope/valloxesp.git
      – Install vallox2mqtt
      – go to configuration -> devices -> integrations -> + add integration
      – search for vallox2mqtt and click ok
      –> configuration flow should start at this point

      You should get the BME280 sensor to work, but for that you need to write some Arduino code in the ESP32 end and some kind of mqtt client to HA end (you could use mqtt template of sensors to directly read from mqtt gateway so you don’t have to modify vallox2mqtt custom component )

  14. Hi, Thank you very much for the project! I have a question about seting up my Vallox 96MV.
    I cant to get it work properely in my HA. I see the entity and status, but cant see fireplace servise. Please give me some advise how to set up my one or some link to tutorial. Thank You

    1. The ‘fireplace switch’ is actually called ‘ventilation switch’.
      The switch is configurable either as boost mode or fireplace mode from Vallox control panel itself.

      e.g. you have to select the functionality from default Vallox control panel and the ‘ventilation switch’ will then function in that mode.

      At least that’s how my Vallox 121SE works. In 96MV it might be different, since it is quite much newer production and supports cloud functionality by default.
      Did you manage to get the integration to work with your 96MV excluding the fireplace switch?

  15. Thank you very much Toni! This is so awesome! Thank you for taking the time to write so easy to follow step by step guide!

    Works with Vallox 150SE.

    Initially I got something like this in the home-assistant.log:

    error occurred loading configuration flow for integration … cannot import name async_prepare_subscribe_topics

    Turned out I had to upgrade HA to latest. Then worked like a charm.

  16. … works perfectly with 90 SE

    Thank you, I was looking for years to find an easy possibility of integration to home assistant.

    Chris

  17. Breaking changes in Home Assistant Core 2022.6.2?

    I’m getting :
    Logger: homeassistant.setup
    Source: setup.py:162
    First occurred: 14:19:32 (1 occurrences)
    Last logged: 14:19:32

    Setup failed for custom integration vallox2mqtt: Unable to import component: cannot import name ‘CONF_RETAIN’ from ‘homeassistant.components.mqtt’ (/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py)

    1. Yes, 2022.6.1 did break the integration.
      I got a pull request on GitHub that should fix this. Reviewed it and approved, so updating the custom component should fix it.

      I will make a new release next week when getting back from a holiday. Meanwhile you can try with the master code branch from GitHub.

        1. v0.8.4 is now released that should fix this breaking change.
          Updating can be made through HACS.

  18. Does anyone else have problem with temperatures freezing in the same value? After using something commands to vallox, it freezes the temperature values. Everything else works still.

  19. Hi,

    I updated my HA today to 2022.8.3 (from 2021.12). Vallox integration ceased working after the update.

    I get “Setup failed for custom integration vallox2mqtt: Unable to import component: cannot import name ‘CONF_RETAIN’ from ‘homeassistant.components.mqtt’ (/usr/src/homeassistant/homeassistant/components/mqtt/__init__.py)”

    in the logs.

    Any hints?

    1. You should update latest valloxesp custom_component from GitHub.

      There was a breaking change in HA few months ago.

      1. Thanks for your quick reply. Updating the installation from GitHub fixed the issue!
        –SPy

      2. How does one do that? By running the script?

        install_to_home_assistant.sh from github?

        1. I’d recommend using HACS and adding valloxesp repository on it. That way you get automatic updates for custom component every time it’s updated.

          Another way is to SSH into Home Assistant instance and install through the install_to_home_assistant.sh script like this:
          cd /config/custom_components
          wget -O - https://raw.githubusercontent.com/kotope/valloxesp/master/install_to_home_assistant.sh | bash

    1. Hi!

      Hardware should be compatible, since the pro control unit is modbus as well.

      However, I doubt the the code will not work out of the box, since all the features with ProControl are 90% different compared to Vallox Digit.

      If you’re familiar with coding (or can find someone that is), the code ‘should’ be possible to be modified for your needs 🙂

      1. Thank you! I see a fork in the road 🙂 I will think about it. The code looked fairly easy to adopt.

  20. Hey! I have Vallox Digit SE ventilation unit and running this with the same components.
    My states doesn’t get updated on Home Assistant other than temperatures.
    If I change the fan speed from HA, it does change the fan speed on the Vallox and also shows new speed on the Vallox control panel itself. But if I change the fan speed from the Vallox control panel, the new speed does not get updated to HA at all. Also “Switch Type” is unavailable all times. Boost switch does activate boost function on Vallox, but on Home Assistant the switch stays off. Temperatures does get updated, and only Switch Type is Unavailable. Any ideas?

    1. Hi!

      Which version of Home Assistant are you using?

      You could also connect to MQTT broker manually (e.g. using MQTT explorer) and see if the messages are coming through properly from vallox module to the MQTT broker.

      Also verify your valloxesp.h configurations that they are valid.
      However, it’s quite odd that the temperature works, but nothing else..

      1. Home Assistant was 2022.9.7, but today updated to 2022.10.0.
        I connected to MQTT broker and no messages come when I change anything on the vallox module (fan speed, heat target). Only get messages if I change values from HA.
        But temperatures does change automatically…
        valloxesp.h seems fine, I have only changed the wifi and mqtt server settings.
        Also noticed when I reboot the ESP, it shows heat_target and service_counter as 0. I have to manually set the heat target from HA. And the service_counter populates only when I manually change the fan speed from the HA… So it seems I only get that info as a return message, but otherwise the vallox module wont talk to the ESP, other than the temperatures… 🙂

        1. Ok, so you get proper temperature values to HA from Vallox directly? Do you get values from all 4 sensors correctly?

          Next thing you could do to try and enable debug on the esp module:
          Try to send "{ 'DEBUG': true }" message to vallox/set topic.

          After that you should get quite many MQTT messages from the device. Please copypaste ‘some’ (about 20-30) messages and send those to me (creatingsmarthome (at) gmail.com) and I’ll try to analyze what might go wrong.

          I’m guessing somewhat unsupported weird vallox protocol (different machine with same model name?) or bad cables between vallox and the module so that data is corrupted and checksum does fail.. might be changed panel or mainboard address as well?

          Anyhow, the debug logs will give us the needed information 🙂

          1. Im having similar issue. Noticed it with rh1 value. It updates randomly, maybe once a day. Sometimes few times. Did you find any solution?

          2. The problem with Roope was eventually faulty RS485 module.
            Replacing it with a new one fixed the issue.

Leave a Reply

Your email address will not be published.