home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.74k stars 30.85k forks source link

Nibe Integration: Bad logger message #84497

Closed fBruckm closed 1 year ago

fBruckm commented 1 year ago

The problem

I'm running a ESPHome UDP gateway connected to my Nibe F1145 heat pump and added the new Nibe Heat Pump integration in my home assistant installation. I was able to add the integration without error and it is shown in the integrations and devices overview.

After enabling the enteties corresponding to the datapoints that are also in my LOG.SET I get data, but a parsing error is shown in the log file, see "Anything in the logs that might be useful for us?".

The ESPhome gateway itself seems to be working fine. You can see the ESPhome configuration under "Additional information".

The Diagnostic log does not show any nibe related information, and therefore I did not attach it.

How can I to solve the error?

Any help would be appreciated.

What version of Home Assistant Core has the issue?

core-2022.12.8

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Nibe Heat Pump

Link to integration documentation on our website

https://www.home-assistant.io/integrations/nibe_heatpump

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: nibe.nibe.connection.nibegw
Source: /usr/local/lib/python3.10/site-packages/nibe/connection/nibegw.py:220
First occurred: 10:24:06 AM (185 occurrences)
Last logged: 10:30:40 AM

    Bad logger message: Unexpected exception during parsing packet data '5c00206850489ce4004c9ce2004e9ca201889c4400d5a1ae00d6a1a300fda718f8c5a5ad98c6a50100cda5d897cea50100cfa51fb7d0a5060098a96d2399a90000a0a9cf05a1a900009ca9a01a9da90000449c4500e6' from ('172.16.14.21', 10000) ((StreamError('Error in path (parsing)\nstream read less than specified amount, expected 4, found 2'),))
    Bad logger message: Unexpected exception during parsing packet data '5c00206850489ce5004c9ce3004e9ca201889c4400d5a1ae00d6a1a300fda718f8c5a5ad98c6a50100cda5d897cea50100cfa51fb7d0a5060098a96d2399a90000a0a9cf05a1a900009ca9a01a9da90000449c4400e7' from ('172.16.14.21', 10000) ((StreamError('Error in path (parsing)\nstream read less than specified amount, expected 4, found 2'),))
    Bad logger message: Unexpected exception during parsing packet data '5c00206850489ce4004c9ce3004e9ca201889c4400d5a1ae00d6a1a300fda718f8c5a5ad98c6a50100cda5d897cea50100cfa51fb7d0a5060098a96d2399a90000a0a9cf05a1a900009ca9a01a9da90000449c4400e6' from ('172.16.14.21', 10000) ((StreamError('Error in path (parsing)\nstream read less than specified amount, expected 4, found 2'),))
    Bad logger message: Unexpected exception during parsing packet data '5c00206850489ce4004c9ce2004e9ca101889c4400d5a1ae00d6a1a300fda718f8c5a5ad98c6a50100cda5d897cea50100cfa51fb7d0a5060098a96d2399a90000a0a9cf05a1a900009ca9a01a9da90000449c4500e5' from ('172.16.14.21', 10000) ((StreamError('Error in path (parsing)\nstream read less than specified amount, expected 4, found 2'),))
    Bad logger message: Unexpected exception during parsing packet data '5c00206850489ce4004c9ce3004e9ca101889c4500d5a1ae00d6a1a300fda718f8c5a5ad98c6a50100cda5d897cea50100cfa51fb7d0a5060098a96d2399a90000a0a9cf05a1a900009ca9a01a9da90000449c4500e5' from ('172.16.14.21', 10000) ((StreamError('Error in path (parsing)\nstream read less than specified amount, expected 4, found 2'),))

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/nibegw.py", line 188, in datagram_received
    self._on_raw_coil_value(row.coil_address, row.value)
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/nibegw.py", line 383, in _on_raw_coil_value
    coil.value = self.coil_encoder.decode(coil, raw_value)
  File "/usr/local/lib/python3.10/site-packages/nibe/connection/encoders.py", line 62, in decode
    value = self._get_parser(coil).parse(raw)
  File "/usr/local/lib/python3.10/site-packages/construct/core.py", line 288, in parse
    return self.parse_stream(io.BytesIO(data), **contextkw)
  File "/usr/local/lib/python3.10/site-packages/construct/core.py", line 300, in parse_stream
    return self._parsereport(stream, context, "(parsing)")
  File "/usr/local/lib/python3.10/site-packages/construct/core.py", line 312, in _parsereport
    obj = self._parse(stream, context, path)
  File "/usr/local/lib/python3.10/site-packages/construct/core.py", line 1019, in _parse
    data = stream_read(stream, self.length, path)
  File "/usr/local/lib/python3.10/site-packages/construct/core.py", line 92, in stream_read
    raise StreamError("stream read less than specified amount, expected %d, found %d" % (length, len(data)), path=path)
construct.core.StreamError: Error in path (parsing)
stream read less than specified amount, expected 4, found 2

Additional information

EspHome configuration of gateway:

esphome: name: nibegw comment: Nibegw platform: esp32 board: esp32-poe-iso

Enable Home Assistant API if not using MQTT

api:

password: "xx"

reboot_timeout: 5min

ota: password: "xx"

wifi: ssid: "xx" password: "xx" fast_connect: on manual_ip: static_ip: 172.16.14.21 gateway: 172.16.1.1 subnet: 255.255.240.0 dns1: 172.16.1.1 power_save_mode: none

output_power: 16.0

Enable fallback hotspot (captive portal) in case wifi connection fails

ap: ssid: "Test Fallback Hotspot" password: "xx"

Enable logging

logger: level: DEBUG baud_rate: 0

tx_buffer_size: 2048 # Only needed when logging large packets

external_components:

uart: id: my_uart rx_pin: GPIO36 tx_pin: GPIO4 baud_rate: 9600

nibegw: dir_pin: number: GPIO3 inverted: false

If you have a named uart instance, you can specify this here.

uart_id: my_uart

udp:

The target address(s) to send data to. May also be multicast addresses.

target:
  - ip: 172.16.13.100
    port: 9999

# List of source address to accept read/write from, may be empty for no filter, but
# this is not recommended.
source:
  - 172.16.13.100
  - 172.16.1.55

# Optional port this device will listen to to receive read requests. Defaults to 9999
read_port: 10000

# Optional port this device will listen to to receive write request. Defaults to 10000
write_port: 10001

acknowledge:

Some helper functions to restart ESPHome from HA

button:

home-assistant[bot] commented 1 year ago

Hey there @elupus, mind taking a look at this issue as it has been labeled with an integration (nibe_heatpump) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `nibe_heatpump` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign nibe_heatpump` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


nibe_heatpump documentation nibe_heatpump source (message by IssueLinks)

elupus commented 1 year ago

Same issue as here: https://github.com/yozik04/nibe-mqtt/issues/15 had been solved upstream. So will be fixed on next version bump of library.

elupus commented 1 year ago

Should ve fixed now. You may get an warning in log still. You cant have 32bit registers in LOG.SET file.