This seemed to work last week but has stopped recently. Unclear if that changed based on the v0.0.12 release or the backend service changed their response or policy. Now not receiving updates and the integration loops "Retrying setup" in the Opower device page.
2023-07-02 17:45:38.541 ERROR (MainThread) [custom_components.opower.coordinator] Unexpected error fetching Opower data: 'opower:pge_gas_9131883775_energy_cost'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opower/coordinator.py", line 72, in _async_update_data
await self._insert_statistics([forecast.account for forecast in forecasts])
File "/config/custom_components/opower/coordinator.py", line 116, in _insert_statistics
cost_sum = cast(float, stats[cost_statistic_id][0]["sum"])
~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'opower:pge_gas_9131883775_energy_cost'
2023-07-02 17:45:38.544 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Pacific Gas and Electric Company (PG&E) (hinathan)' for opower integration not ready yet: 'opower:pge_gas_9131883775_energy_cost'; Retrying in background
2023-07-02 17:46:13.646 ERROR (MainThread) [custom_components.opower.coordinator] Unexpected error fetching Opower data: 'opower:pge_gas_9131883775_energy_cost'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opower/coordinator.py", line 72, in _async_update_data
await self._insert_statistics([forecast.account for forecast in forecasts])
File "/config/custom_components/opower/coordinator.py", line 116, in _insert_statistics
cost_sum = cast(float, stats[cost_statistic_id][0]["sum"])
~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'opower:pge_gas_9131883775_energy_cost'
2023-07-02 17:46:30.011 ERROR (MainThread) [custom_components.opower.coordinator] Unexpected error fetching Opower data: 'opower:pge_gas_9131883775_energy_cost'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opower/coordinator.py", line 72, in _async_update_data
await self._insert_statistics([forecast.account for forecast in forecasts])
File "/config/custom_components/opower/coordinator.py", line 116, in _insert_statistics
cost_sum = cast(float, stats[cost_statistic_id][0]["sum"])
~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'opower:pge_gas_9131883775_energy_cost'
2023-07-02 17:46:58.305 ERROR (MainThread) [custom_components.opower.coordinator] Unexpected error fetching Opower data: 'opower:pge_gas_9131883775_energy_cost'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opower/coordinator.py", line 72, in _async_update_data
await self._insert_statistics([forecast.account for forecast in forecasts])
File "/config/custom_components/opower/coordinator.py", line 116, in _insert_statistics
cost_sum = cast(float, stats[cost_statistic_id][0]["sum"])
~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'opower:pge_gas_9131883775_energy_cost'
2023-07-02 17:47:46.640 ERROR (MainThread) [custom_components.opower.coordinator] Unexpected error fetching Opower data: 'opower:pge_gas_9131883775_energy_cost'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opower/coordinator.py", line 72, in _async_update_data
await self._insert_statistics([forecast.account for forecast in forecasts])
File "/config/custom_components/opower/coordinator.py", line 116, in _insert_statistics
cost_sum = cast(float, stats[cost_statistic_id][0]["sum"])
~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'opower:pge_gas_9131883775_energy_cost'
2023-07-02 17:49:14.994 ERROR (MainThread) [custom_components.opower.coordinator] Unexpected error fetching Opower data: 'opower:pge_gas_9131883775_energy_cost'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opower/coordinator.py", line 72, in _async_update_data
await self._insert_statistics([forecast.account for forecast in forecasts])
File "/config/custom_components/opower/coordinator.py", line 116, in _insert_statistics
cost_sum = cast(float, stats[cost_statistic_id][0]["sum"])
~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'opower:pge_gas_9131883775_energy_cost'
2023-07-02 17:50:41.579 ERROR (MainThread) [custom_components.opower.coordinator] Unexpected error fetching Opower data: 'opower:pge_gas_9131883775_energy_cost'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opower/coordinator.py", line 72, in _async_update_data
await self._insert_statistics([forecast.account for forecast in forecasts])
File "/config/custom_components/opower/coordinator.py", line 116, in _insert_statistics
cost_sum = cast(float, stats[cost_statistic_id][0]["sum"])
~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'opower:pge_gas_9131883775_energy_cost'
2023-07-02 17:52:40.958 DEBUG (MainThread) [custom_components.opower.coordinator] Updating sensor data with: [Forecast(account=Account(customer=Customer(uuid='a1830b25-a429-11ea-92b6-4608317c57dd'), uuid='1a224281-a42b-11ea-92b6-4608317c57dd', utility_account_id='9133957322', meter_type=<MeterType.GAS: 'GAS'>), start_date=datetime.date(2023, 6, 9), end_date=datetime.date(2023, 7, 10), current_date=datetime.date(2023, 7, 2), unit_of_measure=<UnitOfMeasure.THERM: 'THERM'>, usage_to_date=6.0, cost_to_date=11.0, forecasted_usage=9.0, forecasted_cost=16.0, typical_usage=9.0, typical_cost=19.0), Forecast(account=Account(customer=Customer(uuid='a1830b25-a429-11ea-92b6-4608317c57dd'), uuid='1a22423f-a42b-11ea-92b6-4608317c57dd', utility_account_id='9137565048', meter_type=<MeterType.ELEC: 'ELEC'>), start_date=datetime.date(2023, 6, 9), end_date=datetime.date(2023, 7, 10), current_date=datetime.date(2023, 7, 2), unit_of_measure=<UnitOfMeasure.KWH: 'KWH'>, usage_to_date=572.0, cost_to_date=103.0, forecasted_usage=644.0, forecasted_cost=103.0, typical_usage=1148.0, typical_cost=124.0), Forecast(account=Account(customer=Customer(uuid='8fe2951e-591d-11ec-bf1b-0000170070eb'), uuid='06865eca-7018-11ec-bf1b-0000170070eb', utility_account_id='0967815358', meter_type=<MeterType.ELEC: 'ELEC'>), start_date=datetime.date(2023, 6, 9), end_date=datetime.date(2023, 7, 10), current_date=datetime.date(2023, 7, 2), unit_of_measure=<UnitOfMeasure.KWH: 'KWH'>, usage_to_date=-58.0, cost_to_date=-81.0, forecasted_usage=266.0, forecasted_cost=2.0, typical_usage=0.0, typical_cost=0.0), Forecast(account=Account(customer=Customer(uuid='8fe2951e-591d-11ec-bf1b-0000170070eb'), uuid='c30d6e35-591d-11ec-bf1b-0000170070eb', utility_account_id='9131883775', meter_type=<MeterType.GAS: 'GAS'>), start_date=datetime.date(2023, 6, 9), end_date=datetime.date(2023, 7, 10), current_date=datetime.date(2023, 7, 2), unit_of_measure=<UnitOfMeasure.THERM: 'THERM'>, usage_to_date=1.0, cost_to_date=2.0, forecasted_usage=3.0, forecasted_cost=4.0, typical_usage=28.0, typical_cost=65.0)]
2023-07-02 17:52:40.958 DEBUG (MainThread) [custom_components.opower.coordinator] Updating Statistics for opower:pge_gas_9133957322_energy_cost and opower:pge_gas_9133957322_energy_consumption
2023-07-02 17:52:41.291 DEBUG (MainThread) [custom_components.opower.coordinator] Updating Statistics for opower:pge_elec_9137565048_energy_cost and opower:pge_elec_9137565048_energy_consumption
2023-07-02 17:52:42.767 DEBUG (MainThread) [custom_components.opower.coordinator] Updating Statistics for opower:pge_elec_0967815358_energy_cost and opower:pge_elec_0967815358_energy_consumption
2023-07-02 17:52:44.488 DEBUG (MainThread) [custom_components.opower.coordinator] Updating Statistics for opower:pge_gas_9131883775_energy_cost and opower:pge_gas_9131883775_energy_consumption
2023-07-02 17:52:44.874 ERROR (MainThread) [custom_components.opower.coordinator] Unexpected error fetching Opower data: 'opower:pge_gas_9131883775_energy_cost'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opower/coordinator.py", line 72, in _async_update_data
await self._insert_statistics([forecast.account for forecast in forecasts])
File "/config/custom_components/opower/coordinator.py", line 116, in _insert_statistics
cost_sum = cast(float, stats[cost_statistic_id][0]["sum"])
~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'opower:pge_gas_9131883775_energy_cost'
2023-07-02 17:52:44.894 DEBUG (MainThread) [custom_components.opower.coordinator] Finished fetching Opower data in 7.751 seconds (success: False)
2023-07-02 17:52:44.894 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Pacific Gas and Electric Company (PG&E) (hinathan)' for opower integration not ready yet: 'opower:pge_gas_9131883775_energy_cost'; Retrying in background
2023-07-02 17:52:53.256 DEBUG (MainThread) [custom_components.opower.coordinator] Updating sensor data with: [Forecast(account=Account(customer=Customer(uuid='a1830b25-a429-11ea-92b6-4608317c57dd'), uuid='1a22423f-a42b-11ea-92b6-4608317c57dd', utility_account_id='9137565048', meter_type=<MeterType.ELEC: 'ELEC'>), start_date=datetime.date(2023, 6, 9), end_date=datetime.date(2023, 7, 10), current_date=datetime.date(2023, 7, 2), unit_of_measure=<UnitOfMeasure.KWH: 'KWH'>, usage_to_date=572.0, cost_to_date=103.0, forecasted_usage=644.0, forecasted_cost=103.0, typical_usage=1148.0, typical_cost=124.0), Forecast(account=Account(customer=Customer(uuid='a1830b25-a429-11ea-92b6-4608317c57dd'), uuid='1a224281-a42b-11ea-92b6-4608317c57dd', utility_account_id='9133957322', meter_type=<MeterType.GAS: 'GAS'>), start_date=datetime.date(2023, 6, 9), end_date=datetime.date(2023, 7, 10), current_date=datetime.date(2023, 7, 2), unit_of_measure=<UnitOfMeasure.THERM: 'THERM'>, usage_to_date=6.0, cost_to_date=11.0, forecasted_usage=9.0, forecasted_cost=16.0, typical_usage=9.0, typical_cost=19.0), Forecast(account=Account(customer=Customer(uuid='8fe2951e-591d-11ec-bf1b-0000170070eb'), uuid='06865eca-7018-11ec-bf1b-0000170070eb', utility_account_id='0967815358', meter_type=<MeterType.ELEC: 'ELEC'>), start_date=datetime.date(2023, 6, 9), end_date=datetime.date(2023, 7, 10), current_date=datetime.date(2023, 7, 2), unit_of_measure=<UnitOfMeasure.KWH: 'KWH'>, usage_to_date=-58.0, cost_to_date=-81.0, forecasted_usage=266.0, forecasted_cost=2.0, typical_usage=0.0, typical_cost=0.0), Forecast(account=Account(customer=Customer(uuid='8fe2951e-591d-11ec-bf1b-0000170070eb'), uuid='c30d6e35-591d-11ec-bf1b-0000170070eb', utility_account_id='9131883775', meter_type=<MeterType.GAS: 'GAS'>), start_date=datetime.date(2023, 6, 9), end_date=datetime.date(2023, 7, 10), current_date=datetime.date(2023, 7, 2), unit_of_measure=<UnitOfMeasure.THERM: 'THERM'>, usage_to_date=1.0, cost_to_date=2.0, forecasted_usage=3.0, forecasted_cost=4.0, typical_usage=28.0, typical_cost=65.0)]
2023-07-02 17:52:53.257 DEBUG (MainThread) [custom_components.opower.coordinator] Updating Statistics for opower:pge_elec_9137565048_energy_cost and opower:pge_elec_9137565048_energy_consumption
2023-07-02 17:52:54.884 DEBUG (MainThread) [custom_components.opower.coordinator] Updating Statistics for opower:pge_gas_9133957322_energy_cost and opower:pge_gas_9133957322_energy_consumption
2023-07-02 17:52:55.300 DEBUG (MainThread) [custom_components.opower.coordinator] Updating Statistics for opower:pge_elec_0967815358_energy_cost and opower:pge_elec_0967815358_energy_consumption
2023-07-02 17:52:57.177 DEBUG (MainThread) [custom_components.opower.coordinator] Updating Statistics for opower:pge_gas_9131883775_energy_cost and opower:pge_gas_9131883775_energy_consumption
2023-07-02 17:52:57.556 ERROR (MainThread) [custom_components.opower.coordinator] Unexpected error fetching Opower data: 'opower:pge_gas_9131883775_energy_cost'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.data = await self._async_update_data()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/opower/coordinator.py", line 72, in _async_update_data
await self._insert_statistics([forecast.account for forecast in forecasts])
File "/config/custom_components/opower/coordinator.py", line 116, in _insert_statistics
cost_sum = cast(float, stats[cost_statistic_id][0]["sum"])
~~~~~^^^^^^^^^^^^^^^^^^^
KeyError: 'opower:pge_gas_9131883775_energy_cost'
2023-07-02 17:52:57.558 DEBUG (MainThread) [custom_components.opower.coordinator] Finished fetching Opower data in 7.423 seconds (success: False)
This seemed to work last week but has stopped recently. Unclear if that changed based on the v0.0.12 release or the backend service changed their response or policy. Now not receiving updates and the integration loops "Retrying setup" in the Opower device page.