A while ago I purchased an electrical standing desk from Flexispot.de. During assembly I found out that the display controls are connected via a RJ45 cable to the motor control box, and that the motor control box even has a second RJ45 input.
Challenge accepted! How cool would it be if I can control my desk by voice or if I can pull statistics to understand if I stand too less. (like with my manual IKEA desk that I have used twice in four years…)
The first step was to open the controller and to look at the board. So nice of LoctekMotion (the manufacturer) that they wrote down the pin output description on the board, saves me a lot of time. Now the fun starts.
I am more comfortable writing software than tinkering with electronics and cables. From the start I got help from the Dutch tweakers.net community, where they guided me through the process. I started by using a RJ45 to RS232) together with dupont cables to attach it to a CP2102 controller. This made it easy to start tinkering with it, without cutting cables or soldering.
Now I am able to read the incoming bits via RealTherm, thus it shows that my RX/TX are working.
Eventually I found out that many people already did research the same issues, which made figuring out the commands a lot easier! Since I am more fluent in Python than in C++ / Arduino, I started with a Raspberry Pi. This did allow me to quickly prototype and test all the features.
When I got this working, I moved over to ESPHome. This worked like a charm, after I figured out my RX and TX were reversed… The last part was to write a piece of custom code to decode the 7 digit segment output that is sent to the display.
Eventually this results in the following; where I am able to move the desk up and down (cover entity) and where I can set it to one of the four presets (switch entity). After a command has been executed it will pull the new height and show it on a sensor entity.
(The whole process and source code is described in more detail on iMicknl/LoctekMotion_IoT (github.com)
Hopefully this wil help (or inspire) other people to add their desk to Home Assistant!