michaelarnauts / home-assistant-comfoconnect

Home Assistant integration for Zehnder ComfoAir trough a Zehnder ComfoConnect LAN C.
Other
28 stars 13 forks source link

Some errors, and bypass control. #2

Closed frank8the9tank closed 1 year ago

frank8the9tank commented 1 year ago

First of all, Many thanks for the work!,

I have added the integration trough hacs, So far so good, HA found the zehnder unit automatically after a restart. Added the integration, asked for a pin, and added successfully,

But there are a couple of things i see,:

in the log is: Logger: homeassistant.components.select Source: custom_components/comfoconnect/select.py:182 Integration: Select (documentation, issues) First occurred: 19:21:00 (6 occurrences) Last logged: 19:25:50

Error adding entities for domain select with platform comfoconnect Error while setting up comfoconnect platform for select Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 428, in async_add_entities await asyncio.gather(*tasks) File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 692, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 788, in add_to_platform_finish await self.async_added_to_hass() File "/config/custom_components/comfoconnect/select.py", line 182, in async_added_to_hass await self._ccb.register_sensor(self.entity_description.sensor) File "/usr/local/lib/python3.10/site-packages/aiocomfoconnect/comfoconnect.py", line 88, in register_sensor await self.cmd_rpdo_request(sensor.id, sensor.type) File "/usr/local/lib/python3.10/site-packages/aiocomfoconnect/bridge.py", line 194, in _read_messages message = await self._read() File "/usr/local/lib/python3.10/site-packages/aiocomfoconnect/bridge.py", line 180, in _read raise ComfoConnectNotAllowed(message) aiocomfoconnect.exceptions.ComfoConnectNotAllowed: 00000000001010148001144fd71e2d84 -> 6700b68526915a7836b7a66e8bbd3069: 082710052015 type: CnRpdoConfirmType result: NOT_ALLOWED reference: 21

And i have seen this a single time: for the bypass switching to ON does work, buy then to AUTO or OFF does not work, It says at the bottom of the screen, failed to call select service.

But after a reboot i cannot reproduce this error.

frank8the9tank commented 1 year ago

And a feature request if possible: Add a option for a update interval for the values that update by the second, so fan duty, rpm and load, So when setup is made, the integration asks for a update interval in seconds, it uses this to update the fan duty, rpm and load. No it updates for to ofter and writing a lot of data to the data base. For me a average for 30 is more that enough for the fan duty, rpm and load

michaelarnauts commented 1 year ago

I've seen the issue in select.py also, will look into that.

Didn't notice the bypass switching error, I'll look into that also.

I'm also interested into throtteling the updates of some sensors (rpm, power usage, ...), but Home Assistant doesn't really support this nicely. I've seen suggestions (https://community.home-assistant.io/t/do-sensor-update-every-second-but-only-record-every-10/187173/6) or to use a filter sensor with throttle to limit the updates (https://www.home-assistant.io/integrations/filter/#throttle) and then blacklisting the original sensor in the recorder, but that seems like a lot of work.

EDIT: Thinking a bit about this, I think this should be implemented in the recorder component itself. See https://community.home-assistant.io/t/recorder-frequency-configuration-for-all-sensors/157084

tombartosz commented 1 year ago

I did throttling exactly like you said. Excluded orginal sensor from recorder and added filtered one that was avg from 5 min window.

frank8the9tank commented 1 year ago

What an idea could be is to save a time stamp for the communication, for the "throttle" values. Then when that timestamp is more that X seconds old then update the values to home assistant. So basically just don't update the values to HA from your library out for X amount of seconds.

tombartosz commented 1 year ago

Please check this commit in my fork: https://github.com/tombartosz/home-assistant-comfoconnect/commit/146a7b940f7a9255b632054fc01b31dea11120e9 It filters values (maybe I should not call it rounding there) - for fan speeds it passes data to HA if change is greater than 10%. It greatly reduces number of data HA stores.

michaelarnauts commented 1 year ago

I just pushed a commit that throttles high frequency sensor updates using the homeassistant.util.Throttle class. See https://github.com/michaelarnauts/home-assistant-comfoconnect/commit/50467f3dd877e5c90602dc1fbde233b099a9894e

It's available in HACS as an update, since I haven't gotten around to do proper releases yet, so every commit is an update :)

Note that you'll need to enable those sensors manually anyway on the device page (under Diagnostics).

frank8the9tank commented 1 year ago

I also see sometimes that after using the Zehnder Comfo APP that the integration does not reconnect. The i press reload, and the integration says that i have to restart HA to get the connection back. Other question: How do i upgrade the firmware on my zehnder unit?

michaelarnauts commented 1 year ago

I'm looking into fixing the reconnection issue. It can be followed up in https://github.com/michaelarnauts/home-assistant-comfoconnect/issues/5

I can't help you with the firmware upgrade, you will need to contact Zehnder support for that.

Since I guess that covers this issue, I'll close this one.