This project could void your warranty or cause safety risks. Proceed at your own risk!
I have already gathered some advice and tips from this thread and will share my approach with you. The desks in the thread unfortunately use a different controller and unfortunately I have not found a source on the internet that does this with a Desktronic desk.
Table of Contents
- General Information
- Physical Structure
- Reading UART-Messages
- Thoughts and problems
General Information
Chip
I use a d1mini chip. The pin assignment can be seen in this picture. Especially the Arduino pinout is important. (GPIO) With these numbers I can control the pins using Homeassistant.
Controllerbox
The Controllerbox I use has the pin assignment noted on the back. (see red marking)
So I created this table that shows the used pins with the ethernet-cable connected to the Controllerbox. (I looked at the 10-pole
Ethernet cable and saw which pins are not used) Those colors I use everywhere. (on the two adapters, the chip, …)
Sequence in power supply | G | TX | RX | Key2 | Key1 | G | B-C1 | SWD | 5V | DC
--------------------------------------------------------------------------------------------------------
Color | brown | black | white | free | red | purple | free | free | green | yellow
Touchpad
Thats the touchpad I am using. I think that there is nothing special. Unfortunately I don’t have a data sheet or something like this.
Physical Structure
At the moment I have a working bridge with the two adapters (Adapter1: 10-pole Ethernet cable
from touchpad to 8-pole Ethernet cable
, Adapter2: 8-pole Ethernet cable
to 10-pole Ethernet cable
from touchpad). So I can still manually raise and lower my table using the touchpad. I also managed to read out the RX
output. (I took the G
cable and the TX
cable of the 8-pole Ethernet cable
from Adapter1
and connected it with the corresponding pins of my d1mini).
I guess that it works like on the following image:
- TX → Chip; TX → Touchpanel
- RX → Controllerbox
- TX → Controllerbox
- RX → Touchpanel; RX → Chip
- … start again
Reading UART-Messages
This is the configuration I use to read out the uart-messages from the rx-pin. (rx cable from the Ethernet cable is connected to the rx-pole of the d1mini chip)
esphome:
name: esphome-web-755eb2
esp8266:
board: esp01_1m
# Enable logging
logger:
baud_rate: 0
# Enable Home Assistant API
api:
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
captive_portal:
uart:
- id: desk_uart
tx_pin: 1
rx_pin: 3
baud_rate: 5600
debug:
direction: BOTH
dummy_receiver: true
after:
bytes: 3
sequence:
- lambda: UARTDebug::log_binary(direction, bytes, ',');
# - lambda: UARTDebug::log_int(direction, bytes, ',');
When I press different buttons on the touchpad, I get different values, which I have recorded in this table.
baudrate | hexadecimal | binary(only the middle byte) | meaning |
---|---|---|---|
5600 |
0xFF 0xF0 0x14 |
… 0b11110000 … |
idle |
5600 |
0xFF 0xF4 0x14 |
… 0b11110100 … |
up |
5600 |
0xFF 0xF8 0x14 |
… 0b11111000 … |
down |
5600 |
0xFF 0xB1 0x14 |
… 0b10110001 … |
Preset 1 |
5600 |
0xFF 0x72 0x14 |
… 0b1110010 … |
Preset 3 |
5600 |
0xFF 0xD0 0x14 |
… 0b11010000 … |
M |
5600 |
0xFF 0x91 0x14 |
… 0b10010001 … |
M + Preset 1 |
5600 |
0xFF 0x52 0x14 |
… 0b1010010 … |
M + Preset 3 |
At this point I noted, that these value differ when using different baudrates. So I want to stick at
5600
at the moment.
Thoughts and problems
- I am not sure, in which order the bytes are sended. Somethimes the output has the same values, but they are in a different order.
- I don’t really know for what the
Key1
pin is used. For now I just don’t use it at all. - I don’t know how I should connect the
rx
andtx
cables to the pins. I just tested some variations and for now I stick with the described variation, where I get the uart-output. (rx
torx
-pin and also in the configurationrx-pin
is set to GPIO pin3
) - At the moment I am outputting 3 bytes. I think that at least this should be correct, because the output always repeats after 3 bytes.
- I saw in this thread that only the
tx
pin is used. However, this may be a special case for this Controllerbox I guess. - Like many other Controllerboxes this one does not have a specific
up / down
cable.
I would love the get some more advices or help for my problem. If I missed some necessary information, let me know that. Thank you!