Open ligius- opened 6 months ago
I left it running with a delay for sampling of 5s and it does manage to publish values about 1% of the time. Here is a successful snippet:
May 03 17:15:14 beepi f4e90f3202a0[1013]:
May 03 17:15:15 beepi f4e90f3202a0[1013]: 18:15:15 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b'\x00\x00\xe0"\x02\x00\xdc\x05\x00\x00\\\r\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'))>}, []]
May 03 17:15:15 beepi f4e90f3202a0[1013]: 18:15:15 DEBUG [jikong] bms msg(22) (buf150): 0 0 e0 22 2 0 dc 5 0 0 5c d 0 0 0 0 0 0 0 0 0 0
May 03 17:15:15 beepi f4e90f3202a0[1013]:
May 03 17:15:16 beepi f4e90f3202a0[1013]: 18:15:16 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'))>}, []]
May 03 17:15:16 beepi f4e90f3202a0[1013]: 18:15:16 DEBUG [jikong] bms msg(128) (buf278): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
May 03 17:15:16 beepi f4e90f3202a0[1013]:
May 03 17:15:16 beepi f4e90f3202a0[1013]: 18:15:16 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b'\xb0q\x0b\x00\x08\x00<2\x00\xfc\xf9\xff\xff\x1f-\x00\x00\x00\x00\x00\x00\xb3'))>}, []]
May 03 17:15:16 beepi f4e90f3202a0[1013]: 18:15:16 DEBUG [jikong] bms msg(22) (buf300): b0 71 b 0 8 0 3c 32 0 fc f9 ff ff 1f 2d 0 0 0 0 0 0 b3
May 03 17:15:16 beepi f4e90f3202a0[1013]:
May 03 17:15:16 beepi f4e90f3202a0[1013]: 18:15:16 DEBUG [jikong] got response 1 (len300)
May 03 17:15:16 beepi f4e90f3202a0[1013]: 18:15:16 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b'\xaaU\x90\xeb\xc8\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00D'))>}, []]
May 03 17:15:16 beepi f4e90f3202a0[1013]: 18:15:16 DEBUG [jikong] bms msg(20) (buf20): aa 55 90 eb c8 1 1 0 0 0 0 0 0 0 0 0 0 0 0 44
May 03 17:15:16 beepi f4e90f3202a0[1013]:
May 03 17:15:16 beepi f4e90f3202a0[1013]: 18:15:16 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b"U\xaa\xeb\x90\x02\xb1\xd9\x0c\xda\x0c\xd8\x0c\xd8\x0c\xca\x0c\xd6\x0c\xd9\x0c\xc6\x0c\xcc\x0c\xd8\x0c\xd1\x0c\xd6\x0c\xd6\x0c\xcc\x0c\xc6\x0c\xd3\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\xd3\x0c\x15\x00\x00\x0e#\x00&\x00\'\x000\x002\x002\x002\x001\x001\x001\x002\x00 \x002\x001\x001\x002\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"))>}, []]
May 03 17:15:16 beepi f4e90f3202a0[1013]: 18:15:16 DEBUG [jikong] header, clear buf bytearray(b'\xaaU\x90\xeb\xc8\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00D')
May 03 17:15:16 beepi f4e90f3202a0[1013]: 18:15:16 DEBUG [jikong] bms msg(128) (buf128): 55 aa eb 90 2 b1 d9 c da c d8 c d8 c ca c d6 c d9 c c6 c cc c d8 c d1 c d6 c d6 c cc c c6 c d3 c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ff ff 0 0 d3 c 15 0 0 e 23 0 26 0 27 0 30 0 32 0 32 0 32 0 31 0 31 0 31 0 32 0 20 0 32 0 31 0 31 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
May 03 17:15:16 beepi f4e90f3202a0[1013]:
May 03 17:15:17 beepi f4e90f3202a0[1013]: 18:15:17 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf3\x00\x00\x00\x00\x00'))>}, []]
May 03 17:15:17 beepi f4e90f3202a0[1013]: 18:15:17 DEBUG [jikong] bms msg(22) (buf150): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 f3 0 0 0 0 0
May 03 17:15:17 beepi f4e90f3202a0[1013]:
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b')\xcd\x00\x00\x7f\x8c\x13\x00\xb7\xa0\xff\xff\x04\x01\x00\x01\x00\x00\x08\x00\x00\x00\x003G\x17\x01\x00\xe0"\x02\x00\x1f\x00\x00\x00\xe9\x1bC\x00d\x00\x00\x00\x8e\x12\xc4\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x01\x00\x00\x00\xc8\x03\x00\x00~\x00p\x82A@\x00\x00\x00\x00\x84\x14a\x1d\x00\x01\x00\x01\xb6\x05\x00\x00\xeao\xd6\x02\x00\x00\x00\x00\xf3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'))>}, []]
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 DEBUG [jikong] bms msg(128) (buf278): 29 cd 0 0 7f 8c 13 0 b7 a0 ff ff 4 1 0 1 0 0 8 0 0 0 0 33 47 17 1 0 e0 22 2 0 1f 0 0 0 e9 1b 43 0 64 0 0 0 8e 12 c4 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ff 0 1 0 0 0 c8 3 0 0 7e 0 70 82 41 40 0 0 0 0 84 14 61 1d 0 1 0 1 b6 5 0 0 ea 6f d6 2 0 0 0 0 f3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
May 03 17:15:18 beepi f4e90f3202a0[1013]:
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\x7f\xdc\x0f\x01\x00\x00\x00\x00\x00\x00A'))>}, []]
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 DEBUG [jikong] bms msg(22) (buf300): 0 0 0 0 0 0 0 0 0 fe ff 7f dc f 1 0 0 0 0 0 0 41
May 03 17:15:18 beepi f4e90f3202a0[1013]:
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 DEBUG [jikong] got response 2 (len300)
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 INFO [sampling] connected bms JKBt(C8:47:80:03:7F:78,battery1)!
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b"U\xaa\xeb\x90\x02\xb2\xd6\x0c\xd8\x0c\xd3\x0c\xd3\x0c\xcb\x0c\xc5\x0c\xd5\x0c\xc6\x0c\xce\x0c\xd9\x0c\xd3\x0c\xd5\x0c\xd4\x0c\xcb\x0c\xd3\x0c\xd5\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xff\x00\x00\xd0\x0c\x15\x00\x00\x0e#\x00&\x00\'\x000\x002\x002\x002\x001\x001\x001\x002\x00 \x002\x001\x001\x002\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"))>}, []]
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 DEBUG [jikong] header, clear buf bytearray(b'')
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 DEBUG [jikong] bms msg(128) (buf128): 55 aa eb 90 2 b2 d6 c d8 c d3 c d3 c cb c c5 c d5 c c6 c ce c d9 c d3 c d5 c d4 c cb c d3 c d5 c 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ff ff 0 0 d0 c 15 0 0 e 23 0 26 0 27 0 30 0 32 0 32 0 32 0 31 0 31 0 31 0 32 0 20 0 32 0 31 0 31 0 32 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
May 03 17:15:18 beepi f4e90f3202a0[1013]:
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf3\x00\x00\x00\x00\x00'))>}, []]
May 03 17:15:18 beepi f4e90f3202a0[1013]: 18:15:18 DEBUG [jikong] bms msg(22) (buf150): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 f3 0 0 0 0 0
May 03 17:15:18 beepi f4e90f3202a0[1013]:
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b'\x08\xcd\x00\x00O\x89\x13\x00\xb7\xa0\xff\xff\x04\x01\x00\x01\x00\x00\x08\x00\x00\x00\x003D\x17\x01\x00\xe0"\x02\x00\x1f\x00\x00\x00\xec\x1bC\x00d\x00\x00\x00\x8f\x12\xc4\x00\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\x00\x01\x00\x00\x00\xc8\x03\x00\x00~\x00p\x82A@\x00\x00\x00\x00\x80\x14a\x1d\x00\x01\x00\x01\xb6\x05\x00\x00\xf0o\xd6\x02\x00\x00\x00\x00\xf3\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'))>}, []]
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [jikong] bms msg(128) (buf278): 8 cd 0 0 4f 89 13 0 b7 a0 ff ff 4 1 0 1 0 0 8 0 0 0 0 33 44 17 1 0 e0 22 2 0 1f 0 0 0 ec 1b 43 0 64 0 0 0 8f 12 c4 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ff 0 1 0 0 0 c8 3 0 0 7e 0 70 82 41 40 0 0 0 0 80 14 61 1d 0 1 0 1 b6 5 0 0 f0 6f d6 2 0 0 0 0 f3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
May 03 17:15:19 beepi f4e90f3202a0[1013]:
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78/service000e/char0011): ['org.bluez.GattCharacteristic1', {'Value': <dbus_fast.signature.Variant ('ay', bytearray(b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfe\xff\x7f\xdc\x0f\x01\x00\x00\x00\x00\x00\x00\xdb'))>}, []]
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [jikong] bms msg(22) (buf300): 0 0 0 0 0 0 0 0 0 fe ff 7f dc f 1 0 0 0 0 0 0 db
May 03 17:15:19 beepi f4e90f3202a0[1013]:
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [jikong] got response 2 (len300)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [jikong] New 11.x firmware, offset=32
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 INFO [sampling] battery1 subscribing for {'charge': True, 'discharge': True, 'balance': True} switch change
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [mqtt_util] subscribe homeassistant/switch/battery1/charge/set
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending SUBSCRIBE (d0, m1) [(b'homeassistant/switch/battery1/charge/set', 2)]
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [mqtt_util] subscribe homeassistant/switch/battery1/discharge/set
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending SUBSCRIBE (d0, m2) [(b'homeassistant/switch/battery1/discharge/set', 2)]
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [mqtt_util] subscribe homeassistant/switch/battery1/balance/set
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending SUBSCRIBE (d0, m3) [(b'homeassistant/switch/battery1/balance/set', 2)]
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 INFO [sampling] battery1 Power jump -1067 % (prev=0 last=-1280, REG=120)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m4), 'b'battery1/soc/total_voltage'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m5), 'b'battery1/soc/current'', ... (6 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m6), 'b'battery1/soc/balance_current'', ... (3 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m7), 'b'battery1/soc/soc_percent'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m8), 'b'battery1/soc/power'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m9), 'b'battery1/soc/capacity'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Received SUBACK
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m10), 'b'battery1/soc/cycle_capacity'', ... (6 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Received SUBACK
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m11), 'b'battery1/soc/num_cycles'', ... (2 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Received SUBACK
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m12), 'b'battery1/mosfet_status/capacity_ah'', ... (6 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m13), 'b'battery1/bms/uptime'', ... (8 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m14), 'b'battery1/meter/sample_count'', ... (1 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m15), 'b'battery1/switch/charge'', ... (2 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m16), 'b'battery1/switch/discharge'', ... (2 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m17), 'b'battery1/switch/balance'', ... (2 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 INFO [sampling] battery1: BmsSampl(51.1%,U=52.5V,I=-24.39A,P=-1280W,Q=71/140Ah,mos=nan°C)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m18), 'b'battery1/cell_voltages/1'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m19), 'b'battery1/cell_voltages/2'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m20), 'b'battery1/cell_voltages/3'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m21), 'b'battery1/cell_voltages/4'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m22), 'b'battery1/cell_voltages/5'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m23), 'b'battery1/cell_voltages/6'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m24), 'b'battery1/cell_voltages/7'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m25), 'b'battery1/cell_voltages/8'', ... (4 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m26), 'b'battery1/cell_voltages/9'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m27), 'b'battery1/cell_voltages/10'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m28), 'b'battery1/cell_voltages/11'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m29), 'b'battery1/cell_voltages/12'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m30), 'b'battery1/cell_voltages/13'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m31), 'b'battery1/cell_voltages/14'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m32), 'b'battery1/cell_voltages/15'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m33), 'b'battery1/cell_voltages/16'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m34), 'b'battery1/cell_voltages/min'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m35), 'b'battery1/cell_voltages/min_index'', ... (1 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m36), 'b'battery1/cell_voltages/max'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m37), 'b'battery1/cell_voltages/max_index'', ... (2 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m38), 'b'battery1/cell_voltages/delta'', ... (4 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m39), 'b'battery1/cell_voltages/average'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m40), 'b'battery1/cell_voltages/median'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 INFO [sampling] battery1 volt=[3286,3288,3283,3283,3275,3269,3285,3270,3278,3289,3283,3285,3284,3275,3283,3285] temp=[nan, nan, nan, nan]
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m41), 'b'battery1/meter/total_charge'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m42), 'b'battery1/meter/total_energy'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m43), 'b'battery1/meter/total_energy_discharge'', ... (3 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m44), 'b'battery1/meter/total_energy_charge'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m45), 'b'battery1/meter/total_cycles'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m46), 'b'battery1/meter/total_abs_diff_charge'', ... (5 bytes)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 INFO [sampling] Sending HA discovery for battery1 (num_samples=0)
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_soc_total_voltage/config: {"unique_id": "battery1__soc_total_voltage", "name": "voltage", "device_class": "voltage", "state_class": "measurement", "unit_of_measurement": "V", "state_topic": "battery1/soc/total_voltage", "expire_after": 240.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "icon": "mdi:meter-electric"}
May 03 17:15:19 beepi f4e90f3202a0[1013]: 18:15:19 DEBUG [client] Sending PUBLISH (d0, q0, r0, m47), 'b'homeassistant/sensor/battery1/_soc_total_voltage/config'', ... (418 bytes)
Have you tried:
Yes, but that did not change the behavior. Strangely enough, it started working by itself correctly after a few hours. I suspect it expected a certain order of messages but the state was set differently by the BT app. That's just my assumption but no idea yet how the code actually works and what it expects.
Sadly, it still is spotty. Sometimes it has a good run, sometimes it fails to get any reading for 20+ minutes. Publish_period is 10s, sample_period is 5s, expiry is set to 600s.
The error is the same, I've seen it only a few times where it could not connect to the BMS but I assume that's something with the BT connectivity on the BMS side as I see this also in the app.
I have a strange issue with my JK BMS above. I can see that some values are sampled in the logs but they never appear in MQTT, I assume due to the exception below. It's configured without a PIN as with a PIN it times out.
Short sample:
This is running under Home Assistant in Docker under rPi 4, the internal MQTT broker is configured and is already used for other topics. I also tried "concurrent sampling" with and without disabling the keepalive.
YAML:
LOGS: