Open sydney2711 opened 5 months ago
Exactly the same issue here. Was fine on 2024.5 versions.
I expect the root cause of it failing in 2024.6.0 are the HA warnings associated with blocking calls inside the event loop such as:
with open(os.open(file, os.O_CREAT | os.O_WRONLY, 0o600), "w") as spf:
Happy to test if you would like me to.
Somewhat novice, but does this pull request mean that we don’t have to individually do anything - it just fixes at some point?
@The-Organist - typically a pull request is asking for collaborators on the code (in this case hardbyte) to review and comment on the changes. Highly likely this will fix the problem when released.
Just updated core to 2024.6.2 I get basically the same error just the name of the python file that causes the problem has changed
####################
after EVNEX package update installed:
Logger: homeassistant.util.package Source: util/package.py:123 First occurred: 6:51:23 AM (3 occurrences) Last logged: 6:51:39 AM
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
If you stick with pydantic v1 (HA default) and downgrade to evnex v0.5.3 then you should be fine. Other option is to force install pydantic v2 and use v0.6 pre-releases but other integrations may have problems if they still use v1
then you should be fine.
Nope. Downgraded to 0.53 (by pulling the code then copying across to my HA's custom_components folder using WinSCP). The integration starts, asks for my Evnex login, which appears successful (my real name pops up), but it still fails to start. The logs now show:
`Logger: homeassistant.util.loop Source: util/loop.py:84 First occurred: 12:22:15 (24 occurrences) Last logged: 12:27:36
Detected blocking call to open inside the event loop by custom integration 'evnex' at custom_components/evnex/init.py, line 55: with open(file, "r") as spf: (offender: /config/custom_components/evnex/init.py, line 55: with open(file, "r") as spf:), please create a bug report at https://github.com/hardbyte/ha-evnex/issues Traceback (most recent call last): File "
You can include https://github.com/hardbyte/ha-evnex/commit/623b9da56c1317da93e1fdfc2317f3c202acb8c4 to get rid of blocking errors. But the warnings should not prevent the integration working.
Thanks - that update got rid of those errors, now just the previous:
Logger: custom_components.evnex Source: custom_components/evnex/init.py:186 integration: Evnex EV Charger (documentation, issues) First occurred: 13:42:30 (3 occurrences) Last logged: 13:43:00
Unhandled exception while updating evnex info Traceback (most recent call last): File "/config/custom_components/evnex/init.py", line 186, in async_update_data for connector_brief in charge_point_detail.connectors: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'connectors'
So - following the log errors, I commented out the following lines in init.py
# data["connector_brief"][
# (charge_point.id, connector_brief.connectorId)
# ] = connector_brief
# f"Getting evnex charge point override for '{charge_point.name}'"
# )
# charge_point_override: EvnexChargePointOverrideConfig = (
# await evnex_client.get_charge_point_override(
# charge_point_id=charge_point.id
# )
# )
# else:
# _LOGGER.debug(
# "Not getting charge point override as charge point is not ONLINE"
# )
# charge_point_override = None
# data["charge_point_brief"][charge_point.id] = charge_point
# data["charge_point_details"][charge_point.id] = charge_point_detail
# data["charge_point_override"][
# charge_point.id
# ] = charge_point_override
# data["charge_point_sessions"][
# charge_point.id
# ] = charge_point_sessions
....and it worked!. I'm not sure how or why the above lines are causing errors, but at least I've got some functionality back.
Pull a fresh HA image, the pydantic versions may have got messed up or make these changes https://github.com/hardbyte/ha-evnex/pull/38
Pull a fresh HA
Since I run HAOS in a VM, it's a little more involved....but yes, I may look at a fresh install. At least with HAOS you can restore from a backup file, which, along with HACS, is the major advantage of HAOS as far as I can tell.
Have made the changes as per #38 and all working now. I'm on a RPi 4: Core 2024.6.4 Supervisor 2024.06.2 Operating System 12.4 Frontend 20240610.1
Having the same error as the originally reported issue on 0.5.3. Integration configuration successfully authenticates to Evnex then retries indefinitely due to this unhandled exception with or without the patch #38. I can't test 0.6.x because a 500 Internal Server Error pops up instead of the Evnex username / password prompt.
I am running Home Assistant: 12.3 Home Assistant Core: 2024.7
Unhandled exception while updating evnex info Traceback (most recent call last): File "/config/custom_components/evnex/init.py", line 185, in async_update_data for connector_brief in charge_point_detail.connectors: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'connectors'
################
What version of Pydantic does your system have @zurnaik?
What version of Pydantic does your system have @zurnaik?
pydantic 1.10.17 pydantic_core 2.20.1
I have found a simple fix for those that are still using pydantic v1. Just replace these lines (L181-183) inside __init__.py with the below code then restart homeassistant.
charge_point_detail = EvnexChargePointDetail(
**api_v3_response.data.attributes
)
I'm not a python developer so wasn't sure if this code is compatible with the latest versions of pydantic so I didn't submit a PR. Hope this helps others out there like me
This worked a treat, thank you. Now have control back again. Hopefully this is not something I have to adjust every time an update downloads?
Hello
2024.5.5 and the charger was working fine 2024.6 and I get this error log:
This error originated from a custom integration.
############### Logger: custom_components.evnex Source: custom_components/evnex/init.py:185 integration: Evnex EV Charger (documentation, issues) First occurred: 09:53:27 (5 occurrences) Last logged: 09:54:40
Unhandled exception while updating evnex info Traceback (most recent call last): File "/config/custom_components/evnex/init.py", line 185, in async_update_data for connector_brief in charge_point_detail.connectors: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'dict' object has no attribute 'connectors'
#################
I hope there is a way to fix this issue because the charger is one of my most important device in home assistant.