Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nibe Integration: Bad logger message #84497

Closed
fBruckm opened this issue Dec 23, 2022 · 3 comments
Closed

Nibe Integration: Bad logger message #84497

fBruckm opened this issue Dec 23, 2022 · 3 comments

Comments

@fBruckm
Copy link

fBruckm commented Dec 23, 2022

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:
- MODBUS40

# Enable a dummy RMU40 accessory to receive updates
# to certain registers faster. This should not be
# enabled if you have an actual RMU40.
- RMU40_S4

Constant replies to certain requests can be made

constants:
- address: MODBUS40
token: ACCESSORY
data: [
0x0A, # MODBUS version low
0x00, # MODBUS version high
0x02, # MODBUS address?
]

# Accessory version response
- address: RMU40_S4
  token: ACCESSORY
  data: [
        0xEE, # RMU ?
        0x03, # RMU version low
        0x01, # RMU version high
  ]

# Unknown response that nibepi uses
- address: RMU40_S4
  token: RMU_DATA
  command: RMU_WRITE
  data: [
        0x63,
        0x00,
  ]

# Constant fixed temperature to avoid pump going into alarm.
- address: RMU40_S4
  token: RMU_WRITE
  data: [
        0x06, # Temperature
        0x14, # degrees low
        0x00, # degrees hight
  ]

Some helper functions to restart ESPHome from HA

button:

  • platform: restart
    name: Nibegw Restart
  • platform: safe_mode
    name: Nibegw Safe Mode Boot
@home-assistant
Copy link

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 elupus mentioned this issue Dec 23, 2022
19 tasks
@elupus
Copy link
Contributor

elupus commented Dec 24, 2022

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

@elupus
Copy link
Contributor

elupus commented Dec 24, 2022

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

@elupus elupus closed this as completed Dec 24, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants