TypeError: object of type 'NoneType' has no len()' during data publication (publicate_data thread crash)
Hi, I’ve encountered a crash in the publicate_data thread of the Hoymiles add-on. The integration fails when solar_data is None, causing the thread to crash with the following exception:
✅ Expected behavior Graceful handling of None values from solar_data, or at least a proper check before attempting len() on it.
🧪 Steps to reproduce Configure the add-on with valid credentials Wait for a period when PV production is 0 W (e.g., night or early morning) In such cases, the Hoymiles cloud seems to log data only once per hour During that time, the API might return incomplete or empty data, causing solar_data to be None The publicate_data thread then crashes when it tries to run len(hoymiles_h.solar_data)
💡 Suggested fix In hoymiles.py, line 265:
if len(hoymiles_h.solar_data):
could be changed to:
if hoymiles_h.solar_data and len(hoymiles_h.solar_data):
to avoid trying to take the length of None.
🖥️ System info Add-on version: 1.4.5
Home Assistant version: Core 2025.7.4 Supervisor 2025.07.3 Operating System 16.0 Hoymiles DTU: Pro S Region: EU
Let me know if you need more logs or config details (I’ve removed any sensitive data). Thanks for your work on this add-on!
please check 1.4.6