Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace current async_setup_platforms function with async_forward_ent… #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DannyNyops
Copy link

@DannyNyops DannyNyops commented May 10, 2023

Fixed an error 'ConfigEntries' object has no attribute 'async_setup_platforms', which was caused by an deprecated feature which will prevent the integration failing to start in Home Assistant 2023.5+

The function async_setup_platforms has been replaced.

Logger: homeassistant.config_entries
Source: custom_components/enphase_envoy/init.py:131
Integration: Enphase Envoy (DEV)
First occurred: 20:53:37 (1 occurrences)
Last logged: 20:53:37

Error setting up entry Envoy for enphase_envoy
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
result = await component.async_setup_entry(hass, self)
File "/config/custom_components/enphase_envoy/init.py", line 131, in async_setup_entry
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

Fixed an error 'ConfigEntries' object has no attribute 'async_setup_platforms', which was caused by an deprecated feature which will prevent the integration failing to start in Home Assistant 2023.5+
@sknight80
Copy link

How can I use this commit in my HomeAssistant?

@DannyNyops
Copy link
Author

DannyNyops commented May 12, 2023 via email

@sknight80
Copy link

Thank you! It worked for me.

@mpjongeling
Copy link

Thank you! Worked for me also.

@JWehkamp
Copy link

Thank you for this fix! Works like a charm!

@Bswanny
Copy link

Bswanny commented May 18, 2023

Thanks for the effort, works fine!

@frank3791
Copy link

Hi Danny, DannyNyops thanks! Works great!

Home Assistant 2023.5.4
Supervisor 2023.04.1
Operating System 10.1
Frontend 20230503.3 - latest

@bigmach23
Copy link

Works for me! Thank you!

@vautieri
Copy link

Is this going into the latest homeassistant anytime soon?

@gabrielprat
Copy link

You saved my day! thanks for the fix!

@pay4property
Copy link

Excellent, this worked well.

Just remember that if you already have a failed setup, delete the failed item, edit the init file as suggested then remember to RESTART home assistant then you can add the device successfully.

@acfnews
Copy link

acfnews commented Jul 31, 2023

Can anyone confirm if they are using HA versions 5.x or higher with this integration? I keep getting critical errors when using anything above 4.6.
I want to switch to 7.x , but this integration is getting more and more in the way.

@pay4property
Copy link

pay4property commented Jul 31, 2023 via email

@acfnews
Copy link

acfnews commented Aug 1, 2023

I'm using it fine with 7.3 once I modified the init as suggested.

On Mon, 31 Jul 2023, 20:57 R J, @.> wrote: Can anyone confirm if they are using HA versions 5.x or higher with this integration? I keep getting critical errors when using anything above 4.6. I want to switch to 7.x , but this integration is getting more and more in the way. — Reply to this email directly, view it on GitHub <#7 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AR52CCNPHAWJK5OY4CS75DTXTAE2LANCNFSM6AAAAAAX5ECLHI . You are receiving this because you commented.Message ID: @.>

Great, thanks for the confirmation.
I needed to use 'docker cp' command to copy the file out of the container, edit it, and copy it back into the container.

After that, the integration seems to work again.

I do keep some errors though:

2023-08-01 19:01:49.212 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.envoy_122244106295_today_s_energy_consumption (<class 'custom_components.enphase_envoy.sensor.EnvoyEntity'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total_increasing', 'total'; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

2023-08-01 19:01:49.215 WARNING (MainThread) [homeassistant.components.sensor] Entity sensor.envoy_122244106295_last_seven_days_energy_consumption (<class 'custom_components.enphase_envoy.sensor.EnvoyEntity'>) is using state class 'measurement' which is impossible considering device class ('energy') it is using; expected None or one of 'total_increasing', 'total'; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

@ryandjones
Copy link

For what it's worth, installing HACS, then this custom repo, followed by manually editing the init.py file described in the Commit is the FIRST TIME I've been able to get data into HA from my Enphase system.
Firmware: D7.3.517
23 inverters, 3 batteries.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet