Egyras / HeishaMon

Panasonic Aquarea air-water H, J, K and L series protocol decrypt
217 stars 113 forks source link

Lots of bad header reads, heatpump goes offline #498

Open klausj1 opened 2 days ago

klausj1 commented 2 days ago

I have connected my Heishamon (bought from IgorYbema, Version: 3.5) instead of the Panasonic module directly to the heatpump. Heishamon is connected to the Home Assistant via MQTT.

The heatpump is a brand new L-Series installed end of april.

Since some time, I get lots of bad reads:

image

Here is am example protocol of the Heishamon console log:

Sun Jun 30 10:03:01 2024 (2046398907): Heishamon stats: Uptime: 23 days 16 hours 26 minutes 38 seconds ## Free memory: 63% ## Heap fragmentation: 14% ## Max free block: 21152 bytes ## Free heap: 24536 bytes ## Wifi: 100% (RSSI: -45) ## Mqtt reconnects: 11946 ## Correct data: 97.06% Rules active: 0
Sun Jun 30 10:03:01 2024 (2046398926): Requesting new panasonic data
Sun Jun 30 10:03:01 2024 (2046398929): sent bytes: 111 including checksum value: 18 
Sun Jun 30 10:03:01 2024 (2046398936): Requesting new panasonic extra data
Sun Jun 30 10:03:01 2024 (2046398943): Already sending data. Buffering this send request
Sun Jun 30 10:03:05 2024 (2046402974): Previous read data attempt failed due to timeout!
Sun Jun 30 10:03:05 2024 (2046402976): Received 0 bytes data
Sun Jun 30 10:03:05 2024 (2046402978): Sending command from buffer
Sun Jun 30 10:03:05 2024 (2046402984): sent bytes: 111 including checksum value: 1 
Sun Jun 30 10:03:05 2024 (2046402999): Received 203 bytes data
Sun Jun 30 10:03:05 2024 (2046403001): Checksum and header received ok!
Sun Jun 30 10:03:05 2024 (2046403007): received TOP67 Compressor_Current: 1.0
Sun Jun 30 10:03:05 2024 (2046403014): received TOP115 Water_Pressure: 2.56
Sun Jun 30 10:03:06 2024 (2046403908): Heishamon stats: Uptime: 23 days 16 hours 26 minutes 43 seconds ## Free memory: 64% ## Heap fragmentation: 15% ## Max free block: 21152 bytes ## Free heap: 24672 bytes ## Wifi: 100% (RSSI: -45) ## Mqtt reconnects: 11946 ## Correct data: 97.06% Rules active: 0
Sun Jun 30 10:03:06 2024 (2046403928): Requesting new panasonic data
Sun Jun 30 10:03:06 2024 (2046403930): sent bytes: 111 including checksum value: 18 
Sun Jun 30 10:03:06 2024 (2046403937): Requesting new panasonic extra data
Sun Jun 30 10:03:06 2024 (2046403945): Already sending data. Buffering this send request
Sun Jun 30 10:03:07 2024 (2046404523): Received bad header. Ignoring this data!
[deleted 54 identical rows]
Sun Jun 30 10:03:07 2024 (2046404955): Received bad header. Ignoring this data!
Sun Jun 30 10:03:07 2024 (2046404984): Received more data than header suggests! Ignoring this as this is bad data.
Sun Jun 30 10:03:08 2024 (2046405939): Previous read data attempt failed due to timeout!
Sun Jun 30 10:03:08 2024 (2046405941): Received 0 bytes data
Sun Jun 30 10:03:08 2024 (2046405942): Sending command from buffer
Sun Jun 30 10:03:08 2024 (2046405948): sent bytes: 111 including checksum value: 1 
Sun Jun 30 10:03:09 2024 (2046407099): Received 203 bytes data
Sun Jun 30 10:03:09 2024 (2046407101): Checksum and header received ok!
Sun Jun 30 10:03:11 2024 (2046408909): Heishamon stats: Uptime: 23 days 16 hours 26 minutes 48 seconds ## Free memory: 60% ## Heap fragmentation: 12% ## Max free block: 20504 bytes ## Free heap: 23176 bytes ## Wifi: 100% (RSSI: -45) ## Mqtt reconnects: 11946 ## Correct data: 97.06% Rules active: 0

But the Heishamon says that 97% are OK (last row above)

Any ideas?

Apart from that, Heishamon is working fine (as far as I can see, because my heatpump does nothing, as the hot water is produced with solar thermal energy; at least the sensor values are available and make sense. And there are no reboots)

klausj1 commented 2 days ago

Maybe its two different problems nad reads and going offline:

It seems the heatpump goes offline when it looses the MQTT connection to the HA:

image

And the corresponding Heishamon Log:

Sun Jun 30 10:04:01 2024 (2046458919): Heishamon stats: Uptime: 23 days 16 hours 27 minutes 38 seconds ## Free memory: 59% ## Heap fragmentation: 8% ## Max free block: 21152 bytes ## Free heap: 22936 bytes ## Wifi: 100% (RSSI: -46) ## Mqtt reconnects: 11946 ## Correct data: 97.06% Rules active: 0
Sun Jun 30 10:04:01 2024 (2046458937): Requesting new panasonic data
Sun Jun 30 10:04:03 2024 (2046460666): sent bytes: 111 including checksum value: 18 
Sun Jun 30 10:04:03 2024 (2046460668): Requesting new panasonic extra data
Sun Jun 30 10:04:03 2024 (2046460671): Already sending data. Buffering this send request
Sun Jun 30 10:04:03 2024 (2046461119): Received 203 bytes data
Sun Jun 30 10:04:03 2024 (2046461122): Checksum and header received ok!
Sun Jun 30 10:04:03 2024 (2046461131): received TOP115 Water_Pressure: 2.54
Sun Jun 30 10:04:03 2024 (2046461134): Sending command from buffer
Sun Jun 30 10:04:03 2024 (2046461136): sent bytes: 111 including checksum value: 1 
Sun Jun 30 10:04:05 2024 (2046463263): Previous read data attempt failed due to timeout!
Sun Jun 30 10:04:05 2024 (2046463265): Received 0 bytes data
Sun Jun 30 10:04:06 2024 (2046463919): Heishamon stats: Uptime: 23 days 16 hours 27 minutes 43 seconds ## Free memory: 61% ## Heap fragmentation: 14% ## Max free block: 20504 bytes ## Free heap: 23608 bytes ## Wifi: 100% (RSSI: -46) ## Mqtt reconnects: 11946 ## Correct data: 97.06% Rules active: 0
Sun Jun 30 10:04:06 2024 (2046463939): Requesting new panasonic data
Sun Jun 30 10:04:06 2024 (2046463942): sent bytes: 111 including checksum value: 18 
Sun Jun 30 10:04:06 2024 (2046463949): Requesting new panasonic extra data
Sun Jun 30 10:04:07 2024 (2046464836): Already sending data. Buffering this send request
Sun Jun 30 10:04:07 2024 (2046464850): Received bad header. Ignoring this data!

[many identical rows deleted]

Sun Jun 30 10:04:07 2024 (2046465325): Received bad header. Ignoring this data!
Sun Jun 30 10:04:07 2024 (2046465334): Received 203 bytes data
Sun Jun 30 10:04:07 2024 (2046465335): Checksum and header received ok!
Sun Jun 30 10:04:07 2024 (2046465344): received TOP115 Water_Pressure: 2.56
Sun Jun 30 10:04:07 2024 (2046465362): Sending command from buffer
Sun Jun 30 10:04:07 2024 (2046465364): sent bytes: 111 including checksum value: 1 
Sun Jun 30 10:04:08 2024 (2046465823): Received 203 bytes data
Sun Jun 30 10:04:08 2024 (2046465824): Checksum and header received ok!
Sun Jun 30 10:04:11 2024 (2046468921): Heishamon stats: Uptime: 23 days 16 hours 27 minutes 48 seconds ## Free memory: 69% ## Heap fragmentation: 21% ## Max free block: 21152 bytes ## Free heap: 26760 bytes ## Wifi: 100% (RSSI: -45) ## Mqtt reconnects: 11946 ## Correct data: 97.06% Rules active: 0
Sun Jun 30 10:04:14 2024 (2046471488): Requesting new panasonic data
Sun Jun 30 10:04:14 2024 (2046471490): sent bytes: 111 including checksum value: 18 
Sun Jun 30 10:04:14 2024 (2046471492): Requesting new panasonic extra data
Sun Jun 30 10:04:14 2024 (2046471499): Already sending data. Buffering this send request
Sun Jun 30 10:04:14 2024 (2046471927): Received 203 bytes data
Sun Jun 30 10:04:14 2024 (2046471928): Checksum and header received ok!
Sun Jun 30 10:04:14 2024 (2046471937): Sending command from buffer
Sun Jun 30 10:04:14 2024 (2046471938): sent bytes: 111 including checksum value: 1 
Sun Jun 30 10:04:15 2024 (2046473021): Received 203 bytes data
Sun Jun 30 10:04:15 2024 (2046473022): Checksum and header received ok!

[Here the MQTT connection gets lost]

Sun Jun 30 10:04:16 2024 (2046473920): Lost MQTT connection!
Sun Jun 30 10:04:16 2024 (2046473921): Reconnecting to mqtt server ...
Sun Jun 30 10:04:19 2024 (2046477114): Heishamon stats: Uptime: 23 days 16 hours 27 minutes 57 seconds ## Free memory: 57% ## Heap fragmentation: 8% ## Max free block: 20504 bytes ## Free heap: 22216 bytes ## Wifi: 100% (RSSI: -46) ## Mqtt reconnects: 11947 ## Correct data: 97.06% Rules active: 0
Sun Jun 30 10:04:19 2024 (2046477136): Requesting new panasonic data
Sun Jun 30 10:04:19 2024 (2046477137): sent bytes: 111 including checksum value: 18 
Sun Jun 30 10:04:19 2024 (2046477144): Requesting new panasonic extra data

In this time, there is not a single warning or error in the HA log.

And here is the corresponding detailed log:

Jun 30 10:04:14 homeassistant addon_core_mosquitto[526]: 2024-06-30 12:04:14: Client HeishaMon closed its connection.
Jun 30 10:04:16 homeassistant addon_core_mosquitto[526]: 2024-06-30 12:04:16: New connection from 192.168.1.72:55942 on port 1883.
Jun 30 10:04:17 homeassistant hassio_dns[526]: [INFO] 172.30.32.1:47634 - 36008 "A IN ha.local.hass.io. udp 34 false 512" NXDOMAIN qr,aa,rd 34 0.002729152s
Jun 30 10:04:19 homeassistant addon_core_mosquitto[526]: 2024-06-30 12:04:19: New client connected from 192.168.1.72:55942 as HeishaMon (p2, c1, k5, u'mqttHomeAssist').

So the Heishamon actively closes the connection to HA, not the other way round.

I also saw this, which also leads to a connection loss:

Jun 30 10:05:09 homeassistant addon_core_mosquitto[526]: 2024-06-30 12:05:09: New connection from 192.168.1.72:59345 on port 1883.
Jun 30 10:05:11 homeassistant addon_core_mosquitto[526]: 2024-06-30 12:05:11: Client HeishaMon already connected, closing old connection.
Jun 30 10:05:11 homeassistant addon_core_mosquitto[526]: 2024-06-30 12:05:11: New client connected from 192.168.1.72:59345 as HeishaMon (p2, c1, k5, u'mqttHomeAssist').
IgorYbema commented 2 days ago

97% is fine, could be better but should not be any problem. And MQTT reconnects could be due to a busy wifi network but you could also ignore that as long it is not intefering with the information from and to heishamon.