ryanbdclark / ripple_energy

Ripple energy Home Assistant Integration
MIT License
13 stars 4 forks source link

Unknown error occurred #12

Closed reedy closed 2 months ago

reedy commented 2 months ago

image

Using an api key straight from the members part of the website...

Just displaying "unknown error occurred" isn't helpful, but the logs aren't much more helpful either:


This error originated from a custom integration.

Logger: custom_components.ripple_energy.config_flow
Source: custom_components/ripple_energy/config_flow.py:59
integration: Ripple Energy
First occurred: 02:16:06 (8 occurrences)
Last logged: 02:22:16

Unexpected exception
Traceback (most recent call last):
  File "/config/custom_components/ripple_energy/config_flow.py", line 59, in async_step_user
    data = await ripple_api.request(assets=ASSETS)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pyrippleapi/api.py", line 89, in request
    raise RippleAuthenticationError("Invalid API Key")
pyrippleapi.exceptions.RippleAuthenticationError: Invalid API Key
reedy commented 2 months ago

Apparently worked fine when not done via the HA mobile app...

ryanbdclark commented 2 months ago

The new version 2024.8.2 now has a more verbose error if an invalid api key was entered.

image

The actual ripple API just returns {'error': 'Not authenticated'} if you put in an invalid API key and I'm assuming that this is the only time this error is returned however there is no documentation on this.

I have only ever seen the above error so not sure if the above can also be caused by something else. If the error returned from the API is not the above then the error message displayed will still be unknown error occurred. If this happens I would really need the actual error response from ripple to improve this error message and see what the error is.