From 8b6dae57bb0babff15a5262db0374b2c2e46dbb5 Mon Sep 17 00:00:00 2001 From: IsaacInsoll <30609296+IsaacInsoll@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:51:53 +1000 Subject: [PATCH] Support Goodwe Power Meter (Issue #92) The Power Meter is like a HomeKit in that it exposes grid power in and out, but unlike a HomeKit it doesn't have a serial number. Without these lines the data doesn't get collected property. I've been running these lines 'hacked in' for the last 10 months. --- custom_components/sems/sensor.py | 6 ++++++ 1 file changed, 6 insertions(+) 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"]