Vallox ValloPlus 350MV partial success -> Work in progress on vallox component

Hello Andre!

Good news! :slight_smile: I installed the latest version by copying the files and now have some problems to change the mode. The drop down menu to select mode (home, away, boost…) isn’t working anymore. Everything else seems to work normally (for example remaining time is now shown in weeks).

Maybe you’re able to fix this issue?

BR,
Bernd

Ah, the updated documentation PR was not merged yet.

I was not allowed to keep the drop-down menu, you have to make your own now.
Please check the following link for the updated docs that have an example:

Hello!

After updating to version 0.95 i am getting error-messages for the vallox-component. After a period of time the vallox compoment loses the connection. That lasts for several minutes, then it works again. I didn’t have these problems in version 0.94.

Here is an extract from my error-log:

BR
Bernd

After running a while, it seems to work now. :slight_smile:

Fyi, the new 0.96 release features the vallox integration now.

Hi,
I updated to 0.96.0 (and now to 0.96.2), but vallox did not work with either versions.

Home Assistant is running in container homeassistant/raspberrypi3-homeassistant

config:

vallox:
  host: 192.168.80.46

Error during setup of component vallox
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/websockets/client.py", line 77, in read_http_response
    status_code, headers = yield from read_response(self.reader)
  File "/usr/local/lib/python3.7/site-packages/websockets/http.py", line 123, in read_response
    status_line = yield from read_line(stream)
  File "/usr/local/lib/python3.7/site-packages/websockets/http.py", line 197, in read_line
    raise ValueError("Line without CRLF")
ValueError: Line without CRLF

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 153, in _async_setup_component
    hass, processed_config)
  File "/usr/src/homeassistant/homeassistant/components/vallox/__init__.py", line 114, in async_setup
    await state_proxy.async_update(None)
  File "/usr/src/homeassistant/homeassistant/components/vallox/__init__.py", line 163, in async_update
    self._metric_cache = await self._client.fetch_metrics()
  File "/usr/local/lib/python3.7/site-packages/vallox_websocket_api/client.py", line 235, in fetch_metrics
    result = await self._websocket_request(command=vlxDevConstants.WS_WEB_UI_COMMAND_READ_TABLES)
  File "/usr/local/lib/python3.7/site-packages/vallox_websocket_api/client.py", line 223, in _websocket_request
    async with websockets.connect("ws://%s/" % self.ip_address) as ws:
  File "/usr/local/lib/python3.7/site-packages/websockets/py35/client.py", line 2, in __aenter__
    return await self
  File "/usr/local/lib/python3.7/site-packages/websockets/py35/client.py", line 19, in __await_impl__
    extra_headers=protocol.extra_headers,
  File "/usr/local/lib/python3.7/site-packages/websockets/client.py", line 260, in handshake
    status_code, response_headers = yield from self.read_http_response()
  File "/usr/local/lib/python3.7/site-packages/websockets/client.py", line 79, in read_http_response
    raise InvalidMessage("Malformed HTTP message") from exc
websockets.exceptions.InvalidMessage: Malformed HTTP message

Hmm, that’s unfortunate. It never happened during development, but I get it with 0.96 now as well. Maybe an underlying dependency lib broke.

I opened an issue to track it: https://github.com/home-assistant/home-assistant/issues/25335

By the way, in my home sometimes it succeeds. Can you try to reboot a couple of times and see if it works sometimes?

Hi, i restarted the container around 50 times and the machine around 10 times, but did not get the vallox integration to work.

Oh wow, that’s strange. You are running on a RaspberryPi3, right?

For me, 50% of the time it works on RPi3, but I cannot reproduce the error on x86 at all… :sweat:

@Tippfeler, if possible, could you check out https://github.com/home-assistant/home-assistant/issues/25335#issuecomment-513457212 and see if you can provide the tcdump Jevgeni asked for?

Hi, I did not encounter errors in 0.95.4, now updated to 0.96.2 and at least initially the unit is found. I will continue to observe.

However I am on x86 and it seems I am still using vallox-websocket-api 1.5.2, at least this is what

pip freeze | grep webs

tells me, when inside my docker-container…

@Tippfeler would it be possible to test the following patch:

diff --git a/homeassistant/components/vallox/__init__.py b/homeassistant/components/vallox/__init__.py
index ebb1d56cf..054984187 100644
--- a/homeassistant/components/vallox/__init__.py
+++ b/homeassistant/components/vallox/__init__.py
@@ -8,6 +8,8 @@ from vallox_websocket_api import PROFILE as VALLOX_PROFILE, Vallox
 from vallox_websocket_api.constants import vlxDevConstants
 import voluptuous as vol
 
+from websockets.exceptions import InvalidMessage
+
 from homeassistant.const import CONF_HOST, CONF_NAME
 import homeassistant.helpers.config_validation as cv
 from homeassistant.helpers.discovery import async_load_platform
@@ -164,7 +166,7 @@ class ValloxStateProxy:
             self._profile = await self._client.get_profile()
             self._valid = True
 
-        except OSError as err:
+        except (OSError, InvalidMessage) as err:
             _LOGGER.error("Error during state cache update: %s", err)
             self._valid = False

If yes, please tell me if the InvalidMessage exception is only caught once per startup, or if its also appears during runtime.

Sure, I’d love to help, however I’m not as far in programming.

When I enter the docker container, do I need to edit the file in directory

/usr/local/lib/python3.7/site-packages/vallox_websocket_api/__init__.py

correct?

This file currently shows as

from .client import Client
from .vallox import Vallox, PROFILE

__all__ = ["Client", "Vallox", "PROFILE"]
~

Not much programming needed, you’re almost there! You need the __init.py__ in the vallox component, not the websocket API.

Path should be contain something the likes of: homeassistant/components/vallox/__init__.py

Got it, it’s in

/usr/src/homeassistant/homeassistant/components/vallox

After applying, new errors showed up:

Error during state cache update: Malformed HTTP message

and

Error updating sensor: Device state out of sync.
20:14 components/vallox/sensor.py (ERROR) - message first occured at 20:14 and shows up 8 times

But good news:
It’s working! I can change profiles, and sensor data show up!

Okay cool, thats expected. First error is catched and ignored. Thanks for trying!

Fix is upstream. Hope that resolves it for all.

https://github.com/home-assistant/home-assistant/commit/738d00fb05515265865a7e0b984c9ecaf7b2f82c

Hi,
I own a VALLOX 350 MV and I generally started to build up my little “Smart Home” with Home Assistant. I used the vallox Integration and I am thankfully able to see all Setting, Change Profile and set the profile fan Speed. I tried to understand your Code and how it interacts with the API, but having only some fundamentals in programming and not really started to get into phyton yet, I was not able to add a interaction to set the target air temperature for a profile.

So I would really appriciate, if somebody could add the entities for Setting AIR TARGET TEMP and also the Duration for the BOOST profile. Or give me some “general” hints or Maybe support to add more Input/sensor data.

Thanks.

Ok, meanwhile I managed it myself. After getting into the file again I got it. I am now able to Change the target temperatures for each profile and get some more sensor Information out of it.

this is what my UI Looks like at the Moment:

Hi Thorsten,

cool, was also on my todo-list to try to figure it out. Would you mind sharing an example code change?

Apologies for my curiosity: You are really running the vent of the 350MV with 60%? I do this only on Boost-Mode (Party). Otherwise if it is > 35% and silent in a room I hear it (and I cannot stand it), despite having installed already 3 mufflers in the supplying air.