Pasted your question into Google and Gemini AI answered.......
The local Modbus connection between Home Assistant and a GivEnergy inverter (usually managed via an add-on like GivTCP) frequently drops and refuses to reconnect because the Wi-Fi/LAN serial dongle on the inverter gets overwhelmed, leaves TCP sockets hanging open, or suffers from local network dropouts. [1, 2]
Why This Happens
• Stale TCP Sockets: The Wi-Fi/Ethernet serial dongle (often an HF-A21 type unit) on GivEnergy inverters has limited processing power and a restricted connection table. If Home Assistant restarts or polls too aggressively, old TCP sockets stay open, resulting in "connection refused" or timeout errors because the inverter fails to release the previous session. [1, 2, 3]
• Polling Timeouts: Low-level Modbus requests timing out will cause GivTCP or local integrations to enter a crash/retry loop, locking up local communication until it is completely power-cycled. [1, 2]
How to Fix It
- Restart the Inverter Datalogger / Hard Power Cycle: Simply restarting the Home Assistant add-on often fails because the port is locked on the inverter side. Turn off the inverter's local power/battery isolator briefly, or use the GivEnergy Cloud Portal to remotely command the inverter/datalogger to reboot. [1, 2]
- Assign a Static IP: Ensure the GivEnergy inverter has a permanent static IP address reservation via the home router so that DHCP lease renewals do not break the local route. [1]
- Check Polling and Battery Counts: If using GivTCP, check the add-on configuration settings to ensure the number of attached batteries is accurately set (sometimes flipping an incorrect battery count or toggling firmware options forces a clean register re-scan). [1]