From 09a0ace6713e0f940a93d0a45088d9b35371c887 Mon Sep 17 00:00:00 2001 From: tronikos Date: Mon, 18 Dec 2023 22:49:18 -0800 Subject: [PATCH] Fix opower for AEP utilities (#106010) --- homeassistant/components/opower/coordinator.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/opower/coordinator.py b/homeassistant/components/opower/coordinator.py index 239f23e7523..a474255e34d 100644 --- a/homeassistant/components/opower/coordinator.py +++ b/homeassistant/components/opower/coordinator.py @@ -93,7 +93,9 @@ class OpowerCoordinator(DataUpdateCoordinator[dict[str, Forecast]]): ( self.api.utility.subdomain(), account.meter_type.name.lower(), - account.utility_account_id, + # Some utilities like AEP have "-" in their account id. + # Replace it with "_" to avoid "Invalid statistic_id" + account.utility_account_id.replace("-", "_"), ) ) cost_statistic_id = f"{DOMAIN}:{id_prefix}_energy_cost"