-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatibility ECU-R pro and ECU-C owners >read this< #67
Comments
I also noticed the lack of some data, looks like all the diagnostic data is missing. I'm not sure if the ECU-R i manage through HA has the logo or not, but probably since it was bought last may. I don't have time to try what's suggested here for a few days, but i'd be happy to give temporary access to to you if you wanted to look into it HAEdwin? |
I do have an ECU-R-Pro Looks like version 2.0.6010 if I am reading the data correctly. One thing I noticed while throwing in some debug statements of my own, when I use the inverter command in packetsender it returns a 282 byte response, but the sock.recv() call in read_from_socket is simply returning b'' which bails out of that while loop. I can get the results from packetsender if that is helpful.
|
@nectur Returning b'' is one of the things to focus on. Packetsender does it right indeed so there's got to be something in using the socket. First I'd like to try out the timeout. Do the log results above include the use of the timeout statement? |
@HAEdwin I tried it both with and without the timeout, it did not make a difference either way. |
@nectur What if you remark lines 94 and 95 like this: |
@nectur If you have an ECU-r-pro (like me), you can try my alternative. It's an adapted version if this integration, based on querying the internal webserver of the ECU. It has been running for 2 months. I have upgraded HA and HACS without problems too. copy the files from my repo to replace the current one and restart HA |
@tv3 Yup, I have yours currently as a backup. I had jumped over to it after writing issue #59. Just trying to help out @HAEdwin with this debugging. So I modified what you requested a bit as I didn't care for the concept of the infinite loop: It never seemed to be able to parse any data: `2022-04-16 13:11:08 DEBUG (SyncWorker_6) [custom_components.apsystems_ecur.APSystemsSocket] Sending ECU query to socket APS1100280002216200010298END ... repeating 100x 2022-04-16 13:11:08 DEBUG (SyncWorker_6) [custom_components.apsystems_ecur.APSystemsSocket] data: b'' Something I realized, I don't think the settimeout calls you asked for are actually performing a wait if that's what you were intending. They are simply setting the timeout value on the socket, so that it if doesn't receive the data within that timeout it returns. That should only need to be set once per socket. I am going to attempt it with a time.sleep command instead. Will let you know. Edit: time.sleep didn't help either. |
@nectur It is indeed a timeout on the socket and it is said applies independently to each call to socket read/write operation (https://pyquestions.com/how-to-use-python-socket-settimeout-properly) I've examined the effects closely here: #50 Does 216200010298 indeed reflect your ECU-ID? It's odd that the ECU does not respond to this query. How does Packetsender respond to APS1100280002216200010298END? |
Oh I see, |
open_socket() doesn't return anything, so setting it to a local variable won't do anything. I will give it some run time and see how it looks. I do have a plug already in the loop that watches for 2 'unavailable' reads in a row and then will reboot the ECU due to the ECU's own stability issues. Minor item I am seeing already though is for some reason it doesn't seem to have created the extra inverter entities for voltage, frequency, temp, and signal. Not major for me at all right now. At some point I might try re-configuring the integration and see if they come back, but I am out of time to play with this for right now. |
@nectur Everything still running? No issues here with my standard ECU-R. Changes we made so far which help the compatibility with the ECU-R with ECU-R pro firmware (SunSpec logo on the back) AND ECU-C. We are now looking at how stable it remains for a longer period of time. To sum things up:
|
@HAEdwin Everything seems to still be running well. No restarts have been necessary in the last almost 48 hours since I stopped playing with it. I will probably give it a try to delete and re-install the integration to see if I can get those other entities. I can see the values for them in the data that is being processed in the logs. |
@HAEdwin Looks like 1.2.12 fixes my missing entities issue. It was the EntityCategory enum change. I was about to make a pull request for it and noticed that it had already been merged in and my HACS pull of 1.2.11 did not have it. Thanks! |
@nectur By the way, how is your ECU-R connected? WiFi or Ethernet, just checking. |
@HAEdwin I have it on WiFi right now. Do you want me to test if it supports ethernet? I wouldn't mind getting a device off my WiFi if it might work :) |
@nectur If you want you could try but I don't expect you to test it. With the older "standard" ECU-R it only works via WiFi so I don't expect the ECU-R with pro firmware will work for this combination Ethernet and Integration. |
I'd be happy also to get rid of WiFi so I can test it. Is there a way to change the IP address after setting up the integration? I renamed the solar panels and it's a lot of work to do again. Otherwise you use the fork by tv3 which scrapes the web interface and works also on ethernet |
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)
If you change those values, reboot HA and the new values should be used. |
@HAEdwin it works just fine also on wired ethernet as long as I reboot every night. |
If you own an ECU-C or ECU-R with Sunspec logo on the back you will have compatibility issues.
![image](https://user-images.githubusercontent.com/82239374/163632557-10e7e053-eb11-4cea-99f1-d15087701ff8.png)
Originally this integration was written based on the standard ECU-R (without SunSpec logo) and happened to be compatible with the ECU-B also. If you own one of these, this integration will work for you but notice this issue when you are running HA 2022.4 or later #62
I know some of you would like to help and make this integration compatible, I do not own an ECU-C or ECU-R with SunSpec logo and that makes it hard to solve your issues. But let's give it a try again... please inform me which ECU type you have and add the log. An alternative solution can be found here: #67 (comment) and can be made part of this integration later on.
This topic is primairly intended to try to understand why it would not work on the ECU-R with SunSpec logo or ECU-C.
Use integration v1.2.11 when installing, the things I'd like to try only work on this version. Also notice that if you're on HA2022.4 or higher you also have to apply these changes #62
In configuration.yaml add these lines:
![image](https://user-images.githubusercontent.com/82239374/163634622-2f0814dc-22f2-441e-af16-95b676ce0342.png)
(You will have to restart HA after each change in Python files or configuration.yaml)
I've seen the "connection reset by peer" error that some of you have. Also empty data is returned (and interpreted which causes an error). So let's try to introduce a time out period (self.sock.settimeout(self.timeout)).
![image](https://user-images.githubusercontent.com/82239374/163635420-ad7d48ec-0468-41a4-a5f1-a649e3463d09.png)
Modify APSystemsSocket.py and add it to lines 91 and 103
Restart HA and look at the log to see any errors. I'll await your feedback.
The text was updated successfully, but these errors were encountered: