piotrbulinski / flexit_bacnet

Client BACnet library for Flexit Nordic series of air handling units.
MIT License
10 stars 3 forks source link

flexit_bacnet.bacnet.DecodingError: unsupported response type: 7 #17

Open lellky opened 7 months ago

lellky commented 7 months ago

Trying to implement sensors in the home assistant integration flexit_bacnet craches after a while (probably when polling sensor values). It seems to work the first time.

Here is the added code in core: https://github.com/lellky/core/commit/3cfb6b9dc6cc70f4babf83ade6b2276e4a5cdc0b

This is the error output:

2024-01-12 08:35:25.561 ERROR (MainThread) [homeassistant.helpers.entity] Update for sensor.hvacfnct21y_a_exhaust_air_fan_control_signal fails
Traceback (most recent call last):
  File "/Users/lellky/Projects/core/venv/lib/python3.11/site-packages/flexit_bacnet/bacnet.py", line 490, in read_multiple
    return _parse_read_property_multiple_response(response)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lellky/Projects/core/venv/lib/python3.11/site-packages/flexit_bacnet/bacnet.py", line 212, in _parse_read_property_multiple_response
    raise DecodingError(f"unsupported response type: {apdu_type}")
flexit_bacnet.bacnet.DecodingError: unsupported response type: 7

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

Traceback (most recent call last):
  File "/Users/lellky/Projects/core/homeassistant/helpers/entity.py", line 943, in async_update_ha_state
    await self.async_device_update()
  File "/Users/lellky/Projects/core/homeassistant/helpers/entity.py", line 1261, in async_device_update
    await self.async_update()
  File "/Users/lellky/Projects/core/homeassistant/components/flexit_bacnet/sensor.py", line 326, in async_update
    await self._device.update()
  File "/Users/lellky/Projects/core/venv/lib/python3.11/site-packages/flexit_bacnet/device.py", line 30, in update
    self._state = await self.bacnet.read_multiple(device_properties)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/lellky/Projects/core/venv/lib/python3.11/site-packages/flexit_bacnet/bacnet.py", line 492, in read_multiple
    raise DecodingError(
flexit_bacnet.bacnet.DecodingError: response decoding failed: unsupported response type: 7
810a00090100710109
piotrbulinski commented 7 months ago

As we discussed, this is an abort message from Flexit unit with reason "out-of-resources". That's due to too many request being sent by the home assistant - but as this is now fixed on your end with the use of HA Coordinator, I'll not rush fixing it. Let's keep the issue open, so I remember to add bacnet's abort response support to the code.