mjmeli/ha-duke-energy-gateway

AFter v2021.11 update: Error setting up XXXXXX@EMAIL.com for duke_energy_gateway

eboettn opened this issue · 3 comments

Received the following error message after updating HA to v2021.11. Note, I scrubbed my e-mail address from the log.

This error originated from a custom integration.

Logger: homeassistant.config_entries
Source: custom_components/duke_energy_gateway/init.py:85
Integration: Duke Energy Gateway (documentation, issues)
First occurred: 12:23:22 PM (1 occurrences)
Last logged: 12:23:22 PM

Error setting up entry XXXXXX@EMAIL.com for duke_energy_gateway
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/pyduke_energy/client.py", line 213, in _async_request
resp.raise_for_status()
File "/usr/local/lib/python3.9/site-packages/aiohttp/client_reqrep.py", line 1000, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 400, message='Bad Request', url=URL('https://cust-api.duke-energy.com/gep/v2/auth/oauth2/token')

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/duke_energy_gateway/init.py", line 51, in async_setup_entry
selected_meter, selected_gateway = await find_meter_with_gateway(client)
File "/config/custom_components/duke_energy_gateway/init.py", line 85, in find_meter_with_gateway
account_list = await client.get_account_list()
File "/usr/local/lib/python3.9/site-packages/pyduke_energy/client.py", line 81, in get_account_list
headers = await self._get_oauth_headers()
File "/usr/local/lib/python3.9/site-packages/pyduke_energy/client.py", line 168, in _get_oauth_headers
await self._oauth_login()
File "/usr/local/lib/python3.9/site-packages/pyduke_energy/client.py", line 160, in _oauth_login
resp = await self._async_request("POST", CUST_API_BASE_URL, endpoint, headers=headers, data=FormData(request))
File "/usr/local/lib/python3.9/site-packages/pyduke_energy/client.py", line 219, in _async_request
raise RequestError(f"Request failed with unexpected error [{full_url}]: {ce}") from ce
pyduke_energy.errors.RequestError: Request failed with unexpected error [https://cust-api.duke-energy.com/gep/v2/auth/oauth2/token]: 400, message='Bad Request', url=URL('https://cust-api.duke-energy.com/gep/v2/auth/oauth2/token')

Duke Energy has been doing a system maintenance the last few days that's a total downtime. They say it should be back after the 5th. I'm keeping my eye out in case they've changed anything once its back up.

thanks! i'll keep an eye on it too. that must be it.

It's back up for me and the integration is still working as normal for me. Should be good now