APsystems APS ECU R local inverters data pull

Seen this on other integrations too, better report on github indeed

Thanks for noticing, I’ll fix it asap.

Fixed it in release 1.2.27

1 Like

Thank @HAEdwin for the quick response. I saw it on github (someone else opened the issue already)

Hacs shows the updated version, I’ll install it later this weekend and let you know how it works.

Regards,

Michel

that line 210 change the only thing needed? (just curious for some other integrations with possible same issue)

Yes, that’ll it - reason explained here: Waiting for config entry platforms | Home Assistant Developer Docs

Last month I replaced my RPi4, 4GB with 128GB SD-card with an Intel NUC7i3BNH, 4GB with 120GB SSD drive, because a NUC would be faster at everything… they say. However, I notice very little of that speed improvement. :disappointed:

Now I have the annoying problem that almost every day the connection between the NUC and ECU-R (2160xxxx) is lost. With the RPi4 I had very little to no issue with that.
The only solution to re-establish the connection is to restart Home Assistant.
But can this also be done in another way?
e.g. by restarting only the ECU-R integration manually or automatically?

Connection lost is from ecu side mostly. I reboot ecu with power plug.
You run hassos directly on nuc or in virtual container?

It seems that the ECU-R is not the problem… the NUC is, because when I restart Home Assistant, I get connected again. Sporadically I have to restart the ECU-R (power cycle).
I’m using Hassio directly on the NUC, not in a virtual container.

You have some log then, for the moments it can’t retrieve data?

I’m happy to give you logs, but how do I get them? :blush:

Menu system/logs. There will be entry related to ecu-r. Click it and copy paste. But only if you experience the issue

Same problem again this morning.
Could not find a log file. (Settings/System/Logs/Home Assistant Core)

I wanted to reinstall the integration, but then saw that there were 10 open issues.
I’ve read almost all of these, and it looks like I have a lot in common with issues #163 and #179.

Also, if the issue occurs I can successfully ping the ECU-R (2160xxx), the issue seems to occur in the data transport from the ECU to NUC.

All in all, I now think that the issue started with me when I switched from RPi4 to NUC and not knowing that a firmware update of the ECU took place at the same time.

thats as good as impossible… if HA cant retrieve data, it has an error log. Do you have any logs in that screen?
would look like :
This error originated from a custom integration.

Logger: custom_components.apsystems_ecur
Source: custom_components/apsystems_ecur/init.py:84
Integration: APSystems PV solar ECU-R (documentation)
First occurred: April 28, 2023 at 9:04:18 PM (1 occurrences)
Last logged: April 28, 2023 at 9:04:18 PM

Using cached data from last successful communication from ECU. Error: Incomplete data from ECU after 6 attempts, cmd=‘APS1100280002216000061728END’ data=b’APS110015000202\n’

Then I think I’m looking in the wrong place?
Do I need to “Enable debug logging” too?


afbeelding

No, right place first picture… should really have an entry. Do you ever have entries over there?
Maybe logging is somehow disabled by configuration?
Care to share some yaml ?
If your default is critical or higher, it will never log a normal error situation

Can’t remember if it shows any logs in the past. Never had a look to it. Maybe there is something disabled?
BTW. Next lines are in my configuration.yaml… for a long time…
Should I delete them?

########################################
# Set the logging level of HA
########################################
logger:
  default: critical
  logs:
    # log level for HA core
    homeassistant.core: fatal

EDIT: I have removed the lines, restarted HA, and now I have entries in the log file.
Why I put them there is probably due to ignorance.

It quiets the logs significant:-)

It worked for a long time with no issues, but this morning when I checked the system, the issue was back.

2023-05-11 23:12:24.513 WARNING (SyncWorker_1) [custom_components.apsystems_ecur] Using cached data from last successful communication from ECU. Invalid data error: [Errno 113] Host is unreachable
2023-05-11 23:17:27.463 WARNING (SyncWorker_7) [custom_components.apsystems_ecur] Using cached data from last successful communication from ECU. Invalid data error: [Errno 113] Host is unreachable
2023-05-11 23:22:30.513 WARNING (SyncWorker_8) [custom_components.apsystems_ecur] Using cached data from last successful communication from ECU. Invalid data error: [Errno 113] Host is unreachable
2023-05-11 23:27:33.463 WARNING (SyncWorker_7) [custom_components.apsystems_ecur] Using cached data from last successful communication from ECU. Invalid data error: [Errno 113] Host is unreachable
2023-05-11 23:27:33.465 WARNING (SyncWorker_7) [custom_components.apsystems_ecur] Communication with the ECU failed after 5 repeated attempts.
2023-05-11 23:27:33.466 WARNING (SyncWorker_7) [custom_components.apsystems_ecur] Try manually power cycling the ECU. Querying is stopped automatically, turn switch back on after restart of ECU.

The first thing I did was ping the ECU-R to see that it was still reachable… and it was.
afbeelding

Also I saw that the ECU Inverters were offline and the ECU Query switch was turned off.
afbeelding

After the ECU Query was enabled again, the issue was resolved.
afbeelding

I noticed that almost every night the ECU “lost” its connection… this night too
Maybe caused by a firmware update… I dont know.
The firmware version now is 1.2.24B


afbeelding

The use of ping is only to determine if a node is reachable using icmp packages. It says nothing about the connection for the ultimate desired functionality which usually uses a different protocol.

I would advise switching the ECU Query Device switch off and on via an automation when the inverters have gone off-line. You can also use the sunrise/sunset to toggle the ECU query Device switch. This way you avoid maintenance around 02:43