britkat1980 / ha-addons

11 stars 5 forks source link

Home Assistant Crashes When GivTCP Add-on Starts #29

Open sOckhamSter opened 1 month ago

sOckhamSter commented 1 month ago

I'm struggling to get GivTCP 3 working on my fairly standard setup:

I've tried the latest beta (3.0.4) and dev (3.0.23) and both have the same issue. The problem has been there for all versions since the /23 fix was applied.

The problem:

This is on a clean installation of Home Assistant. I've tried flashing it from scratch a couple of times just to be certain.

Here's the startup log for the beta:

2024-10-08 14:40:35,432 - startup - [INFO] - ==================== STARTING GivTCP==========================
2024-10-08 14:40:35,493 - startup - [INFO] - Network Found: 192.168.0.1/23
2024-10-08 14:40:37,507 - startup - [INFO] - Searching for Inverters
2024-10-08 14:40:37,508 - startup - [INFO] - Scanning network for GivEnergy Devices...
2024-10-08 14:40:42,659 - startup - [INFO] - INV- Scanning network (1):192.168.0.1/23
2024-10-08 14:41:06,401 - client - [INFO] - Connection established to 192.168.1.62:8899
2024-10-08 14:41:06,404 - client - [INFO] - Detecting plant
2024-10-08 14:41:07,653 - client - [INFO] - Plant Detected
2024-10-08 14:41:10,414 - startup - [INFO] - Inverter CE2122G257 which is a Gen1 - Ac with 1 batteries has been found at: 192.168.1.62
2024-10-08 14:41:10,423 - client - [INFO] - Connection established to 192.168.1.81:8899
2024-10-08 14:41:10,424 - client - [INFO] - Detecting plant

Here's the startup log for the latest dev version:

2024-10-08 14:50:17,361 - startup - [INFO] - ==================== STARTING GivTCP==========================
2024-10-08 14:50:17,427 - startup - [INFO] - Network Found: 192.168.0.1/23
2024-10-08 14:50:19,436 - startup - [INFO] - Searching for Inverters
2024-10-08 14:50:19,437 - startup - [INFO] - Scanning network for GivEnergy Devices...
2024-10-08 14:50:24,518 - startup - [INFO] - GivEVC 11288853545979 found at: 192.168.1.187
2024-10-08 14:50:24,518 - startup - [INFO] - INV- Scanning network (1):192.168.0.1/23

But... and this is where it's getting really confusing - sometimes the beta/dev versions will actually get further and then just crash out stopping the container, but leaving HA all alone. Here's a boot-up log from that scenario:

2024-10-08 15:13:19,949 - Startup - startup     -  [INFO    ] - ==================== STARTING GivTCP==========================
2024-10-08 15:13:20,005 - Startup - startup     -  [INFO    ] - Network Found: 192.168.0.1/23
2024-10-08 15:13:22,023 - Startup - startup     -  [INFO    ] - Searching for Inverters
2024-10-08 15:13:22,024 - Startup - startup     -  [INFO    ] - Scanning network for GivEnergy Devices...
2024-10-08 15:13:27,140 - Startup - startup     -  [INFO    ] - GivEVC 11288853545979 found at: 192.168.1.187
2024-10-08 15:13:27,141 - Startup - startup     -  [INFO    ] - INV- Scanning network (1):192.168.0.1/23
2024-10-08 15:13:51,206 - Startup - client      -  [INFO    ] - Connection established to 192.168.1.81:8899
2024-10-08 15:13:51,208 - Startup - client      -  [INFO    ] - Detecting plant
2024-10-08 15:13:52,370 - Startup - client      -  [INFO    ] - Plant Detected
2024-10-08 15:13:59,143 - Startup - startup     -  [INFO    ] - Inverter CH2315G086 which is a Gen1 - All_in_one with 4 batteries has been found at: 192.168.1.81
2024-10-08 15:13:59,151 - Startup - client      -  [INFO    ] - Connection established to 192.168.1.241:8899
2024-10-08 15:13:59,152 - Startup - client      -  [INFO    ] - Detecting plant
2024-10-08 15:14:00,322 - Startup - client      -  [INFO    ] - Plant Detected
2024-10-08 15:14:00,325 - Startup - startup     -  [INFO    ] - Inverter GW2314G032 which is a Gen1 - Gateway with 0 batteries has been found at: 192.168.1.241
2024-10-08 15:14:00,479 - Startup - startup     -  [INFO    ] - Inverter CH2315G086 not in settings file
2024-10-08 15:14:00,480 - Startup - startup     -  [INFO    ] - Adding Inverter CH2315G086 to slot 1
2024-10-08 15:14:00,480 - Startup - startup     -  [INFO    ] - Inverter GW2314G032 not in settings file
2024-10-08 15:14:00,481 - Startup - startup     -  [INFO    ] - Adding Inverter GW2314G032 to slot 2
2024-10-08 15:14:00,482 - Startup - startup     -  [INFO    ] - evcList: {2: ['192.168.1.187', '11288853545979']}
Traceback (most recent call last):
  File "/app/startup.py", line 457, in <module>
    setts["evc_ip_address"]=evcList[1][0]
                            ~~~~~~~^^^
KeyError: 1

I can't find a consistent reproducable single thing to debug. I think there may be multiple issues here but separating them out is tricky. I have Glances installed to keep an eye on the Pi hardware in case there's anything obvious there but nothing is jumping out. So far my testing seems to suggest that if I clear out all of the GivTCP files in the GivTCP folder, then the first run of etiher container after that causes HA to restart or crash. If I then start up the add-on again but leave the previously created GivTCP files in place then I get the KeyError.

Please let me know what diagnostics you'd like me to produce in order to try and get to the bottom of the issue, maybe we stick with one specific release (dev or beta). I would have asked on the Facebook chat but I'm finding that tricky to keep track of who is saying what to who on there so thought it would be more sensible to raise the issue on here instead.

m47een commented 3 weeks ago

I'm having the same issue did you get anywhere with this?