ksheumaker / homeassistant-apsystems_ecur

Home Assistant custom component for local querying of APSystems ECU-R Solar System
Apache License 2.0
177 stars 43 forks source link

Error when adding integration ECU-C #66

Closed GibbseyNZ closed 2 years ago

GibbseyNZ commented 2 years ago

I tried adding my ECU-C to this. The ECU-C is connected to wifi when I go to add the device I get "Can't connect to ECU, check log"

The log is attached below.

This error originated from a custom integration.

Logger: custom_components.apsystems_ecur.config_flow Source: custom_components/apsystems_ecur/APSystemsSocket.py:217 Integration: APSystems PV solar ECU (documentation) First occurred: 16:03:02 (3 occurrences) Last logged: 16:08:31

APSystemsInvalidData exception: Error getting checksum int from 'Inverter data' data=b'' Traceback (most recent call last): File "/config/custom_components/apsystems_ecur/APSystemsSocket.py", line 212, in check_ecu_checksum checksum = int(data[5:9]) ValueError: invalid literal for int() with base 10: b''

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/apsystems_ecur/config_flow.py", line 45, in async_step_user test_query = await self.hass.async_add_executor_job(ap_ecu.query_ecu) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/apsystems_ecur/APSystemsSocket.py", line 158, in query_ecu data = self.process_inverter_data() File "/config/custom_components/apsystems_ecur/APSystemsSocket.py", line 287, in process_inverter_data self.check_ecu_checksum(data, "Inverter data") File "/config/custom_components/apsystems_ecur/APSystemsSocket.py", line 217, in check_ecu_checksum raise APSystemsInvalidData(error) custom_components.apsystems_ecur.APSystemsSocket.APSystemsInvalidData: Error getting checksum int from 'Inverter data' data=b''

HAEdwin commented 2 years ago

This integration was originally written for the ECU-R (without SunSpec logo on the back) and happened to be compatible with the ECU-B also. Kyle and I do not own an ECU-C so it's hard to debug. You could try to addself.sock.settimeout(self.timeout) to APSystemsSocket.py on the lines where I discussed possible compatibility issues here: https://github.com/ksheumaker/homeassistant-apsystems_ecur/discussions/50

HAEdwin commented 2 years ago

@GibbseyNZ look at this post for directions if you whould like to try: https://github.com/ksheumaker/homeassistant-apsystems_ecur/issues/67

HAEdwin commented 2 years ago

@GibbseyNZ 1.2.12 was released, this should solve your issue. I received mail from another ECU-C owner that things are solved, can you confirm?

GibbseyNZ commented 2 years ago

I haven't had a chance to test the solution you sent me yet, I will give it a go tonight and update and see how it goes. If it does it will be great as I can then program my EV slow charger to be turned on by HA when my solar output gets above what the charger power usage would be. Thanks,

On Tue, 19 Apr 2022 at 06:42, Edwin @.***> wrote:

@GibbseyNZ https://github.com/GibbseyNZ 1.2.12 was released, this should solve your issue. I received mail from another ECU-C owner that things are solved, can you confirm?

— Reply to this email directly, view it on GitHub https://github.com/ksheumaker/homeassistant-apsystems_ecur/issues/66#issuecomment-1101649661, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA6FQP4YOYIXYLGTDUGLKODVFWUKNANCNFSM5TPQRPTQ . You are receiving this because you were mentioned.Message ID: @.***>

GibbseyNZ commented 2 years ago

Awesome. The update works. Thanks for that. If I can assist in any way with testing code for the ECU-C I can help out. I am a automation engineer and don't know python or HA coding at all but will help if i can.