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

Integration broken in Home Assistant 2023.5.0 #76

Open
Patrick762 opened this issue May 3, 2023 · 25 comments
Open

Integration broken in Home Assistant 2023.5.0 #76

Patrick762 opened this issue May 3, 2023 · 25 comments

Comments

@Patrick762
Copy link

Patrick762 commented May 3, 2023

I got the following error in the latest Home Assistant Release:

Error setting up entry for ecoflow

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/ecoflow/__init__.py", line 429, in async_setup_entry
    hass.config_entries.async_setup_platforms(entry, _PLATFORMS)
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

It seems like it can be fixed by changing the line from

hass.config_entries.async_setup_platforms(entry, _PLATFORMS)

to

await hass.config_entries.async_forward_entry_setups(entry, _PLATFORMS)
@Patrick762
Copy link
Author

Tested it on my Home Assistant with Ecoflow River Max

@JasSmiths
Copy link

Confirmed the same issue here on 2023.5.0

@vwt12eh8 can you merge @Patrick762 fix?

@GeorgWolter
Copy link

Same issue on my Home Assistant Yellow with the DELTA Pro.

@HHoppenstock
Copy link

@Patrick762 your fix seems to work with the latest alpha version.
Can you please try a fix for the latest stable version?
I updated to the latest alpha and changed the specific line and it worked. But 6 Entities are missing for my delta pro.

@Patrick762
Copy link
Author

Patrick762 commented May 4, 2023

@HHoppenstock Can you try again? There was a method missing for the EcoFlowExtraDevice

I'll try to prepare a PR for the latest stable version now

@HHoppenstock
Copy link

HHoppenstock commented May 4, 2023

@Patrick762 Now all entities are gone:
image

after i inserted your fix:
image

@Patrick762
Copy link
Author

Can you tell me if there's any error in your logs for the integration?

@HHoppenstock
Copy link

@Patrick762 Dieser Fehler wurde von einer benutzerdefinierten Integration verursacht

Logger: homeassistant
Source: custom_components/ecoflow/init.py:98
Integration: Ecoflow (documentation, issues)
First occurred: 14:18:14 (1 occurrences)
Last logged: 14:18:14

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/config/custom_components/ecoflow/init.py", line 422, in _entry_updated
device = EcoFlowMainDevice(hass, entry, serial)
File "/config/custom_components/ecoflow/init.py", line 98, in init
self._tcp = RxTcpAutoConnection(data[CONF_HOST], ef.PORT)
TypeError: string indices must be integers

@HHoppenstock
Copy link

HHoppenstock commented May 4, 2023

That's my updated init.py which causes the error above
__init__py.txt

@lwsrbrts
Copy link

lwsrbrts commented May 4, 2023

I altered these lines in the stable version on my HA instance and it seems to work as expected:

image

@Patrick762
Copy link
Author

I think the main branch should be updated first then.
The alpha version seems to have some other bugs, if I have some spare time I'll try to find out what's happening.

@HHoppenstock
Copy link

@Patrick762 @lwsrbrts thanks for your great work and assistance. It's running fine now.

@dltccf
Copy link

dltccf commented May 10, 2023

This appears to have fixed the issue for me also. Thanks.

@mweber89
Copy link

Have two River Max connected without issues for months.
Updated today to HASS 2023.5.2 and to the latest alpha3 -> 1 River Max did not appear at all and for the other one, all entities where N/A - tried to re-register without success.

@loopphoto
Copy link

I got the following error in the latest Home Assistant Release:

Error setting up entry for ecoflow

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/ecoflow/__init__.py", line 429, in async_setup_entry
    hass.config_entries.async_setup_platforms(entry, _PLATFORMS)
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

It seems like it can be fixed by changing the line from

hass.config_entries.async_setup_platforms(entry, _PLATFORMS)

to

await hass.config_entries.async_forward_entry_setups(entry, _PLATFORMS)

Thanks, this also worked for me on the stable version. River Pro

@SFoskett
Copy link

This fix works for my Delta Pro. Would love to see the PR accepted into the stable branch since it breaks "normal" users experience.

@Ne0-Hack3r
Copy link

I altered these lines in the stable version on my HA instance and it seems to work as expected:
That worked for me as well...

Also: FYI - The integration is still working with DP firmware 1.0.1.49 (WiFi = 0.1.0)

rifo-m added a commit to rifo-m/fs1pg that referenced this issue May 16, 2023
Change line 24:
"hass.config_entries.async_setup_platforms(entry, _PLATFORMS)"
by
"await hass.config_entries.async_forward_entry_setups(entry, _PLATFORMS)"

References:
vwt12eh8/hassio-ecoflow#76
https://community.home-assistant.io/t/issues-with-nest-protect-after-installing-20230503-1/567537/6
@SportsterDriver
Copy link

SportsterDriver commented May 30, 2023

I have just updated to core 2023.5.4 from 2023.3.6 same issue - fix above resolved the issue.

/config/custom_components/ecoflow/init.py line 275

`Logger: homeassistant.config_entries
Source: custom_components/ecoflow/init.py:275
Integration: Ecoflow (documentation, issues)
First occurred: 14:00:47 (1 occurrences)
Last logged: 14:00:47
Error setting up entry DELTA Pro 040014 for ecoflow

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/ecoflow/init.py", line 275, in async_setup_entry
hass.config_entries.async_setup_platforms(entry, _PLATFORMS)
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'`

EcoFlow Delta Pro running firmware V1.0.1.49 / V0.1.0 (Wi-Fi)

@agilewebsolutions
Copy link

I ahve made the changes to the file mentioned above it gets rid of errors in log but there are no devices or entites. I have a delta pro and support say they have fixed api issue after firmware update. Any ideas?

@Ne0-Hack3r
Copy link

I ahve made the changes to the file mentioned above it gets rid of errors in log but there are no devices or entites. I have a delta pro and support say they have fixed api issue after firmware update. Any ideas?

I believe it is the latest WiFi update that closed the local TCP port. This integration does not use sanctioned access or a public API supported by Ecoflow. It is basically a private API written as a custom HACS integration for HA. If port 8055 is not open on your DP you will need to ask support to reopen that port in the next WiFi update (and roll back your WiFi firmware).

@agilewebsolutions
Copy link

they assure me its on the latest version which has it open.
V1.0.1.61
V3.0.2.21(Wi-Fi)

@Ne0-Hack3r
Copy link

they assure me its on the latest version which has it open. V1.0.1.61 V3.0.2.21(Wi-Fi)

@agilewebsolutions

Who is "they" and can you confirm the port is open (with nmap, or telnet, or a script that opens the port and receives data on it)? If you can verify it is closed you can go back to them and ask them to re-open it or revert your firmware. It may have gotten closed inadvertently or perhaps it was intentional. Either way I suspect the main support people don't know unless they talk to the person or team that actually made the change. Last time this happened it had nothing to do with the main system firmware (.61) it was the wifi update that closed the port (for certain units with a particular wifi chip).

@agilewebsolutions
Copy link

i decieded to start with a completely fresh install of HA and then started again. Once i changed the error line of code above it started working.

@Ne0-Hack3r
Copy link

It looks like WiFi firmware 3.0.2.25 has closed TCP port 8055. Anyone have any info on other versions or if EF will re-open the port again in subsequent firmware?

@kchiem
Copy link

kchiem commented Dec 21, 2023

With this change, I now get:

Error adding entities for domain binary_sensor with platform ecoflow
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 509, in async_add_entities
    await asyncio.gather(*tasks)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 754, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1023, in add_to_platform_finish
    await self.async_internal_added_to_hass()
  File "/usr/src/homeassistant/homeassistant/components/binary_sensor/__init__.py", line 198, in async_internal_added_to_hass
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Entity binary_sensor.delta_pro_123456_ac_custom_charge_speed cannot be added as the entity category is set to config

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

No branches or pull requests