Skip to content

Navigation Menu

Sign in
Appearance settings
Sign up
Appearance settings
Discussion options

Hi @mrbungle64
I took over the Homey app development. I already made the PR for V2 handling.
Now I got stuck because of unknown MQTT topics for Deebot T80. It seems, the new models are using a lot of new MQTT messages for device state.

So my question is: Do you have documentations from Ecovacs? Or is everthing on MQTT trial&error?
I ask because there is a lot of traffic via MQTT and it seems to be really hard to filter out the needed messages.

You must be logged in to vote

Replies: 3 comments · 1 reply

Comment options

Hi @mrbungle64 I took over the Homey app development. I already made the PR for V2 handling. Now I got stuck because of unknown MQTT topics for Deebot T80. It seems, the new models are using a lot of new MQTT messages for device state.

Hi @RonnyWinkler

So my question is: Do you have documentations from Ecovacs? Or is everthing on MQTT trial&error? I ask because there is a lot of traffic via MQTT and it seems to be really hard to filter out the needed messages.

Unfortunately, I do not have any documentation from Ecovacs.
You have to either do the reverse engineering yourself (if you own the model) or have someone else do it. And it became increasingly complex over time because Ecovacs released more and more models and the new features and options became more and more complex.

You must be logged in to vote
1 reply
@RonnyWinkler
Comment options

Hi @mrbungle64 (or Sascha :-))

I just reactivate this old entry to ask you about your experience with then new 2FA auth.
I added your logic (thanks for this and the new alpha version).
For me and most users it's working fine. But I have some users with a strange issue.

The users are adding theit device to Homey (that's the smart home bug I made the app for using your JS module).
They are authenticating with email+password. The app created a device ID (using your method to get a 32char key for a given ID.
The device is added, the device ID (=Homey/hub ID) is stored.
Then the device is initialized and a new login is done (same email, pw and deviceID).
But this time, the API returns a validation error (DeviceVerificationRequired: Please update to the latest version to continue. Code '1013').

The 2FA check is done before without errors. For most users this is working, for some not. The second login always end up with code 1013 error.

Do you have an idea what could cause this issue?

Regards
Ronny

Comment options

Found this entry:
home-assistant/core#177870 (comment)

But my app framework first addes a device including device data (user, pw, deviceId), then the device gets instanziated and a new login is done.
It's not possible to store the auth key and pass it to login() of deebot class, right?

You must be logged in to vote
0 replies
Comment options

Hi Sascha,
good news... all users were able to get theit login to work by changing their account password. No idea what Ecovacs is somehow cashing...

In the meantime I tried the Homeassistant solution and just want to give you thsi example. I don't know if this is too much as long we get solve the login issue by resetting the pw.

index.js:

  setCredentials(credentials) {
    if (!credentials) {
      throw new Error('No credentials provided');
    }
    let now = Date.now();
    if (credentials.tokenExpiresAt < now) {
      throw new Error('Credentials expired');
    }
    this.account = credentials.email;
    this.uid = credentials.uid;
    this.user_access_token = credentials.user_access_token ;
    this.tokenExpiresAt = credentials.tokenExpiresAt ;

    tools.envLogSuccess('user credentials set');
    /**
     * Fired after a successful (re-)login with fresh credentials.
     * @event EcovacsAPI#credentialsUpdated
     * @type {import('./library/typedefs').Credentials}
     */
    this.emit('credentialsUpdated', this.getCredentials());
    return 'ready';
  }

The using app:

			this.api = await ecovacsApi.getApi(this.getStoreValue('deviceId'));

			this.api.on('credentialsUpdated', (data) => { 
				this.log('credentialsUpdated'); 
                                // persist the login data on change
				this.setStoreValue('api', this.api);
			});

			try{
				this.log('setCredentials (token)');
				// get persistent login data
                                const api = this.getStoreValue('api');
                                // set needed token data
				this.api.setCredentials({
					"email": this.getStoreValue('email'),
					"uid": 	api.uid,
					"user_access_token": api.user_access_token,
					"tokenExpiresAt": api.tokenExpiresAt
				});
			}
			catch(error){
                                // fallback on orror (outdated token), login with user/pw
				thsis.log('credentials not valid, connect with user/password');
				await this.api.connect( this.getStoreValue('email'), ecovacsApi.getPasswordHash(this.getStoreValue('password')) );
			}

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.