Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Eufy Vacuum #16

Closed
mjcumming opened this issue Mar 30, 2019 · 15 comments
Closed

Eufy Vacuum #16

mjcumming opened this issue Mar 30, 2019 · 15 comments

Comments

@mjcumming
Copy link

Wondering what it would take to support the Eufy WiFi vacuum. The device is found when calling get_devices and it shows..

[{'address': '72.50.197.174', 'code': '', 'type': 'T2117', 'name': 'QueenVac', 'id': '62840462807d3a36feb7'}]

@mitchellrj
Copy link

mitchellrj commented Apr 6, 2019

There's a local TuyAPI on port 6668. Getting the local key is a pain, but can be done from your Android device.

I've been able to get the status of the device and trigger cleaning via the API.

@mitchellrj
Copy link

mitchellrj commented Apr 6, 2019

e.g.

{ devId: 'my_dev_id',
  dps:
   { '1': true,
     '2': false,
     '3': 'forward',
     '5': 'Nosweep',
     '15': 'Charging',
     '101': false,
     '102': 'No_suction',
     '103': false,
     '104': 60,
     '106': 'no_error' } }

Key/Values for status / commands:

  • 1 = unknown, bool
  • 2 = play/pause, bool
  • 3 = direction, string, one of:
    • left
    • right
    • forward
    • backward
  • 5 = work mode, one of:
    • Nosweep
    • auto
    • SmallRoom
    • Edge
    • Spot
  • 15 = work status, string, one of:
    • Charging
    • standby
    • Sleeping
    • Recharge
  • 101 = go home, bool, true = going home
  • 102 = clean speed, string, one of:
    • No_suction
    • Standard
    • Boost_IQ
    • Max
  • 103 = find robot status, bool, true = on
  • 104 = battery level, int 0-100
  • 106 = error code, string, one of:
    • no_error
    • Wheel_stuck
    • R_brush_stuck
    • Crash_bar_stuck
    • sensor_dirty
    • N_enough_pow
    • Stuck_5_min
    • Fan_stuck
    • S_brush_stuck

@mitchellrj
Copy link

There's a decent Python TuyAPI library: clach04/python-tuya, but this is very different to the protobuf used by this library. I suggest any TuyAPI implementation be done as part of a separate library.

@mitchellrj
Copy link

mitchellrj commented Apr 6, 2019

Sample code for the Node-based tuyapi library:

const TuyAPI = require('tuyapi');
const device = new TuyAPI({id: 'MY DEVICE ID',key: 'MY SECRET KEY',ip:'VACUUM LAN IP'});
let stateHasChanged = false;

device.on('connected', () => {console.log('Connected to device!');});
device.on('disconnected', () => {console.log('Disconnected from device.');});
device.on('error', error => {console.log('Error!', error);});
device.on('data', data => {
    console.log('Data from device:', data);
    console.log(`Boolean status of default property: ${data.dps['1']}.`);
    // Set default property to opposite
    if (!stateHasChanged){
        device.set({set: !(data.dps['1'])});
        stateHasChanged = true;
    }
});

device.connect();

// start cleaning
device.set({multiple:true,data:{'5':'auto'}}).then(() => console.log('device was changed')));

@mjcumming
Copy link
Author

@mitchellrj thank you the link and notes!

@jymbob
Copy link

jymbob commented Apr 12, 2019

There's a local TuyAPI on port 6668. Getting the local key is a pain, but can be done from your Android device.

I've been able to get the status of the device and trigger cleaning via the API.

Can you give any more hints than "it's a pain"? Does it involve pairing the vac with the Tuya app, or can it be done from within the Eufy ecosystem?

@mitchellrj
Copy link

mitchellrj commented Apr 12, 2019 via email

@mitchellrj
Copy link

I've got a basic Python library and demo program working now: https://github.com/mitchellrj/eufy_robovac

I'll be working on fleshing this out more over the next few weeks.

@mjcumming
Copy link
Author

I've got a basic Python library and demo program working now: https://github.com/mitchellrj/eufy_robovac
I'll be working on fleshing this out more over the next few weeks.

looks great - just need a way to find the local key from iOS.....

@mitchellrj
Copy link

More detailed steps on using logcat:

  1. Close the app on your mobile device
  2. Connect the device to your laptop and enable USB debugging
  3. Run adb logcat -e 'tuya.m.my.group.device.list' (assumes you have already installed the Android debug tools)
  4. Launch the Eufy Home app
  5. The output lines contain JSON, you're looking for the values of localKey (16 character hex string) and devId (20 character hex string).

@Charly-Man
Copy link

@mitchellrj

unfortunately i can't find the localkey.
I installed BlueStacks as an emulator on my MAC, but I don't know how I can read the localkey from the installed EUFYHOME app via a terminal emulator.
Can you help?

Translated with Google translater, come from Germany

@aboyher
Copy link

aboyher commented Jun 4, 2020

More detailed steps on using logcat:

  1. Close the app on your mobile device
  2. Connect the device to your laptop and enable USB debugging
  3. Run adb logcat -e 'tuya.m.my.group.device.list' (assumes you have already installed the Android debug tools)
  4. Launch the Eufy Home app
  5. The output lines contain JSON, you're looking for the values of localKey (16 character hex string) and devId (20 character hex string).

Could the 'tuya.m.my.group.device.list' part have changed? I'm getting no output from adb using this, but i can see 'tuya' and 'eufy' get a lot of traffic. Also, not seeing any localkey or devid.

@dohlin
Copy link

dohlin commented Jun 5, 2020

@aboyher you need to use Eufy app version 2.3.2. Something has changed with newer versions of the app.

@lemon8haasi
Copy link

Hello, could someone help me to get the local key and dev ID of my Eufy G10 Hybrid.
What I've done so far - as no android device available.
Bluestacks installed and enabled Android Debug Bridge.
Installed Eufy Home 2.3.2 in Bluestacks
Installed Logcat in Bluestacks
If I start Logcat and start Eufy to clean I'm stiffing some messages but nothing looks like a 16 character or 20 character hex string....

@jasonkarns
Copy link

Is it known which of the device id and/or local key are affected by email/password changes? I would guess that device ID does not change when creds change, but that local key does... but I'm just guessing. Does anyone already know and can confirm one way or the other?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants