vwt12eh8 / hassio-ecoflow

EcoFlow Portable Power Station Integration for Home Assistant
MIT License
255 stars 39 forks source link

No data using Home Assitant in a docker for Delta Mini #1

Closed franki29 closed 2 years ago

franki29 commented 2 years ago

Hi , i tried to get data from my Delta Mini using your great software. The set up seams to work and home assistant detects your integration and I could add my device into ha. But it looks like that no data are received from my device. IP-Address is OK, my phone app shows all data.

Any idea how to find why it is not working?

Thanks and best regards Frank

vwt12eh8 commented 2 years ago

Sorry, I'm not sure if this is a problem or not. I unfortunately don't have a DELTA mini, so I can't check how it works, so it's not implemented yet.

I will take some time to analyze it. Also, I need your help to check the operation after it is implemented, is that OK?

franki29 commented 2 years ago

Hi , ok. I captured the communication, maybe you find something there test.zip .

franki29 commented 2 years ago

Hi, one more thing: in the log i can see following error:

File "/config/custom_components/ecoflow/sensor.py", line 158, in native_value return sum(self.extra_state_attributes.values()) TypeError: unsupported operand type(s) for +: 'int' and 'NoneType'

vwt12eh8 commented 2 years ago

I don't think some of the entities work yet, but I've implemented the main functionality.

https://github.com/vwt12eh8/hassio-ecoflow/tree/delta-series

Please let me know if you find any problems such as wrong values. In that case, it would be helpful if you could share the results of "Download diagnostics".

franki29 commented 2 years ago

Hi, I test it but now I get some more errors: 2022-04-30 07:21:27 ERROR (MainThread) [custom_components.ecoflow] Unexpected error fetching DBEBZ5XD9080168/dc_in_mode data: index out of range Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 190, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data return await self.update_method() File "/config/custom_components/ecoflow/init.py", line 59, in __get_data return self.parser(await self.client.request(self.reqdata), self.product) File "/config/custom_components/ecoflow/ecoflow/local/receive.py", line 107, in dc_in_mode return d[1] IndexError: index out of range 2022-04-30 07:21:50 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-04-30 07:22:10 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data

franki29 commented 2 years ago

config_entry-ecoflow-b785c186e9abb7e15a57463d906d03fa.json(1).txt

vwt12eh8 commented 2 years ago

The position of the dc_in_mode function definition doesn't seem to match the repository code.

Is the code you downloaded up-to-date? Have you checked out a different branch (e.g. main) by mistake? Please check again.

franki29 commented 2 years ago

Hi, yes I made a mistake with the branch, sorry. I get now some more data, but still some errors:

2022-05-01 08:39:18 ERROR (MainThread) [custom_components.ecoflow] Unexpected error fetching DBEBZ5XD9080168/dc_in_mode data: index out of range Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 190, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 150, in _async_update_data return await self.update_method() File "/config/custom_components/ecoflow/init.py", line 59, in __get_data return self.parser(await self.client.request(self.reqdata), self.product) File "/config/custom_components/ecoflow/ecoflow/local/receive.py", line 130, in dc_in_mode return d[1] IndexError: index out of range 2022-05-01 08:40:48 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data

franki29 commented 2 years ago

config_entry-ecoflow-b726eab1e6e651646c8fca65f4318881.json.txt

franki29 commented 2 years ago

And I get a lot if time outs, is there a way to extend the time reading data from the device? 2022-05-01 08:54:35 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-05-01 08:55:14 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-05-01 08:57:17 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-05-01 08:59:05 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-05-01 08:59:44 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-05-01 09:00:04 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-05-01 09:01:36 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-05-01 09:02:14 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-05-01 09:02:35 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-05-01 09:03:27 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data 2022-05-01 09:04:16 ERROR (MainThread) [custom_components.ecoflow] Timeout fetching DBEBZ5XD9080168/pd data

vwt12eh8 commented 2 years ago

The index out of range thing has just been fixed. It was caused by calling an API that only exists in RIVER.

I'm not sure about the timeout thing, since it doesn't happen here, but I think it's probably due to network instability. From the logs, it seems that requests are sometimes returned and sometimes not. The Home Assistant implementation outputs an error log only once until the next success, even if it times out continuously, so it seems that not all requests are failing. Please give me some time to figure out how to fix this.

franki29 commented 2 years ago

Hi, one more thing, beside the timeouts: I am missing the MTTP actual input. There is a DELTA Mini 080168 input, but it is showing 0Watt, even the Display shows the actual Watt input from my solar panel. Br. Frank

franki29 commented 2 years ago

Hi, me again, some information I could find out regarding the Watt in : Looking at the heartbeat packages that are maybe similar to the one you are parsing the watt in in in the 120byte large packages that begins with AA 02 6F. Byte 33 is the input from the solar panel and byte 30 seems to bet the actual % of the battery. I am using node red to filter out the data and the Ecoflow App to verify the values.

vwt12eh8 commented 2 years ago

Currently, we are developing a new version which is compatible with RIVER series (except mini) and DELTA series. It is not compatible with the main branch, but the new version should be able to use the DELTA series. The DELTA series was tested using DELTA Pro. https://github.com/vwt12eh8/hassio-ecoflow/tree/ver2-beta

This one is treated as early access, so please use it with understanding. Major things are implemented, but some minor entities are not yet implemented.

franki29 commented 2 years ago

Hi, thanks for your information. I tested the Beta Version but unfortunately the plugin does not start. First I had to install reactivex using pip3 install reactivex , but still no success as now I get a new Error :

called from .ecoflow.rxtcp import RxTcpAutoConnection ModuleNotFoundError: No module named 'custom_components.ecoflow.rxtcp'

Not sure what I have to install now to met the dependencies .

franki29 commented 2 years ago

Hi, me again. I installed home assistant into a new box and now everything is working fine.