Reverse Engineered Desk Controller Hex Codes
This is a list of the community sites that contained the reverse engineered hex codes used within this project, which started from a combination of the Maidesite project & Mahko_Mahko’s yaml version and then evolved when we found the other projects.
Pimp my Desk
https://gitlab.com/pimp-my-desk/desk-control/jiecang-reverse-engineering
Most of these hex codes did not match thise on a Maidesite Desk in the protocol section, but they are very close to matching just containing an extra 0x00. Although in the source section in that article the codes do match, so we can probably ignore that extra 0x00.
Rocka84
Mahko_Mahko original yaml only version
https://community.home-assistant.io/t/maidesite-standing-desk-with-esphome/602293/17
Maidesite project
https://github.com/shades66/Maidesite-standing-desk/tree/main
Comparison List
Function | Hex Code Used in DeskUp Pro | Pimp my Desk | Rocka84 | Mahko_Mahko | Maidesite Project |
---|---|---|---|---|---|
Nudge Up | 0xf1, 0xf1, 0x01, 0x00, 0x01, 0x7e | 0xF1, 0xF1, 0x01, 0x00, 0x00, 0x01, 0x7E | Match | Match | Match |
Nudge Down | 0xf1, 0xf1, 0x02, 0x00, 0x02, 0x7e | 0xF1, 0xF1, 0x02, 0x00, 0x00, 0x02, 0x7E | Match | Match | Match |
Press Preset 1 | 0xf1, 0xf1, 0x05, 0x00, 0x05, 0x7e | 0xF1, 0xF1, 0x05, 0x00, 0x00, 0x05, 0x7E | Match | Match | Match |
Press Preset 2 | 0xf1, 0xf1, 0x06, 0x00, 0x06, 0x7e | 0xF1, 0xF1, 0x06, 0x00, 0x00, 0x06, 0x7E | Match | Match | Match |
Press Preset 3 | 0xF1, 0xF1, 0x27, 0x00, 0x27, 0x7E | 0xF1, 0xF1, 0x27, 0x00, 0x00, 0x27, 0x7E | Match | Match | |
Press Preset 4 | 0xf1, 0xf1, 0x28, 0x00, 0x28, 0x7e | Match | Match | ||
Set Preset 1 | 0xf1, 0xf1, 0x03, 0x00, 0x03, 0x7e | 0xF1, 0xF1, 0x03, 0x00, 0x00, 0x03, 0x7e | Match | Match | |
Set Preset 2 | 0xf1, 0xf1, 0x04, 0x00, 0x04, 0x7e | 0xF1, 0xF1, 0x04, 0x00, 0x00, 0x04, 0x7E | Match | Match | |
Set Preset 3 | 0xf1, 0xf1, 0x25, 0x00, 0x25, 0x7e | 0xF1, 0xF1, 0x25, 0x00, 0x00, 0x25, 0x7E | Match | Match | |
Set Preset 4 | 0xf1, 0xf1, 0x26, 0x00, 0x26, 0x7e | Match | |||
Height Changed Message |
Message size = 9 bytes.
|
Match with a different calculation | Match | Match | |
Preset Height Message |
Message size = 8 bytes.
|
Match with a different calculation | Match | ||
Move Desk to position |
|
Match |
Match with a different calculation.
high_byte = ((int) height * 10) >> 8; low_byte = ((int) height * 10) & 0xFF; checksum = 0x1B + 2 + high_byte + low_byte; 0xF1, 0xF1, 0x1B, 0x02, high_byte, low_byte, checksum, 0x7E |
Match |
This one worked intermittently. int a= (int(x) & 0xff); int b= ((int(x) >> 8) & 0xff); int c= (a+b+0x80+0x02) & 0xff; return {0xf1, 0xf1, 0x80, 2, b,a,c,0x7e,0xf1, 0xf1, 0x1b, 0x00, 0x1b,0x7e}; |
Get Desk Height | 0xf1, 0xf1, 0x07, 0x00, 0x07, 0x7e | 0xF1, 0xF1, 0x07, 0x00, 0x00, 0x07, 0x7E | Match | ||
Stop Desk | 0xf1, 0xf1, 0x2B, 0x00, 0x2B, 0x7e | 0xF1, 0xF1, 0x2B, 0x00, 0x00, 0x2B, 0x7E | Match | Match |
Note: Blanks in the above table means that function was not implemented in that codebase.
Not used in DeskUp Pro
Pimp my desk
-
Fetch Height range
0xF1, 0xF1, 0x0C, 0x00, 0x00, 0x0C, 0x7E
-
Fetch High Low Limit
0xF1, 0xF1, 0x20, 0x00, 0x00, 0x20, 0x7E
-
Fetch Stand Time
0xF1, 0xF1, 0xA2, 0x00, 0x00, 0xA2, 0x7E
-
Fetch All Time
0xF1, 0xF1, 0xAA, 0x00, 0x00, 0xAA, 0x7E
-
Set specific height to memory preset
See 3 examples at bottom of this page: https://gitlab.com/pimp-my-desk/desk-control/jiecang-reverse-engineering
- 0xF1
- 0xF1
- 0xAD
- 0x03
- 0x01-0x03 & Height in mm in base 10 to base 16 in 2 Bytes
- VARIABLE
- 0x7E
- Patch
0xF1, 0xF1, 0xA0, 0x00, 0x00, 0xA0, 0x7E
Rocka84
-
Request Physical Limits
0xF1, 0xF1, 0x0C, 0x00, 0x0C, 0x7E
-
Request Limits
0xF1, 0xF1, 0x20, 0x00, 0x20, 0x7E
if ((message[2] & 1) == 0) { // low nibble 0 -> no max limit, use physical_max limit_max = physical_max; if (height_max != nullptr) height_max->publish_state(limit_max); if (number_height != nullptr) number_height->set_max_value(limit_max); } if ((message[2]>>4) == 0) { // high nibble 0 -> no min limit, use physical_min limit_min = physical_min; if (height_min != nullptr) height_min->publish_state(limit_min); if (number_height != nullptr) number_height->set_min_value(limit_min); }
-
Request Settings
0xF1, 0xF1, 0x07, 0x00, 0x07, 0x7E
physical_max = byte2float(message[2], message[3]);
physical_min = byte2float(message[4], message[5]);
Mahko_Mahko
-
Fetch Height Range
0xF1, 0xF1, 0x0C, 0x00, 0x0C, 0x7E
-
Fetch High Low Limit
0xF1, 0xF1, 0x20, 0x00, 0x20, 0x7E
-
Fetch Stand Time
0xF1, 0xF1, 0xA6, 0x01, 0xA7, 0x7E
-
Fetch All Time
0xF1, 0xF1, 0xAA, 0x00, 0xAA, 0x7E
-
Patch
0xF1, 0xF1, 0xA0, 0x00, 0xA0, 0x7E