diff --git a/custom_components/sems/sensor.py b/custom_components/sems/sensor.py index 924afe1..283abab 100644 --- a/custom_components/sems/sensor.py +++ b/custom_components/sems/sensor.py @@ -85,6 +85,12 @@ async def async_update_data(): powerflow = result["powerflow"] powerflow["sn"] = result["homKit"]["sn"] + + # Goodwe 'Power Meter' (not HomeKit) doesn't have a sn + # Let's put something in, otherwise we can't see the data. + if powerflow["sn"] is None: + powerflow["sn"] = "GW-HOMEKIT-NO-SERIAL" + #_LOGGER.debug("homeKit sn: %s", result["homKit"]["sn"]) # This seems more accurate than the Chart_sum powerflow["all_time_generation"] = result["kpi"]["total_power"]