Could not identify a smart meter on your account with gateway access.
awboyd79 opened this issue · 4 comments
I am using version 0.0.8 and get the below error when trying to setup the integration.
I am not sure how to run the example (no python experience here) but I did verify the correct account number and meter is being returned in the logs. I read the previous issue that was similar and even tried 0.0.7 but it gave the same error.
0.0.8 Log
2021-09-07 17:59:56 DEBUG (MainThread) [custom_components.duke_energy_gateway] Setup Duke Energy API client
2021-09-07 17:59:56 DEBUG (MainThread) [custom_components.duke_energy_gateway] Accounts to check for gateway (1): 62XXXXXXX
2021-09-07 17:59:56 DEBUG (MainThread) [custom_components.duke_energy_gateway] Checking account 62XXXXXXX for gateway
2021-09-07 17:59:57 DEBUG (MainThread) [custom_components.duke_energy_gateway] Meters to check for gateway (2): ,33XXXXXXX
2021-09-07 17:59:57 DEBUG (MainThread) [custom_components.duke_energy_gateway] Checking meter for gateway [meter_type=ELECTRIC, is_certified_smart_meter=True]
2021-09-07 17:59:58 DEBUG (MainThread) [custom_components.duke_energy_gateway] Failed to find meter on account 62XXXXXXX: Request failed with unexpected error [https://cust-pilot-api.duke-energy.com/smartmeter/v1/auth]: 500, message='Internal Server Error', url=URL('https://cust-pilot-api.duke-energy.com/smartmeter/v1/auth')
2021-09-07 17:59:58 ERROR (MainThread) [custom_components.duke_energy_gateway] Could not identify a smart meter on your account with gateway access.
0.0.7 Log
2021-09-07 17:59:56 DEBUG (MainThread) [custom_components.duke_energy_gateway] Setup Duke Energy API client
2021-09-07 17:59:56 DEBUG (MainThread) [custom_components.duke_energy_gateway] Accounts to check for gateway (1): 62XXXXXXX
2021-09-07 17:59:56 DEBUG (MainThread) [custom_components.duke_energy_gateway] Checking account 62XXXXXXX for gateway
2021-09-07 17:59:57 DEBUG (MainThread) [custom_components.duke_energy_gateway] Meters to check for gateway (2): ,33XXXXXXX
2021-09-07 17:59:57 DEBUG (MainThread) [custom_components.duke_energy_gateway] Checking meter for gateway [meter_type=ELECTRIC, is_certified_smart_meter=True]
2021-09-07 17:59:58 DEBUG (MainThread) [custom_components.duke_energy_gateway] Failed to find meter on account 62XXXXXXX : Request failed with unexpected error [https://cust-pilot-api.duke-energy.com/smartmeter/v1/auth]: 500, message='Internal Server Error', url=URL('https://cust-pilot-api.duke-energy.com/smartmeter/v1/auth')
2021-09-07 17:59:58 ERROR (MainThread) [custom_components.duke_energy_gateway] Could not identify a smart meter on your account with gateway access.
Thanks for posting the logs! It looks like it is picking up 2 meters on your account, but one doesn't have an ID and that is causing the API call to fail. Is the meter you have there 33XXXXXXX the correct one? If so then I think I'll have to put in a fix to make sure to try other meters if one of the meters fails.
Yes - the 33XXXXXXX is the correct one.
I just pushed an updated version 0.0.9 that I hope solves this. I can't test it easily here on my account so let me know if it works or doesn't work for you.
Thanks for the quick fix, I just updated and confirmed it's working now.
2021-09-08 11:04:44 DEBUG (MainThread) [custom_components.duke_energy_gateway] Setup Duke Energy API client
2021-09-08 11:04:44 DEBUG (MainThread) [custom_components.duke_energy_gateway] Accounts to check for gateway (1): '62XXXXXXXX'
2021-09-08 11:04:44 DEBUG (MainThread) [custom_components.duke_energy_gateway] Checking account '62XXXXXXXX' for gateway
2021-09-08 11:04:45 DEBUG (MainThread) [custom_components.duke_energy_gateway] Meters to check for gateway (2): '','33XXXXXXX'
2021-09-08 11:04:45 DEBUG (MainThread) [custom_components.duke_energy_gateway] Checking meter '' for gateway [meter_type=ELECTRIC, is_certified_smart_meter=True]
2021-09-08 11:04:45 DEBUG (MainThread) [custom_components.duke_energy_gateway] Checking meter '33XXXXXXX' for gateway [meter_type=ELECTRIC, is_certified_smart_meter=True]
2021-09-08 11:04:47 DEBUG (MainThread) [custom_components.duke_energy_gateway] Found meter '33XXXXXXX' with gateway 'P204XXXXXX'
2021-09-08 11:04:47 DEBUG (MainThread) [custom_components.duke_energy_gateway] Finished fetching duke_energy_gateway data in 0.188 seconds (success: True)