gody01 / ecovent_v2

Home Assistant Integration for EcoVent VENTO Expert A50/80/100 Fans
GNU General Public License v2.0
31 stars 10 forks source link

Not working on 2023.6 #15

Closed evaliukonis closed 1 year ago

evaliukonis commented 1 year ago

Get many errors:

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 970, in _async_registry_updated
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in _async_write_ha_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 596, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 469, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ecovent_v2/sensor.py", line 235, in native_value
    self._attr_native_value = self._method()
                              ^^^^^^^^^^^^^^
  File "/config/custom_components/ecovent_v2/sensor.py", line 266, in battery_voltage
    voltage = int(self._fan.battery_voltage.split()[0])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'split'
Error adding entities for domain sensor with platform ecovent_v2
Error while setting up ecovent_v2 platform for sensor

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 471, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 749, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 850, in add_to_platform_finish
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in _async_write_ha_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 596, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 469, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ecovent_v2/sensor.py", line 235, in native_value
    self._attr_native_value = self._method()
                              ^^^^^^^^^^^^^^
  File "/config/custom_components/ecovent_v2/sensor.py", line 266, in battery_voltage
    voltage = int(self._fan.battery_voltage.split()[0])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'split'
Update for binary_sensor.recuperator_filter_replacement_status fails
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 559, in async_update_ha_state
    await self.async_device_update()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 784, in async_device_update
    await self.async_update()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 469, in async_update
    await self.coordinator.async_request_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 236, in async_request_refresh
    await self._debounced_refresh.async_call()
  File "/usr/src/homeassistant/homeassistant/helpers/debounce.py", line 95, in async_call
    await task
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 262, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 431, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 590, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 654, in _async_write_ha_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 596, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 469, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/ecovent_v2/sensor.py", line 235, in native_value
    self._attr_native_value = self._method()
                              ^^^^^^^^^^^^^^
  File "/config/custom_components/ecovent_v2/sensor.py", line 266, in battery_voltage
    voltage = int(self._fan.battery_voltage.split()[0])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'int' object has no attribute 'split'
gody01 commented 1 year ago

Thanks for report.

Did this worked for You in previous Home Assistant version ? Which Ecovent Fan do You have. Is it v2.0 ?

Because battery_voltage should be in the form "3200 mV" but in Your case it seems that it is just number. This indicate, that it could be v1 fan.

evaliukonis commented 1 year ago

My Ecovent is V2. I bought it only yesterday and tried to add it to HA. It looks like some changes in Python and does not work with the latest version of the HA.

gody01 commented 1 year ago

I just upgraded to 2023.6.2 and it's working here.

Is Fan in "Master" mode ? For integration to work, all fanse has to be in master mode.

evaliukonis commented 1 year ago

Yes, it is the master mode. I try but not possible add a slave to the HA

evaliukonis commented 1 year ago

I found my problem. I set up the device id. I should leave the default value DEFAULT_DEVICEID. Possible decrease update interval? Now it looks like 30 seconds.