berezhinskiy / ecoflow_exporter

Prometheus exporter for EcoFlow portable power stations
GNU General Public License v3.0
259 stars 45 forks source link

Login information failing #26

Closed jackjonez666 closed 1 year ago

jackjonez666 commented 1 year ago

It seems something changed within the Ecoflow web architecture (needed to relogin with the phone etc) and since some hours, the tool is failing (wrong username/password).

bgpntx commented 1 year ago

Same for my R2M station.

vbash commented 1 year ago

I can confirm the issue. The process that was up for > 30 days cannot receive messages from MQTT

ERROR Failed to connect to MQTT: bad username or password

berezhinskiy commented 1 year ago

I am in the same situation. Ecoflow has made some changes. I must once again immerse myself in examining API calls with greater depth and detail 🤦🏻‍♂️ I will review it when I have sufficient time available.

joejeff123 commented 1 year ago

I experience the same issue. I wonder what they changed as the oauth 2.0 still is successful.

joejeff123 commented 1 year ago

You can get it back working by adding the following client id to MQTT:

ANDROID_UUID.randomUUID().toString().toUpperCase(Locale.ROOT)_userId

vbash commented 1 year ago

You can get it back working by adding the following client id to MQTT:

ANDROID_UUID.randomUUID().toString().toUpperCase(Locale.ROOT)_userId

it's either not working or I'm trying in the wrong place.

self.client = mqtt.Client(client_id=str(uuid.uuid4()).upper()) #this leads to the same results

Have you checked the solution on your own?

berezhinskiy commented 1 year ago

You can get it back working by adding the following client id to MQTT:

ANDROID_UUID.randomUUID().toString().toUpperCase(Locale.ROOT)_userId

Unfortunately, It does not work for me as well. I tried to add my user ID:

2023-03-15 18:28:43,804 INFO    Connecting to MQTT Broker mqtt.ecoflow.com:8883 using client id 19858457-7D10-491E-BBB4-00F8E5F500BE_XXXXXXXXXXXXXXXXXXX
2023-03-15 18:28:44,574 ERROR   Failed to connect to MQTT: bad username or password
vbash commented 1 year ago

The most interesting thing is that the mobile app on iOS is still working even though it wasn't updated at any recent time.

jackjonez666 commented 1 year ago

Here is one package doing a similar connection, which seems to have been fixed:

https://github.com/mmiller7/ecoflow-withoutflow/commit/3c81886e2a311c7ff076ccbee1829e36759d0c9d

vbash commented 1 year ago

OK. It works when generated this way: clientid ="ANDROID" + str(uuid.uuid4()).upper() + "_" + self.user_id log.info(f"Connecting to MQTT Broker with client_id: {client_id}") self.client = mqtt.Client(client_id=client_id)

davemedley commented 1 year ago

I can confirm the above works for me. Commenting out line 97 and replacing it with the above. Two caveats though. Need to add the uuid package. Also, the 'user_id' is in fact the value from the bearer token stage, on line 44. So I added the user_id to the EcoflowAuthentication & EcoflowMQTT classes. I'd fork the code but my version is a little bastardised to take values from the Smart Home Panel as well as my Delta Pro. In all honesty I should just run the same container with two configs for that lol

berezhinskiy commented 1 year ago

Thanks, I'll implement the fix later today.

vbash commented 1 year ago

I can confirm the above works for me. Commenting out line 97 and replacing it with the above. Two caveats though. Need to add the uuid package. Also, the 'user_id' is in fact the value from the bearer token stage, on line 44. So I added the user_id to the EcoflowAuthentication & EcoflowMQTT classes. I'd fork the code but my version is a little bastardised to take values from the Smart Home Panel as well as my Delta Pro. In all honesty I should just run the same container with two configs for that lol

Here we go) I'm doing exactly the same for Smart Home Panel. I still didn't commit the code to my fork as I need to clean it up and refactor a bit.

davemedley commented 1 year ago

Thanks, I'll implement the fix later today.

Great work. Slava Ukraïni! 🇺🇦

vbash commented 1 year ago

🇺🇦

Heroyam Slava!

berezhinskiy commented 1 year ago

Thanks for this! The new release is ready.

berezhinskiy commented 1 year ago

Oops, it seems that I have created a new bug (

berezhinskiy commented 1 year ago

https://github.com/berezhinskiy/ecoflow_exporter/issues/28

berezhinskiy commented 1 year ago

Finally, it works. Thanks again.