hardbyte / ha-evnex

A cloud-polling Home Assistant component to integrate with an Evnex Charger
MIT License
12 stars 1 forks source link

Evnex integration won't load anymore in HA 2024.5 #34

Open xxxarmitagexxx opened 7 months ago

xxxarmitagexxx commented 7 months ago

Hi,

Recently the Evnex integration has been failing systematically to load in Home Assistant, currently 2024.5.1.

Looking at the logs, there is this error:

Traceback (most recent call last):
  File "/config/custom_components/evnex/__init__.py", line 164, in async_update_data
    ] = await evnex_client.get_org_charge_points(org.slug)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 88, in async_wrapped
    return await fn(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 47, in __call__
    do = self.iter(retry_state=retry_state)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/tenacity/__init__.py", line 314, in iter
    return fut.result()
           ^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/local/lib/python3.12/site-packages/tenacity/_asyncio.py", line 50, in __call__
    result = await fn(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/evnex/api.py", line 189, in get_org_charge_points
    return EvnexGetChargePointsResponse(**json_data).data.items
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 341, in __init__
    raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for EvnexGetChargePointsResponse
data -> items -> 0 -> connectors -> 0 -> meter -> frequency
  field required (type=value_error.missing)

Any clue what the issue could be, it was working fine in the past.

hardbyte commented 7 months ago

From the error message it looks like the data has changed but I suspect its the validation library I'm using (pydantic) is finally updated.

I'm trying out a new pre-release now on HA 2024.5 - it won't be compatible with every component though (due to the way Python dependencies are resolved across components). Perhaps let me know if that works, otherwise I might need to see the debug logs before that validation error. https://github.com/hardbyte/ha-evnex/releases/tag/v0.6.0a2

sultanoswing commented 6 months ago

Not sure if related, but the evnex HACS integration (0.6.0a2) hasn't been working for me for a couple of weeks now.

Just ran pip install evnex to make sure things were updated (HA 2024.5.5, Supervisor 2024.05.1). Rebooted, and getting errors in the log:

`Logger: homeassistant.setup Source: setup.py:271 First occurred: 09:01:04 (1 occurrences) Last logged: 09:01:04

Setup failed for custom integration 'evnex': Requirements for evnex not found: ['evnex>=0.4.1'].`

`Logger: homeassistant.util.package Source: util/package.py:123 First occurred: 09:00:59 (3 occurrences) Last logged: 09:01:04

Unable to install package evnex>=0.4.1: ERROR: Cannot install evnex==0.4.1 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts`

Not sure where / how to resolve these dependency errors?

sultanoswing commented 6 months ago

Follow up comment - is there any way to install this outside of HACS / through the terminal?

To try to resolve the dependency issue I uninstalled the Evnex integration. Now when trying to reinstall it through the GUI (+ Add Integration), I'm getting the error: "Config flow could not be loaded: 500 Internal Server Error Server got itself in trouble"

EDIT: finally managed to get the integration loaded - I think by uninstalling and reinstalling Pydantic from the terminal.

But now, despite entering my username (xxx@email.com + my evnex app account password), the devices fail to load thanks to this error: https://github.com/hardbyte/ha-evnex/issues/36

Still - closer than before a working integration!