Closed mjcumming closed 5 years ago
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.
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, bool2
= play/pause, bool3
= 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 home102
= clean speed, string, one of:
No_suction
Standard
Boost_IQ
Max
103
= find robot status, bool, true
= on104
= battery level, int 0-100106
= 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
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.
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')));
@mitchellrj thank you the link and notes!
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?
The Eufy app logs it out at various points, you can capture it from there with adb logcat. There may be a simpler way but that's the way I got it.
On Fri, 12 Apr 2019, 11:27 jymbob, notifications@github.com wrote:
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?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/google/python-lakeside/issues/16#issuecomment-482524463, or mute the thread https://github.com/notifications/unsubscribe-auth/AABD47W7XHYYGKK34ZTL443PQBP2NANCNFSM4HCPO6OA .
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.
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.....
More detailed steps on using logcat:
adb logcat -e 'tuya.m.my.group.device.list'
(assumes you have already installed the Android debug tools)localKey
(16 character hex string) and devId
(20 character hex string).@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
More detailed steps on using logcat:
- Close the app on your mobile device
- Connect the device to your laptop and enable USB debugging
- Run
adb logcat -e 'tuya.m.my.group.device.list'
(assumes you have already installed the Android debug tools)- Launch the Eufy Home app
- The output lines contain JSON, you're looking for the values of
localKey
(16 character hex string) anddevId
(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.
@aboyher you need to use Eufy app version 2.3.2. Something has changed with newer versions of the app.
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....
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?
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'}]