View on GitHub

DeskUp Pro

Control standing desks from your smart home system (Home Assistant and others) with DeskUp Pro

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

Read GitHub page

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.
  • bytes[0] == 0xF2
  • bytes[1] == 0xF2
  • bytes[2] == 0x01
  • height data in mm: ((bytes[4] * 256) + bytes[5])
  • bytes[8] == 0x7E
Match with a different calculation Match Match
Preset Height Message Message size = 8 bytes.
  • bytes[0] == 0xF2
  • bytes[1] == 0xF2
  • Preset 1: bytes[2] == 0x25
  • Preset 2: bytes[2] == 0x26
  • Preset 3: bytes[2] == 0x27
  • Preset 4: bytes[2] == 0x28
  • height data in mm: ((bytes[4] * 256) + bytes[5])
  • bytes[7] == 0x7E
Match with a different calculation Match
Move Desk to position
  • byte[0] = 0xF1;
  • byte[1] = 0xF1;
  • byte[2] = 0x1B;
  • byte[3] = 0x02;
  • byte[4] = height_mm / 256
  • byte[5] = height_mm % 256
  • byte[6] = ((byte[2] + byte[3] + byte[4] + byte[5]) % 256); // checksum
  • byte[7] = 0x7E
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

Rocka84

  physical_max = byte2float(message[2], message[3]);
  physical_min = byte2float(message[4], message[5]);

Mahko_Mahko