gluap / pyess

Python library for communication with LG ESS power converters
MIT License
31 stars 10 forks source link

Can't run essmqtt anymore. error message about coroutine 'ClientSession.close' was never awaited. #21

Closed pguich closed 1 year ago

pguich commented 1 year ago

I'm stumped. the Raspberry Pi where the MQTT broker is located shut down. After I restart, I can no longer run essmqtt on a different Rasperry pi. This is the error message I get:

pguich@pibackup:~ $ essmqtt INFO:pyess.aio_ess:fetching auth key Traceback (most recent call last): File "/home/pguich/.local/bin/essmqtt", line 8, in sys.exit(main()) File "/home/pguich/.local/lib/python3.9/site-packages/pyess/essmqtt.py", line 120, in main asyncio.run(_main(arguments)) File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/home/pguich/.local/lib/python3.9/site-packages/pyess/essmqtt.py", line 194, in _main await launch_main_loop(args, ess, handle_control, switch_active, switch_fastcharge, switch_winter) File "/home/pguich/.local/lib/python3.9/site-packages/pyess/essmqtt.py", line 213, in launch_main_loop async with Client(args.mqtt_server, port=args.mqtt_port, logger=logger, username=args.mqtt_user, File "/home/pguich/.local/lib/python3.9/site-packages/aiomqtt/client.py", line 893, in aenter await self.connect() File "/home/pguich/.local/lib/python3.9/site-packages/aiomqtt/client.py", line 422, in connect raise MqttError(str(error)) from None aiomqtt.error.MqttError: [Errno 111] Connection refused /home/pguich/.local/lib/python3.9/site-packages/pyess/aio_ess.py:205: RuntimeWarning: coroutine 'ClientSession.close' was never awaited ERROR:asyncio:Unclosed client session client_session: <aiohttp.client.ClientSession object at 0xf623add8> ERROR:asyncio:Unclosed connector connections: ['[(<aiohttp.client_proto.ResponseHandler object at 0xf50d5598>, 774.392811266)]'] connector: <aiohttp.connector.TCPConnector object at 0xf62fcd78>

The connection is refused, because of an Unclosed client session. What can I do? I'm a complete beginner, the fact that I was able to install and run press to begin with was a stroke of luck.

Many thanks for your help, and kind regards,

Pascal

pguich commented 1 year ago

sorry, that was a problem with home assistant, not with the ESS.