vwt12eh8/hassio-ecoflow

Integration broken in Home Assistant 2023.5.0

Opened this issue ยท 25 comments

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)

Tested it on my Home Assistant with Ecoflow River Max

Confirmed the same issue here on 2023.5.0

@vwt12eh8 can you merge @Patrick762 fix?

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

@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.

@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

@Patrick762 Now all entities are gone:
image

after i inserted your fix:
image

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

@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

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

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

image

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.

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

dltccf commented

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

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.

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

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

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)

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)

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 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).

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

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).

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.

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?

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