I understand what you are saying, but what I don’t understand is why every night at almost the same time the ECU-R becomes unavailable. From 00:59 till 02:45, from 04:26 till 05:41 and from 06:27 till 08:43 every night. +/- a few minutes.
Also every night at 02:38 sharp, the ECU-R reconnect its WiFi connection. This is for maintenance I guess.
I’m just telling what I see… that’s all.
I have used the integrations succesfully for a few days. Until the ECU disconnected. I reinstalled the intergartion but get this error when I enter the IP adres.
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'' ``
Does someone know what the problem is?
If you have this logo on the back of the ECU-R your firmware will be ECU-R-Pro
The query it executes delivers an unexpected empty response from the ECU which is misinterpreted and an error is raised. There is no cached data available yet so the integration fails. Try powercycle the ECU to see if this solves the issue. It is still a mistery why the ECU-R-Pro has this issue but work to bypass this using a HTTP call to the webinterface on the ECU-R-Pro is in progress. It could also be a timeout on the receiving part because this has not been tried yet. If you know how to edit APSystemsSocket.py you could try (only) adding self.sock.settimeout(self.timeout) at the locations pointed in Use timeout on send and receive · Discussion #50 · ksheumaker/homeassistant-apsystems_ecur · GitHub restart HA after editting. For ECU-R and ECU-B owners there is no issue with the integration. Please let us know what the results are so we can rule out this option.
I’m probably doing something wrong here by adding self.sock.settimeout(self.timeout) to the four places in APSystemsSocket.py (or as close to as possible) in version 1.2.11, but it did not work for me. Produced a whole new error though when setting up the integration:
2022-03-08 11:54:11 ERROR (MainThread) [custom_components.apsystems_ecur.config_flow] Unhandled exception: 'APSystemsSocket' object has no attribute 'sock' 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 130, in query_ecu sock = self.open_socket() File "/config/custom_components/apsystems_ecur/APSystemsSocket.py", line 121, in open_socket self.sock.settimeout(self.timeout) AttributeError: 'APSystemsSocket' object has no attribute 'sock'
APSystemsSocket.py contains this part right?: data = self.sock.recv(self.recv_size) Can you post the code from where def read_from_socket(self): starts and def query_ecu(self): starts (everything inbetween?
I’m new here and looking at the amazing work has been achieved here regarding pulling data out of the ECU-R. I’m trying for a few days now to change the ‘APSystemsSocket.py’ to run alone (by entering the IP address in the script) and getting a JSON-dump as output. Unfortunatly I’m not much of a programmer and are stuck. Can someone get me on my way?
That’s weird because with a fresh install of 1.2.11 line 120 does not produce an error does it? On that line self.sock.settimeout(self.timeout) is also used and first called so it must also be correct using it elsewhere. Guess we have to wait until a complete release might have set this timeout setting for the other functions. Like I suggested here: Use timeout on send and receive · Discussion #50 · ksheumaker/homeassistant-apsystems_ecur · GitHub
I did this by editing the core.config_entries file from HA, it contains a section for your ECUR (just search within the file for ecur)
In that section, there is this part:
If you change those values, reboot HA and the new values should be used.
Caution: editing these core config files might nuke your HA, so be carefull here.
You find the file in the /config/.storage location
Removing and adding the integration settings is also an option but requires more frontend work, depending on the scale of the PV array. It is possible to add a settings option also, though this requires a change.