fl4p / batmon-ha

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

Connection to Victron Shunt not working. Worked fine yesterday... #74

Closed snipah closed 1 year ago

snipah commented 1 year ago

Thanks for your great add-on. Unfortunately it is not working for me currently but worked fine yesterday with your new release. Can you spot what the problem might be? GATT is enabled... and as I said: It worked fine yesterday. Only change: I changed to LiPo4 today and thus the shunt was not powered for some time and now as working again.

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started 20:56:28 INFO [main] BT Discovery: 20:56:33 INFO [main] BT Device Poessl address=A4:C1:38:98:10:10 20:56:33 INFO [main] BT Device DXL5300EVO address=D5:65:B8:25:B3:CB 20:56:33 INFO [main] BT Device 70-B9-50-1B-57-F1 address=70:B9:50:1B:57:F1 20:56:33 INFO [main] BT Device 140R00036D address=38:AB:41:1F:40:CE 20:56:33 INFO [main] BT Device CC-D2-81-66-BE-D7 address=CC:D2:81:66:BE:D7 20:56:33 INFO [main] BT Device 0B-36-C4-E6-C7-A5 address=0B:36:C4:E6:C7:A5 20:56:33 INFO [main] BT Device 21-8F-14-66-22-07 address=21:8F:14:66:22:07 20:56:33 INFO [main] BT Device 69-23-87-AA-16-CC address=69:23:87:AA:16:CC 20:56:33 INFO [main] BT Device 55-89-8B-CC-A7-E1 address=55:89:8B:CC:A7:E1 20:56:33 INFO [main] BT Device 4D-DF-63-0C-C9-E3 address=4D:DF:63:0C:C9:E3 20:56:33 INFO [main] Verbose logging enabled 20:56:33 INFO [bt] BMS SmartShuntBt(FD:55:52:B0:DF:2D) keep alive enabled 20:56:33 INFO [main] connecting mqtt snipah@core-mosquitto 20:56:33 DEBUG [client] Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b'' 20:56:33 INFO [main] Fetching 1 BMS + 0 others serially, period=1.00s, keep_alive=True 20:56:33 INFO [sampling] connecting bms SmartShuntBt(FD:55:52:B0:DF:2D) 20:56:33 DEBUG [client] Connecting to device @ FD:55:52:B0:DF:2D with hci0 20:56:33 DEBUG [scanner] cached devices: {'/org/bluez/hci0/dev_55_89_8B_CC_A7_E1': {'Address': '55:89:8B:CC:A7:E1', 'AddressType': 'random', 'Alias': '55-89-8B-CC-A7-E1', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -87, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b'\x0f\x05\x90\x00B\x8eo\x10\x02(\x04'}, 'TxPower': 6, 'ServicesResolved': False}, '/org/bluez/hci0/dev_69_23_87_AA_16_CC': {'Address': '69:23:87:AA:16:CC', 'AddressType': 'random', 'Alias': '69-23-87-AA-16-CC', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -93, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b'\x10\x05\x04\x18\xfa\x0e\x85'}, 'TxPower': 12, 'ServicesResolved': False}, '/org/bluez/hci0/dev_21_8F_14_66_22_07': {'Address': '21:8F:14:66:22:07', 'AddressType': 'random', 'Alias': '21-8F-14-66-22-07', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -88, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b'\t\x06\x03\x8b\xc0\xa8\x019'}, 'ServicesResolved': False}, '/org/bluez/hci0/dev_0B_36_C4_E6_C7_A5': {'Address': '0B:36:C4:E6:C7:A5', 'AddressType': 'random', 'Alias': '0B-36-C4-E6-C7-A5', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -90, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b'\t\x06\x03\x84\xc0\xa8\x01\x10\x13\x0c\n0(;\x9cm\x13\x01\x04\x01\x03\x0c'}, 'ServicesResolved': False}, '/org/bluez/hci0/dev_CC_D2_81_66_BE_D7': {'Address': 'CC:D2:81:66:BE:D7', 'AddressType': 'public', 'Alias': 'CC-D2-81-66-BE-D7', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -87, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b'\x10\x05\x0f\x14\x08\xe8\xf2'}, 'TxPower': 12, 'ServicesResolved': False}, '/org/bluez/hci0/dev_CC_33_31_C9_9F_42': {'Address': 'CC:33:31:C9:9F:42', 'AddressType': 'public', 'Alias': 'CC-33-31-C9-9F-42', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -44, 'Connected': False, 'UUIDs': ['0000ada0-0000-1000-8000-00805f9b34fb'], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {13: b'\x00\x02\x99a\x84\xa4\xef\xbe\xfbF\x9c\xdf\xbe\xfb\x15p\x10\xc0\x04U\xc9\x9fB'}, 'ServicesResolved': False}, '/org/bluez/hci0/dev_1A_80_D0_D8_75_6A': {'Address': '1A:80:D0:D8:75:6A', 'AddressType': 'random', 'Alias': '1A-80-D0-D8-75-6A', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -96, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b'\x16\x08\xc1\x00\xafv\xac\xc2\xfd\xb5'}, 'ServicesResolved': False}, '/org/bluez/hci0/dev_4D_DF_63_0C_C9_E3': {'Address': '4D:DF:63:0C:C9:E3', 'AddressType': 'random', 'Alias': '4D-DF-63-0C-C9-E3', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -82, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b'\x10\x06<\x1a\x1c\x88\xf8\xd1'}, 'TxPower': 8, 'ServicesResolved': False}, '/org/bluez/hci0/dev_A4_C1_38_98_10_10': {'Address': 'A4:C1:38:98:10:10', 'AddressType': 'public', 'Name': 'Poessl', 'Alias': 'Poessl', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -39, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ServiceData': {'0000181c-0000-1000-8000-00805f9b34fb': b'\x02\x00\x02#\x02\xb9\x04\x03\x03c\x17\x02\x01<'}, 'ServicesResolved': False}, '/org/bluez/hci0/dev_A4_C1_38_45_CA_B5': {'Address': 'A4:C1:38:45:CA:B5', 'AddressType': 'public', 'Name': 'Poessl2', 'Alias': 'Poessl2', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -38, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ServiceData': {'0000181c-0000-1000-8000-00805f9b34fb': b'\x02\x00!#\x02\xc9\x04\x03\x03\xdf\x14\x02\x016'}, 'ServicesResolved': False}, '/org/bluez/hci0/dev_CC_D2_81_76_C0_7B': {'Address': 'CC:D2:81:76:C0:7B', 'AddressType': 'public', 'Alias': 'CC-D2-81-76-C0-7B', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -77, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b'\x10\x05\x03\x10\xafAr'}, 'TxPower': 12, 'ServicesResolved': False}, '/org/bluez/hci0/dev_12_2C_6F_CE_AD_A9': {'Address': '12:2C:6F:CE:AD:A9', 'AddressType': 'random', 'Alias': '12-2C-6F-CE-AD-A9', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -79, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b'\t\x06\x03\x13\xc0\xa8\x01\xeb'}, 'ServicesResolved': False}, '/org/bluez/hci0/dev_50_CB_ED_97_CF_E6': {'Address': '50:CB:ED:97:CF:E6', 'AddressType': 'random', 'Alias': '50-CB-ED-97-CF-E6', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -92, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b"\x0f\x05\x90\x00\xc5u\xc9\x10\x02'\x04"}, 'TxPower': 6, 'ServicesResolved': False}, '/org/bluez/hci0/dev_D5_65_B8_25_B3_CB': {'Address': 'D5:65:B8:25:B3:CB', 'AddressType': 'random', 'Name': 'DXL5300EVO ', 'Alias': 'DXL5300EVO ', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -40, 'Connected': False, 'UUIDs': ['00000004-cb9e-c5be-2316-6278917f8a2f'], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {65535: b'\x10\x03\x11\x05'}, 'ServicesResolved': False}, '/org/bluez/hci0/dev_70_B9_50_1B_57_F1': {'Address': '70:B9:50:1B:57:F1', 'AddressType': 'public', 'Alias': '70-B9-50-1B-57-F1', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -91, 'Connected': False, 'UUIDs': ['2171df5f-abd7-54ad-8c66-355c9740eb7c'], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {76: b'\x02\x15\xe2\n9\xf4s\xf5K\xc4\x18d\x17\xd1\xad\x07\xa9b\xcbg\x03\x84\x00'}, 'ServicesResolved': False}, '/org/bluez/hci0/dev_38_AB_41_1F_40_CE': {'Address': '38:AB:41:1F:40:CE', 'AddressType': 'public', 'Name': '140R00036D', 'Alias': '140R00036D', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -68, 'Connected': False, 'UUIDs': ['0000fff0-0000-1000-8000-00805f9b34fb', '0000ffb0-0000-1000-8000-00805f9b34fb'], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {0: b'\xff\xff\xff\xffd\x00\xff\x00\x00\x00\x00\x00\x00\x00\x00\x00'}, 'TxPower': 0, 'ServicesResolved': False}, '/org/bluez/hci0/dev_D0_4D_6B_30_481E': {'Address': 'D0:4D:6B:30:48:1E', 'AddressType': 'random', 'Name': 'SmartSolar HQ2140K9CDP', 'Alias': 'SmartSolar HQ2140K9CDP', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -60, 'Connected': False, 'UUIDs': [], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {737: b'\x10\x02T\xa0\x01\x8a$:\xce\x97U$t\r\xa6\xbfl\x10z'}, 'ServicesResolved': False}, '/org/bluez/hci0/dev_FD_55_52_B0_DF_2D': {'Address': 'FD:55:52:B0:DF:2D', 'AddressType': 'random', 'Name': 'SmartShunt HQ2220ZZUQA', 'Alias': 'SmartShunt HQ2220ZZUQA', 'Paired': True, 'Trusted': True, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -61, 'Connected': False, 'UUIDs': ['00001800-0000-1000-8000-00805f9b34fb', '00001801-0000-1000-8000-00805f9b34fb', '306b0001-b081-4037-83dc-e59fcc3cdfd0', '65970000-4bda-4c1e-af4b-551c4cf74769', '68c10001-b17f-4d3a-a290-34ad6499937c', '97580001-ddf1-48be-b73e-182664615d8e'], 'Adapter': '/org/bluez/hci0', 'ManufacturerData': {737: b'\x10\x02\x89\xa3\x02\xb2$\xe2,)\x00\x97\x11b\xecLP\x0b\x92\x0b\xfa\xad\x91'}, 'ServicesResolved': False}} 20:56:34 DEBUG [scanner] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0): ['org.bluez.Adapter1', {'Discovering': <dbus_next.signature.Variant ('b', True)>}, []] 20:56:34 DEBUG [client] Received CONNACK (0, 0) 20:56:34 DEBUG [scanner] received D-Bus signal: org.freedesktop.DBus.Properties.PropertiesChanged (/org/bluez/hci0/dev_FD_55_52_B0_DF_2D): ['org.bluez.Device1', {'RSSI': <dbus_next.signature.Variant ('n', -53)>, 'ManufacturerData': <dbus_next.signature.Variant ('a{qv}', {737: <dbus_next.signature.Variant ('ay', b'\x01\x07Rq\xf9\x9a\xb8\x81\x01\t\x00\x00u\xed\xac\x82')>})>}, []] 20:56:54 DEBUG [client] _remove_signal_handlers(/org/bluez/hci0/dev_FD_55_52_B0_DF_2D) 20:56:54 DEBUG [client] _disconnect_message_bus(/org/bluez/hci0/dev_FD_55_52_B0_DF_2D) 20:56:54 ERROR [sampling] Shunt error: <class 'asyncio.exceptions.TimeoutError'> 20:56:54 ERROR [main] 1 exceptions occurred fetching BMSs 20:56:54 ERROR [main] Error (num 1, max 0) reading BMS: 20:56:54 ERROR [main] Stack: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 305, in call await future asyncio.exceptions.CancelledError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/tasks.py", line 456, in wait_for return fut.result() asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/main.py", line 45, in fetch_loop await fn() File "/app/main.py", line 234, in fn raise exceptions[0] File "/app/main.py", line 229, in fn await t File "/app/bmslib/sampling.py", line 50, in call return await self.sample() File "/app/bmslib/sampling.py", line 68, in sample async with bms: File "/app/bmslib/bt.py", line 164, in aenter await self.connect() File "/app/bmslib/victron.py", line 64, in connect await super().connect(timeout=timeout) File "/app/bmslib/bt.py", line 76, in connect await self._connect_client(timeout=timeout) File "/app/bmslib/bt.py", line 47, in _connect_client await self.client.connect(timeout=timeout) File "/usr/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 348, in connect reply = await asyncio.wait_for( File "/usr/lib/python3.10/asyncio/tasks.py", line 458, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError 20:56:55 INFO [sampling] connecting bms SmartShuntBt(FD:55:52:B0:DF:2D) 20:56:55 DEBUG [client] Connecting to device @ FD:55:52:B0:DF:2D with hci0

snipah commented 1 year ago

s6-rc: info: service s6rc-oneshot-runner: starting s6-rc: info: service s6rc-oneshot-runner successfully started s6-rc: info: service fix-attrs: starting s6-rc: info: service fix-attrs successfully started s6-rc: info: service legacy-cont-init: starting s6-rc: info: service legacy-cont-init successfully started s6-rc: info: service legacy-services: starting s6-rc: info: service legacy-services successfully started 21:11:46 INFO [main] BT Discovery: 21:11:51 INFO [main] BT Device 77-80-EE-65-72-B6 address=77:80:EE:65:72:B6 21:11:51 INFO [main] BT Device 70-B9-50-1B-57-F1 address=70:B9:50:1B:57:F1 21:11:51 INFO [main] BT Device C0-28-8D-F0-FB-9E address=C0:28:8D:F0:FB:9E 21:11:51 INFO [main] BT Device DXL5300EVO address=D5:65:B8:25:B3:CB 21:11:51 INFO [main] BT Device 21-8F-14-66-22-07 address=21:8F:14:66:22:07 21:11:51 INFO [main] BT Device 31-D5-07-EA-5C-8A address=31:D5:07:EA:5C:8A 21:11:51 INFO [main] BT Device CC-D2-81-66-BE-D7 address=CC:D2:81:66:BE:D7 21:11:51 INFO [main] BT Device FE-D2-55-51-B2-39 address=FE:D2:55:51:B2:39 21:11:51 INFO [main] BT Device 37-EB-AB-68-60-9E address=37:EB:AB:68:60:9E 21:11:51 INFO [main] BT Device 73-10-5F-8A-67-69 address=73:10:5F:8A:67:69 21:11:51 INFO [main] BT Device D5-DC-09-6E-60-BE address=D5:DC:09:6E:60:BE 21:11:51 INFO [main] BT Device SmartSolar HQ2140K9CDP address=D0:4D:6B:30:48:1E 21:11:51 INFO [main] BT Device SmartShunt HQ2220ZZUQA address=FD:55:52:B0:DF:2D 21:11:51 INFO [main] BT Device 2D-60-8C-99-60-59 address=2D:60:8C:99:60:59 21:11:51 INFO [main] BT Device 140R00036D address=38:AB:41:1F:40:CE 21:11:51 INFO [main] BT Device 49-C8-3A-DA-90-01 address=49:C8:3A:DA:90:01 21:11:51 INFO [main] BT Device CC-D2-81-76-C0-7B address=CC:D2:81:76:C0:7B 21:11:51 INFO [main] BT Device 72-7C-73-9D-A9-92 address=72:7C:73:9D:A9:92 21:11:51 INFO [main] BT Device 12-2C-6F-CE-AD-A9 address=12:2C:6F:CE:AD:A9 21:11:51 INFO [main] BT Device 42-E8-9D-6F-77-89 address=42:E8:9D:6F:77:89 21:11:51 INFO [main] BT Device 5E-E9-47-EC-D7-00 address=5E:E9:47:EC:D7:00 21:11:51 INFO [main] BT Device 0B-15-D2-2F-FF-AB address=0B:15:D2:2F:FF:AB 21:11:51 INFO [main] BT Device Poessl address=A4:C1:38:98:10:10 21:11:51 INFO [bt] BMS SmartShuntBt(FD:55:52:B0:DF:2D) keep alive enabled 21:11:51 INFO [main] connecting mqtt snipah@core-mosquitto 21:11:51 INFO [main] Fetching 1 BMS + 0 others serially, period=1.00s, keep_alive=True 21:11:51 INFO [sampling] connecting bms SmartShuntBt(FD:55:52:B0:DF:2D) 21:11:51 INFO [main] mqtt watchdog loop started with timeout 120.0s 21:12:12 ERROR [sampling] Shunt error: <class 'asyncio.exceptions.TimeoutError'> 21:12:12 ERROR [main] 1 exceptions occurred fetching BMSs 21:12:12 ERROR [main] Error (num 1, max 200) reading BMS: 21:12:12 ERROR [main] Stack: Traceback (most recent call last): File "/usr/lib/python3.10/site-packages/dbus_next/aio/message_bus.py", line 305, in call await future asyncio.exceptions.CancelledError During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/lib/python3.10/asyncio/tasks.py", line 456, in wait_for return fut.result() asyncio.exceptions.CancelledError The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/app/main.py", line 45, in fetch_loop await fn() File "/app/main.py", line 234, in fn raise exceptions[0] File "/app/main.py", line 229, in fn await t File "/app/bmslib/sampling.py", line 50, in call return await self.sample() File "/app/bmslib/sampling.py", line 68, in sample async with bms: File "/app/bmslib/bt.py", line 164, in aenter await self.connect() File "/app/bmslib/victron.py", line 64, in connect await super().connect(timeout=timeout) File "/app/bmslib/bt.py", line 76, in connect await self._connect_client(timeout=timeout) File "/app/bmslib/bt.py", line 47, in _connect_client await self.client.connect(timeout=timeout) File "/usr/lib/python3.10/site-packages/bleak/backends/bluezdbus/client.py", line 348, in connect reply = await asyncio.wait_for( File "/usr/lib/python3.10/asyncio/tasks.py", line 458, in wait_for raise exceptions.TimeoutError() from exc asyncio.exceptions.TimeoutError 21:12:13 INFO [sampling] connecting bms SmartShuntBt(FD:55:52:B0:DF:2D)

snipah commented 1 year ago

Closed! Wrong Shunt settings after switching to LiFePo