vwt12eh8 / hassio-ecoflow

EcoFlow Portable Power Station Integration for Home Assistant
MIT License
240 stars 37 forks source link

Integration broken in Home Assistant 2023.5.0 #76

Open Patrick762 opened 1 year ago

Patrick762 commented 1 year ago

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 commented 1 year ago

Tested it on my Home Assistant with Ecoflow River Max

JasSmiths commented 1 year ago

Confirmed the same issue here on 2023.5.0

@vwt12eh8 can you merge @Patrick762 fix?

GeorgWolter commented 1 year ago

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

HHoppenstock commented 1 year ago

@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 commented 1 year ago

@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 commented 1 year ago

@Patrick762 Now all entities are gone:

image

after i inserted your fix:

image
Patrick762 commented 1 year ago

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

HHoppenstock commented 1 year ago

@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 commented 1 year ago

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

lwsrbrts commented 1 year ago

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

image

Patrick762 commented 1 year ago

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 commented 1 year ago

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

dltccf commented 1 year ago

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

mweber89 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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)

SportsterDriver commented 1 year ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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

Ne0-Hack3r commented 10 months ago

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 commented 10 months ago

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 commented 10 months ago

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 commented 9 months ago

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