home_assistant_solarman icon indicating copy to clipboard operation
home_assistant_solarman copied to clipboard

Update solarman.py

Open nedyarrd opened this issue 10 months ago • 7 comments

Repair python 3.12 issue. Now it works but without logging. After something about 21 march 2024, changes to HA core made this component unusable. That little fix will work, but without logging from pySolarmanv5

nedyarrd avatar Apr 04 '24 15:04 nedyarrd

Without logging means I don't get the current power?

Milinator avatar Apr 04 '24 17:04 Milinator

No it means that You will not have logging from PySolarmanv5, debug and normal messages. Sensors will start to work. If You are not programmer developer You don't need that.

nedyarrd avatar Apr 04 '24 20:04 nedyarrd

No it means that You will not have logging from PySolarmanv5, debug and normal messages. Sensors will start to work. If You are not programmer developer You don't need that.

Thanks for your work and your reply. Sadly this fix is not working for me either. Does this integration work at all if you use the intermediate relay from deye in addition to the inverter?

Milinator avatar Apr 05 '24 21:04 Milinator

No it means that You will not have logging from PySolarmanv5, debug and normal messages. Sensors will start to work. If You are not programmer developer You don't need that.

Thanks for your work and your reply. Sadly this fix is not working for me either. Does this integration work at all if you use the intermediate relay from deye in addition to the inverter?

Solved it by downgrading to 1.4.3. My inverter is deye sun-m80g3-eu-q0.

Milinator avatar Apr 06 '24 17:04 Milinator

So I tried this fix but I still have an error about a read only filesystem. I added some more handling to see the exception.

Traceback (most recent call last): File "/config/custom_components/solarman/solarman.py", line 83, in get_statistics self.connect_to_server() File "/config/custom_components/solarman/solarman.py", line 39, in connect_to_server self._modbus = PySolarmanV5(self._host, self._serial, port=self._port, mb_slave_id=self._mb_slaveid, logger=None, auto_reconnect=True, socket_timeout=15) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/site-packages/pysolarmanv5/pysolarmanv5.py", line 118, in __init__ self._socket_setup(kwargs.get("socket"), kwargs.get("auto_reconnect", False)) File "/usr/local/lib/python3.12/site-packages/pysolarmanv5/pysolarmanv5.py", line 415, in _socket_setup self._data_queue = Queue(maxsize=1) ^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/multiprocessing/context.py", line 103, in Queue return Queue(maxsize, ctx=self.get_context()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/multiprocessing/queues.py", line 43, in __init__ self._rlock = ctx.Lock() ^^^^^^^^^^ File "/usr/local/lib/python3.12/multiprocessing/context.py", line 68, in Lock return Lock(ctx=self.get_context()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/multiprocessing/synchronize.py", line 169, in __init__ SemLock.__init__(self, SEMAPHORE, 1, 1, ctx=ctx) File "/usr/local/lib/python3.12/multiprocessing/synchronize.py", line 57, in __init__ sl = self._semlock = _multiprocessing.SemLock( ^^^^^^^^^^^^^^^^^^^^^^^^^ OSError: [Errno 30] Read-only file system

bdeluca avatar Apr 06 '24 21:04 bdeluca

I fixed this issue by forking https://github.com/jmccrohan/pysolarmanv5/blob/main/pysolarmanv5/pysolarmanv5.py from the package to the local plugin directory and replacing the "multiprocessing Queue" with the standard python Queue.

psykokwak-com avatar Apr 11 '24 15:04 psykokwak-com

I fixed this issue by forking https://github.com/jmccrohan/pysolarmanv5/blob/main/pysolarmanv5/pysolarmanv5.py from the package to the local plugin directory and replacing the "multiprocessing Queue" with the standard python Queue.

the issue with /dev/shm? I traced it back to a change in docker-ce, I reverted docker-ce to the version 24 and It works again. I dont think this is meant to be read-only. But its not resolved in the homeassistant image yet.

bdeluca avatar Apr 13 '24 03:04 bdeluca