fl4p / batmon-ha

Add-on for Home Assistant to connect JK, JBD, Daly, ANT, SOK and Supervolt BMS via Bluetooth
MIT License
313 stars 60 forks source link

JK_B1A20S15P cannot read or publish data? #227

Open ligius- opened 6 months ago

ligius- commented 6 months ago

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:

May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 INFO [sampling] battery1 Power jump 334 % (prev=0 last=401, REG=120)
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 INFO [sampling] battery1: BmsSampl(47.5%,U=53.1V,I=7.55A,P=401W,Q=67/140Ah,mos=nan°C)
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 INFO [sampling] battery1 volt=[3319,3319,3317,3321,3321,3321,3324,3321,3321,3319,3320,3320,3321,3321,3322,3320] temp=[nan, nan, nan, nan]
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 INFO [sampling] Sending HA discovery for battery1 (num_samples=0)

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:

devices:
  - address: C8:47:80:03:7F:78
    type: jk
    alias: battery1
    debug: true
    current_calibration: 1
concurrent_sampling: false
keep_alive: true
verbose_log: true
sample_period: 3
publish_period: 2
invert_current: true
watchdog: true
expire_values_after: 20
install_newer_bleak: true
bt_power_cycle: true

LOGS:

May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 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\xef\x00\x00\x00\x00\x00'))>}, []]
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [jikong] bms msg(22) (buf150): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ef 0 0 0 0 0
May 03 16:12:13 beepi c2395a33a9ff[1013]:
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 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'\x7f\xcf\x00\x00\x98\x1e\x06\x00~\x1d\x00\x00\x01\x01\xfd\x00\x00\x00\x08\x00\x00\x00\x000\xd9\x03\x01\x00\xe0"\x02\x00\x1f\x00\x00\x00N\x1aC\x00d\x00\x00\x00\xc6\x03\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\xbf\x14\xa1\x1d\x00\x01\x00\x01\xb6\x05\x00\x00\x1d\xdc\xd5\x02\x00\x00\x00\x00\xef\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 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [jikong] bms msg(128) (buf278): 7f cf 0 0 98 1e 6 0 7e 1d 0 0 1 1 fd 0 0 0 8 0 0 0 0 30 d9 3 1 0 e0 22 2 0 1f 0 0 0 4e 1a 43 0 64 0 0 0 c6 3 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 27 0 0 0 70 82 41 40 0 0 0 0 bf 14 a1 1d 0 1 0 1 b6 5 0 0 1d dc d5 2 0 0 0 0 ef 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 16:12:13 beepi c2395a33a9ff[1013]:
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 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\xbe'))>}, []]
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 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 be
May 03 16:12:13 beepi c2395a33a9ff[1013]:
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [jikong] got response 2 (len300)
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [jikong] New 11.x firmware, offset=32
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 INFO [sampling] battery1 Power jump 334 % (prev=0 last=401, REG=120)
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 INFO [sampling] battery1: BmsSampl(47.5%,U=53.1V,I=7.55A,P=401W,Q=67/140Ah,mos=nan°C)
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 INFO [sampling] battery1 volt=[3319,3319,3317,3321,3321,3321,3324,3321,3321,3319,3320,3320,3321,3321,3322,3320] temp=[nan, nan, nan, nan]
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 INFO [sampling] Sending HA discovery for battery1 (num_samples=0)
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 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": 20.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 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_soc_current/config: {"unique_id": "battery1__soc_current", "name": "current", "device_class": "current", "state_class": "measurement", "unit_of_measurement": "A", "state_topic": "battery1/soc/current", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_soc_balance_current/config: {"unique_id": "battery1__soc_balance_current", "name": "balance_current", "device_class": "current", "state_class": "measurement", "unit_of_measurement": "A", "state_topic": "battery1/soc/balance_current", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "icon": "mdi:scale-unbalanced"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_soc_soc_percent/config: {"unique_id": "battery1__soc_soc_percent", "name": "soc", "device_class": "battery", "unit_of_measurement": "%", "state_topic": "battery1/soc/soc_percent", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "icon": "mdi:battery"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_soc_power/config: {"unique_id": "battery1__soc_power", "name": "power", "device_class": "power", "state_class": "measurement", "unit_of_measurement": "W", "state_topic": "battery1/soc/power", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "icon": "mdi:flash"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_soc_capacity/config: {"unique_id": "battery1__soc_capacity", "name": "capacity", "unit_of_measurement": "Ah", "state_topic": "battery1/soc/capacity", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_soc_cycle_capacity/config: {"unique_id": "battery1__soc_cycle_capacity", "name": "cycle_capacity", "unit_of_measurement": "Ah", "state_topic": "battery1/soc/cycle_capacity", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_soc_num_cycles/config: {"unique_id": "battery1__soc_num_cycles", "name": "num_cycles", "state_class": "measurement", "unit_of_measurement": "N", "state_topic": "battery1/soc/num_cycles", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "icon": "mdi:battery-sync"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_mosfet_status_capacity_ah/config: {"unique_id": "battery1__mosfet_status_capacity_ah", "name": "charge", "unit_of_measurement": "Ah", "state_topic": "battery1/mosfet_status/capacity_ah", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_bms_uptime/config: {"unique_id": "battery1__bms_uptime", "name": "uptime", "device_class": "duration", "state_class": "measurement", "unit_of_measurement": "s", "state_topic": "battery1/bms/uptime", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "icon": "mdi:clock"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_meter_sample_count/config: {"unique_id": "battery1__meter_sample_count", "name": "num_samples", "state_class": "measurement", "unit_of_measurement": "N", "state_topic": "battery1/meter/sample_count", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "icon": "mdi:counter"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_1/config: {"unique_id": "battery1__cell_voltages_1", "name": "Cell Volt 01", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/1", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_2/config: {"unique_id": "battery1__cell_voltages_2", "name": "Cell Volt 02", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/2", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_3/config: {"unique_id": "battery1__cell_voltages_3", "name": "Cell Volt 03", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/3", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_4/config: {"unique_id": "battery1__cell_voltages_4", "name": "Cell Volt 04", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/4", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_5/config: {"unique_id": "battery1__cell_voltages_5", "name": "Cell Volt 05", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/5", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_6/config: {"unique_id": "battery1__cell_voltages_6", "name": "Cell Volt 06", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/6", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_7/config: {"unique_id": "battery1__cell_voltages_7", "name": "Cell Volt 07", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/7", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_8/config: {"unique_id": "battery1__cell_voltages_8", "name": "Cell Volt 08", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/8", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_9/config: {"unique_id": "battery1__cell_voltages_9", "name": "Cell Volt 09", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/9", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_10/config: {"unique_id": "battery1__cell_voltages_10", "name": "Cell Volt 10", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/10", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_11/config: {"unique_id": "battery1__cell_voltages_11", "name": "Cell Volt 11", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/11", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_12/config: {"unique_id": "battery1__cell_voltages_12", "name": "Cell Volt 12", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/12", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_13/config: {"unique_id": "battery1__cell_voltages_13", "name": "Cell Volt 13", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/13", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_14/config: {"unique_id": "battery1__cell_voltages_14", "name": "Cell Volt 14", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/14", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_15/config: {"unique_id": "battery1__cell_voltages_15", "name": "Cell Volt 15", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/15", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_16/config: {"unique_id": "battery1__cell_voltages_16", "name": "Cell Volt 16", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/16", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_min/config: {"unique_id": "battery1__cell_voltages_min", "name": "Cell Volt min", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/min", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_max/config: {"unique_id": "battery1__cell_voltages_max", "name": "Cell Volt max", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/max", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_average/config: {"unique_id": "battery1__cell_voltages_average", "name": "Cell Volt average", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/average", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_median/config: {"unique_id": "battery1__cell_voltages_median", "name": "Cell Volt median", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/median", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_delta/config: {"unique_id": "battery1__cell_voltages_delta", "name": "Cell Volt delta", "device_class": "voltage", "unit_of_measurement": "V", "state_topic": "battery1/cell_voltages/delta", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_min_index/config: {"unique_id": "battery1__cell_voltages_min_index", "name": "Cell Index min", "state_topic": "battery1/cell_voltages/min_index", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_cell_voltages_max_index/config: {"unique_id": "battery1__cell_voltages_max_index", "name": "Cell Index max", "state_topic": "battery1/cell_voltages/max_index", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_meter_total_energy/config: {"unique_id": "battery1__meter_total_energy", "name": "total energy meter", "device_class": "energy", "unit_of_measurement": "kWh", "state_topic": "battery1/meter/total_energy", "expire_after": 7200, "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 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_meter_total_energy_charge/config: {"unique_id": "battery1__meter_total_energy_charge", "name": "total energy charge meter", "device_class": "energy", "state_class": "total_increasing", "unit_of_measurement": "kWh", "state_topic": "battery1/meter/total_energy_charge", "expire_after": 7200, "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 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_meter_total_energy_discharge/config: {"unique_id": "battery1__meter_total_energy_discharge", "name": "total energy discharge meter", "device_class": "energy", "state_class": "total_increasing", "unit_of_measurement": "kWh", "state_topic": "battery1/meter/total_energy_discharge", "expire_after": 7200, "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 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_meter_total_charge/config: {"unique_id": "battery1__meter_total_charge", "name": "total charge meter", "unit_of_measurement": "Ah", "state_topic": "battery1/meter/total_charge", "expire_after": 7200, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/sensor/battery1/_meter_total_cycles/config: {"unique_id": "battery1__meter_total_cycles", "name": "total cycles meter", "unit_of_measurement": "N", "state_topic": "battery1/meter/total_cycles", "expire_after": 7200, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "icon": "mdi:battery-sync"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/switch/battery1/charge/config: {"unique_id": "battery1__switch_charge", "name": "charge", "device_class": "outlet", "state_topic": "battery1/switch/charge", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "command_topic": "homeassistant/switch/battery1/charge/set"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/binary_sensor/battery1/charge/config: {"unique_id": "battery1__switch_charge", "name": "charge switch", "device_class": "power", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "state_topic": "battery1/switch/charge", "command_topic": "homeassistant/switch/battery1/charge/set"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/switch/battery1/discharge/config: {"unique_id": "battery1__switch_discharge", "name": "discharge", "device_class": "outlet", "state_topic": "battery1/switch/discharge", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "command_topic": "homeassistant/switch/battery1/discharge/set"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/binary_sensor/battery1/discharge/config: {"unique_id": "battery1__switch_discharge", "name": "discharge switch", "device_class": "power", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "state_topic": "battery1/switch/discharge", "command_topic": "homeassistant/switch/battery1/discharge/set"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/switch/battery1/balance/config: {"unique_id": "battery1__switch_balance", "name": "balance", "device_class": "outlet", "state_topic": "battery1/switch/balance", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "command_topic": "homeassistant/switch/battery1/balance/set"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 DEBUG [mqtt_util] discovery msg homeassistant/binary_sensor/battery1/balance/config: {"unique_id": "battery1__switch_balance", "name": "balance switch", "device_class": "power", "expire_after": 20.0, "device": {"identifiers": ["3080342450"], "manufacturer": "JK", "name": "JK_B1A20S15P (battery1)", "model": "JK_B1A20S15P", "sw_version": "11.288", "hw_version": "11.XW"}, "state_topic": "battery1/switch/balance", "command_topic": "homeassistant/switch/battery1/balance/set"}
May 03 16:12:13 beepi c2395a33a9ff[1013]: 17:12:13 INFO [sampling] JKBt(C8:47:80:03:7F:78,battery1) times: connect=15.33s fetch=0.86s
May 03 16:12:14 beepi c2395a33a9ff[1013]: 17:12:14 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\xc8\xf5\x0c\xf7\x0c\xf5\x0c\xf8\x0c\xf9\x0c\xfa\x0c\xfa\x0c\xfa\x0c\xf9\x0c\xf7\x0c\xf7\x0c\xf7\x0c\xf8\x0c\xf9\x0c\xf9\x0c\xf9\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\xf8\x0c\x03\x00\x03\x08#\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 16:12:14 beepi c2395a33a9ff[1013]: 17:12:14 DEBUG [jikong] header, clear buf bytearray(b'')
May 03 16:12:14 beepi c2395a33a9ff[1013]: 17:12:14 DEBUG [jikong] bms msg(128) (buf128): 55 aa eb 90 2 c8 f5 c f7 c f5 c f8 c f9 c fa c fa c fa c f9 c f7 c f7 c f7 c f8 c f9 c f9 c f9 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 f8 c 3 0 3 8 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 16:12:14 beepi c2395a33a9ff[1013]:
May 03 16:12:15 beepi c2395a33a9ff[1013]: 17:12: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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xef\x00\x00\x00\x00\x00'))>}, []]
May 03 16:12:15 beepi c2395a33a9ff[1013]: 17:12:15 DEBUG [jikong] bms msg(22) (buf150): 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ef 0 0 0 0 0
May 03 16:12:15 beepi c2395a33a9ff[1013]:
May 03 16:12:19 beepi a4573d05b19f[1013]: INFO:2024-05-03 17:12:19,721:hass_configurator.configurator:127.0.0.1 - "GET / HTTP/1.1" 200 -
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_C8_47_80_03_7F_78): ['org.bluez.Device1', {'ServicesResolved': <dbus_fast.signature.Variant ('b', False)>, 'Connected': <dbus_fast.signature.Variant ('b', False)>}, []]
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 DEBUG [client] Device disconnected (/org/bluez/hci0/dev_C8_47_80_03_7F_78)
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 DEBUG [client] _cleanup_all(/org/bluez/hci0/dev_C8_47_80_03_7F_78)
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 WARNING [bt] BMS JKBt(C8:47:80:03:7F:78,battery1) disconnected after 17.7s!
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 DEBUG [manager] received D-Bus signal: org.freedesktop.DBus.ObjectManager.InterfacesRemoved (/): ['/org/bluez/hci0/dev_C8_47_80_03_7F_78', ['org.bluez.Battery1']]
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 ERROR [sampling] battery1 error (#1): timeout waiting for 2
May 03 16:12:21 beepi c2395a33a9ff[1013]: Traceback (most recent call last):
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/bmslib/__init__.py", line 81, in wait_for
May 03 16:12:21 beepi c2395a33a9ff[1013]:     return await asyncio.wait_for(self._futures.get(name), timeout)
May 03 16:12:21 beepi c2395a33a9ff[1013]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/usr/lib/python3.11/asyncio/tasks.py", line 489, in wait_for
May 03 16:12:21 beepi c2395a33a9ff[1013]:     return fut.result()
May 03 16:12:21 beepi c2395a33a9ff[1013]:            ^^^^^^^^^^^^
May 03 16:12:21 beepi c2395a33a9ff[1013]: asyncio.exceptions.CancelledError
May 03 16:12:21 beepi c2395a33a9ff[1013]:
May 03 16:12:21 beepi c2395a33a9ff[1013]: During handling of the above exception, another exception occurred:
May 03 16:12:21 beepi c2395a33a9ff[1013]:
May 03 16:12:21 beepi c2395a33a9ff[1013]: Traceback (most recent call last):
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/bmslib/sampling.py", line 155, in __call__
May 03 16:12:21 beepi c2395a33a9ff[1013]:     s = await self._sample_inner()
May 03 16:12:21 beepi c2395a33a9ff[1013]:         ^^^^^^^^^^^^^^^^^^^^^^^^^^
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/bmslib/sampling.py", line 237, in _sample_inner
May 03 16:12:21 beepi c2395a33a9ff[1013]:     sample = await bms.fetch()
May 03 16:12:21 beepi c2395a33a9ff[1013]:              ^^^^^^^^^^^^^^^^^
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/bmslib/models/jikong.py", line 248, in fetch
May 03 16:12:21 beepi c2395a33a9ff[1013]:     await self._fetch_futures.wait_for(0x02, self.TIMEOUT)
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/bmslib/__init__.py", line 84, in wait_for
May 03 16:12:21 beepi c2395a33a9ff[1013]:     raise asyncio.TimeoutError("timeout waiting for %s" % name)
May 03 16:12:21 beepi c2395a33a9ff[1013]: TimeoutError: timeout waiting for 2
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 INFO [sampling] battery1 bms debug data: {'resp': {3: (bytearray(b'U\xaa\xeb\x90\x03\xc6JK_B1A20S15P\x00\x00\x00\x0011.XW\x00\x00\x0011.288\x00\x00\xb0\x03\xc4\x00\x16\x00\x00\x00JK_B1A20S15P\x00\x00\x00\x001234\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00231127\x00\x003080342450\x000000\x00Input Userdata\x00\x00123456\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00Input Userdata\x00\x00\xfc\xf9\xff\xff\x1f-\x00\x00\x00\x00\x00\x00\x90\x0f\x00\x00\x00\x00\xc0\xd8\x03\x00\x00\x00\x00\x01\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\xfe/\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xcc'), 1714745529.8848274), 1: (bytearray(b'U\xaa\xeb\x90\x01\xc6X\x02\x00\x00(\n\x00\x00A\n\x00\x00$\x0e\x00\x00\xfc\r\x00\x00\n\x00\x00\x00\x10\x0e\x00\x00Z\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc4\t\x00\x00H\xe8\x01\x00\x1e\x00\x00\x00<\x00\x00\x00H\xe8\x01\x00,\x01\x00\x00<\x00\x00\x00<\x00\x00\x00\xe8\x03\x00\x00\xbc\x02\x00\x00X\x02\x00\x00\xbc\x02\x00\x00X\x02\x00\x00\x1e\x00\x00\x002\x00\x00\x00\xe8\x03\x00\x00 \x03\x00\x00\x10\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\xe0"\x02\x00\xdc\x05\x00\x00\\\r\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xb0q\x0b\x00\x08\x00<2\x00\xfc\xf9\xff\xff\x1f-\x00\x00\x00\x00\x00\x00\xc8'), 1714745531.3666916), 2: (bytearray(b'U\xaa\xeb\x90\x02\xc7\xf7\x0c\xf7\x0c\xf5\x0c\xf9\x0c\xf9\x0c\xf9\x0c\xfc\x0c\xf9\x0c\xf9\x0c\xf7\x0c\xf8\x0c\xf8\x0c\xf9\x0c\xf9\x0c\xfa\x0c\xf8\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\xf8\x0c\x03\x00\x03\x08#\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\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xef\x00\x00\x00\x00\x00\x7f\xcf\x00\x00\x98\x1e\x06\x00~\x1d\x00\x00\x01\x01\xfd\x00\x00\x00\x08\x00\x00\x00\x000\xd9\x03\x01\x00\xe0"\x02\x00\x1f\x00\x00\x00N\x1aC\x00d\x00\x00\x00\xc6\x03\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\xbf\x14\xa1\x1d\x00\x01\x00\x01\xb6\x05\x00\x00\x1d\xdc\xd5\x02\x00\x00\x00\x00\xef\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\xfe\xff\x7f\xdc\x0f\x01\x00\x00\x00\x00\x00\x00\xbe'), 1714745533.8628871)}, 'char_w': <bleak.backends.bluezdbus.characteristic.BleakGATTCharacteristicBlueZDBus object at 0xf6732b30>, 'char_r': <bleak.backends.bluezdbus.characteristic.BleakGATTCharacteristicBlueZDBus object at 0xf6732b30>}
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 INFO [sampling] battery1 device info: DeviceInfo(JK_B1A20S15P,hw-11.XW,sw-11.288,JK_B1A20S15P,#3080342450)
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 INFO [sampling] Bleak version 0.20.2
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 ERROR [main] 1 exceptions occurred fetching BMSs
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 ERROR [main] Error (num 1, max 200) reading BMS: timeout waiting for 2
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 ERROR [main] Stack: Traceback (most recent call last):
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/bmslib/__init__.py", line 81, in wait_for
May 03 16:12:21 beepi c2395a33a9ff[1013]:     return await asyncio.wait_for(self._futures.get(name), timeout)
May 03 16:12:21 beepi c2395a33a9ff[1013]:            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/usr/lib/python3.11/asyncio/tasks.py", line 489, in wait_for
May 03 16:12:21 beepi c2395a33a9ff[1013]:     return fut.result()
May 03 16:12:21 beepi c2395a33a9ff[1013]:            ^^^^^^^^^^^^
May 03 16:12:21 beepi c2395a33a9ff[1013]: asyncio.exceptions.CancelledError
May 03 16:12:21 beepi c2395a33a9ff[1013]:
May 03 16:12:21 beepi c2395a33a9ff[1013]: During handling of the above exception, another exception occurred:
May 03 16:12:21 beepi c2395a33a9ff[1013]:
May 03 16:12:21 beepi c2395a33a9ff[1013]: Traceback (most recent call last):
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/main.py", line 36, in fetch_loop
May 03 16:12:21 beepi c2395a33a9ff[1013]:     if await fn():
May 03 16:12:21 beepi c2395a33a9ff[1013]:        ^^^^^^^^^^
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/main.py", line 319, in fn
May 03 16:12:21 beepi c2395a33a9ff[1013]:     raise exceptions[0]
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/main.py", line 314, in fn
May 03 16:12:21 beepi c2395a33a9ff[1013]:     await t()
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/bmslib/sampling.py", line 155, in __call__
May 03 16:12:21 beepi c2395a33a9ff[1013]:     s = await self._sample_inner()
May 03 16:12:21 beepi c2395a33a9ff[1013]:         ^^^^^^^^^^^^^^^^^^^^^^^^^^
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/bmslib/sampling.py", line 237, in _sample_inner
May 03 16:12:21 beepi c2395a33a9ff[1013]:     sample = await bms.fetch()
May 03 16:12:21 beepi c2395a33a9ff[1013]:              ^^^^^^^^^^^^^^^^^
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/bmslib/models/jikong.py", line 248, in fetch
May 03 16:12:21 beepi c2395a33a9ff[1013]:     await self._fetch_futures.wait_for(0x02, self.TIMEOUT)
May 03 16:12:21 beepi c2395a33a9ff[1013]:   File "/app/bmslib/__init__.py", line 84, in wait_for
May 03 16:12:21 beepi c2395a33a9ff[1013]:     raise asyncio.TimeoutError("timeout waiting for %s" % name)
May 03 16:12:21 beepi c2395a33a9ff[1013]: TimeoutError: timeout waiting for 2
May 03 16:12:21 beepi c2395a33a9ff[1013]:
May 03 16:12:21 beepi c2395a33a9ff[1013]: 17:12:21 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', {'Notifying': <dbus_fast.signature.Variant ('b', False)>}, []]
May 03 16:12:24 beepi c2395a33a9ff[1013]: 17:12:24 INFO [sampling] connecting bms JKBt(C8:47:80:03:7F:78,battery1)
May 03 16:12:24 beepi c2395a33a9ff[1013]: 17:12:24 INFO [bt] connecting battery1 (C8:47:80:03:7F:78) adapter=default timeout=6
May 03 16:12:24 beepi c2395a33a9ff[1013]: 17:12:24 DEBUG [client] Connecting to device @ C8:47:80:03:7F:78
ligius- commented 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)
Off-Grid-Garage commented 6 months ago

Have you tried: image

ligius- commented 6 months ago

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.

ligius- commented 3 months ago

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.

image

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.