warhammerkid / bluetti_mqtt

MQTT interface for Bluetti power stations
MIT License
144 stars 55 forks source link

Service did not find device although Bluetti AC200max was found during scanning (valid MAC) #64

Closed frog60 closed 1 year ago

frog60 commented 1 year ago

Using home assistant: ... Add-on: Bluetti to MQTT MQTT bridge between Bluetti and Home Assistant

Add-on version: 1.2.0 You are running the latest version of this add-on. System: Home Assistant OS 9.5 (aarch64 / raspberrypi4-64) Home Assistant Core: 2023.2.5 Home Assistant Supervisor: 2023.01.1 ...

Service does not start, although MAC adressed scanned was configured. Default mosquitto intgration was used (all field were left empty). Any ideas to solve this issue?

... 'org.bluez.Device1': {'Address': 'xx:xx:xx:xx:xx:xx', 'AddressType': 'public', 'Name': 'AC200Mxxxxxxxxxxxxx', 'Alias': 'AC200M2236008116154', 'Paired': False, 'Trusted': False, 'Blocked': False, 'LegacyPairing': False, 'RSSI': -77, 'Connected': True, ... 2023-02-20 19:45:24 DEBUG Found devices: [] 2023-02-20 19:45:24 DEBUG Shut down completed Could not find the given devices to connect to 2023-02-20 19:45:24 ERROR Crashing with uncaught exception: Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/bluetti_mqtt/server_cli.py", line 87, in start loop.run_forever() File "/usr/local/lib/python3.10/asyncio/base_events.py", line 600, in run_forever self._run_once() File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1896, in _run_once handle._run() File "/usr/local/lib/python3.10/asyncio/events.py", line 80, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.10/site-packages/bluetti_mqtt/server_cli.py", line 100, in run sys.exit('Could not find the given devices to connect to') SystemExit: Could not find the given devices to connect to 2023-02-20 19:45:24 ERROR Unhandled error in exception handler context: {'message': 'Task exception was never retrieved', 'exception': SystemExit('Could not find the given devices to connect to'), 'future': <Task finished name='Task-1' coro=<CommandLineHandler.run() done, defined at /usr/local/lib/python3.10/site-packages/bluetti_mqtt/server_cli.py:92> exception=SystemExit('Could not find the given devices to connect to')>} Traceback (most recent call last): File "/usr/local/lib/python3.10/asyncio/base_events.py", line 1781, in call_exception_handler self._exception_handler(self, context) File "/usr/local/lib/python3.10/site-packages/bluetti_mqtt/server_cli.py", line 136, in handle_global_exception asyncio.create_task(shutdown(loop)) File "/usr/local/lib/python3.10/asyncio/tasks.py", line 336, in create_task loop = events.get_running_loop() RuntimeError: no running event loop ... s6-rc: info: service legacy-services: stopping s6-rc: info: service legacy-services successfully stopped s6-rc: info: service legacy-cont-init: stopping s6-rc: info: service legacy-cont-init successfully stopped s6-rc: info: service fix-attrs: stopping s6-rc: info: service fix-attrs successfully stopped s6-rc: info: service s6rc-oneshot-runner: stopping s6-rc: info: service s6rc-oneshot-runner successfully stopped

frog60 commented 1 year ago

I checked it again and it works now. Don't know why. So you can reject this issue.

Thx.

.... [08:20:44] INFO: Reading configuration settings... [08:20:46] INFO: Starting bluetti-mqtt... 2023-02-21 08:20:53 INFO Connecting to MQTT broker... 2023-02-21 08:20:53 INFO Starting to poll clients... 2023-02-21 08:20:53 INFO Connecting to clients: ['xx:xx:xx:xx:xx:xx'] 2023-02-21 08:20:53 WARNING Could not determine BlueZ version, bluetoothctl not available, assuming 5.51+ 2023-02-21 08:20:53 INFO Connected to MQTT broker 2023-02-21 08:20:53 INFO Sent discovery message of AC200M-xxxxxxxx to Home Assistant 2023-02-21 08:20:53 WARNING filtered_messages() is deprecated and will be removed in a future version. Use messages() together with Topic.matches() instead.

frog60 commented 1 year ago

Closed it.