Turn your LoctekMotion/FlexiSpot standing desk into a smart desk!

My control box has a second ethernet port available, thus it does not make sense to directly plug in with dupont connectors. I use RJ45 ethernet connector on one side, on the other side I use dupont cables directly to my ESP32.

I didn’t made myself explicit enough sorry
By directly i was meaning exactly what you are refering. Direct from the output of the cut ethernet cable
I was confused by the photos that show à white rj45 box.

So i will follow the same setup as you thanxs for the clarification.

I own a Fezibo brand standing desk. The control box does have the RJ45 but unclear if my box is the same as yours or similar. Would love some guidance as this project has been the goal since purchase :grin:

1 Like

/smacks forehead

Of course, that makes sense!

Thank you very much for this great tutorial! I replicated it with my Flexispot/Sanodesk Unit and it works like a charm!

@pb2731 Hi, which FlexiSpot / Sanodesk model do you have? I’m hoping to open up my EQ5 desk control box (CB38M2D(PB)-2) to see what board is inside

Hi, I am stuck with the configuration in ESPHome. The two files are in the ESPHome directory. I took the config from the example, but get all sorst of errors whes trying to install the the yaml file. This goes on for pages…

Can someone tell me what I am doing wrong?

In file included from src/main.cpp:118:
src/desk_height_sensor.h:74:56: error: stray '\302' in program
   <title>LoctekMotion_IoT/desk_height_sensor.h at main · iMicknl/LoctekMotion_IoT</title>
                                                        ^
src/desk_height_sensor.h:74:57: error: stray '\267' in program
   <title>LoctekMotion_IoT/desk_height_sensor.h at main · iMicknl/LoctekMotion_IoT</title>
                                                         ^
In file included from src/main.cpp:118:
src/desk_height_sensor.h:229:10: warning: missing terminating ' character
     <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="344620646" data-scoped-search-url="/iMicknl/LoctekMotion_IoT/search" data-owner-scoped-search-url="/users/iMicknl/search" data-unscoped-search-url="/search" data-turbo="false" action="/iMicknl/LoctekMotion_IoT/search" accept-charset="UTF-8" method="get">
          ^
src/desk_height_sensor.h:229:10: error: missing terminating ' character
     <!-- '"` --><!-- </textarea></xmp> --></option></form><form class="js-site-search-form" role="search" aria-label="Site" data-scope-type="Repository" data-scope-id="344620646" data-scoped-search-url="/iMicknl/LoctekMotion_IoT/search" data-owner-scoped-search-url="/users/iMicknl/search" data-unscoped-search-url="/search" data-turbo="false" action="/iMicknl/LoctekMotion_IoT/search" accept-charset="UTF-8" method="get">
          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/desk_height_sensor.h:286:75: error: stray '\342' in program
       <span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span>
                                                                           ^
src/desk_height_sensor.h:286:76: error: stray '\206' in program
       <span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span>
                                                                            ^
src/desk_height_sensor.h:286:77: error: stray '\265' in program
       <span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span>
                                                                             ^
src/desk_height_sensor.h:291:56: error: stray '\342' in program
       <span class="d-inline-block ml-1 v-align-middle">↵</span>
                                                        ^
src/desk_height_sensor.h:291:57: error: stray '\206' in program
       <span class="d-inline-block ml-1 v-align-middle">↵</span>
                                                         ^
src/desk_height_sensor.h:291:58: error: stray '\265' in program
       <span class="d-inline-block ml-1 v-align-middle">↵</span>
                                                          ^
src/desk_height_sensor.h:333:75: error: stray '\342' in program
       <span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span>
                                                                           ^
src/desk_height_sensor.h:333:76: error: stray '\206' in program
       <span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span>
                                                                            ^
src/desk_height_sensor.h:333:77: error: stray '\265' in program
       <span aria-hidden="true" class="d-inline-block ml-1 v-align-middle">↵</span>
                                                                             ^
src/desk_height_sensor.h:338:56: error: stray '\342' in program
       <span class="d-inline-block ml-1 v-align-middle">↵</span>
                                                        ^
src/desk_height_sensor.h:338:57: error: stray '\206' in program
       <span class="d-inline-block ml-1 v-align-middle">↵</span>
                                                         ^

hi, I have a desk from a different manufacturer, but the motor control box also has two RJ-45 ports. My question is - can I plug the DIY remote controller in the second RJ-45 slot or do I have to create a passthrough box like on the pictures in this thread - so that the original physical controller and the DIY one are on the same connection?

Hello, did you figure it out? I am thinking of using a cd4066be chip which acts like a relay switch. It can emulate a push button electronically by closing a circuit for low voltage appliances. If you found other solution, very interested with your feednack, I should be receiving the desk soon and will try this option :slight_smile:

Firstly, let me apologise as I think Im about to ask a stupid question having never used ESP 32 before.

What kit wiould I actually need to buy…Ive search for ESP32 to RJ45 and come up with this but then how do I power the ESP board…

How do I connect ESP 32 module to my computer? can it be done via ethernet…or does it all happen wireless/y?

Apologies again…mauybe I need to start from the beginning with ESP32

@tombom and @Gussir, did you guys went any further on this? Having the same challenge as in making the hcb107A-1 smart. Whats your progress?

I wasn’t able to use the chip so even though its a bit overkill, I used two relays to emulate the two switches of the desk. The relays are in parallel of the standard manual switches so I can either use my relays to trigger up and down movement or the manual switches :
image
I also have an Ultrasonic sensor and using a bit of automation I can asked the relay to turn off once I reached a certain height (sitted or standing). All of those position are then controled using a streamdeck

1 Like

Wow, thats a sophisticated way to solve that problem. A bit too much work for me for the moment, but hey, great work.

1 Like

Has anyone already got it to work with the Flexispot E7 Pro? The height of the desk is displayed correctly. Unfortunately, it cannot be moved and there is no other functionality either

I am looking for information on how to wire a Flexispot E8 but I can’t even get the controller code. Can someone give me a hand?

Has anyone tried to compile this lately? Won’t compile for me on 2024.09.1

Compiling .pioenvs/office-desk/efuse/esp32/esp_efuse_utility.o
In file included from src/main.cpp:117:
src/desk_height_sensor.h:19:18: error: 'byte' has not been declared
   int hex_to_int(byte s)
                  ^~~~
src/desk_height_sensor.h:70:19: error: 'byte' has not been declared
   bool is_decimal(byte b)
                   ^~~~
src/desk_height_sensor.h: In member function 'virtual void DeskHeightSensor::loop()':
src/desk_height_sensor.h:84:7: error: 'byte' was not declared in this scope
       byte incomingByte = read();
       ^~~~
src/desk_height_sensor.h:88:11: error: 'incomingByte' was not declared in this scope
       if (incomingByte == 0x9b)
           ^~~~~~~~~~~~
src/desk_height_sensor.h:98:24: error: 'incomingByte' was not declared in this scope
         msg_len = (int)incomingByte;
                        ^~~~~~~~~~~~
src/desk_height_sensor.h:104:20: error: 'incomingByte' was not declared in this scope
         msg_type = incomingByte;
                    ^~~~~~~~~~~~
src/desk_height_sensor.h:114:15: error: 'incomingByte' was not declared in this scope
           if (incomingByte == 0)
               ^~~~~~~~~~~~
Compiling .pioenvs/office-desk/efuse/src/esp_efuse_api.o
src/desk_height_sensor.h:148:36: error: 'incomingByte' was not declared in this scope
           int height3 = hex_to_int(incomingByte);
                                    ^~~~~~~~~~~~
src/desk_height_sensor.h:173:20: error: 'incomingByte' was not declared in this scope
       history[0] = incomingByte;
                    ^~~~~~~~~~~~
Compiling .pioenvs/office-desk/efuse/src/esp_efuse_fields.o
In file included from src/main.cpp:118:
src/desk_keypad.h: In member function 'virtual void DeskKeypad::loop()':
src/desk_keypad.h:31:7: error: 'byte' was not declared in this scope
       byte incomingByte = read();
       ^~~~
src/desk_keypad.h:34:11: error: 'incomingByte' was not declared in this scope
       if (incomingByte == 0x9b)
           ^~~~~~~~~~~~
Compiling .pioenvs/office-desk/efuse/src/esp_efuse_utility.o
src/desk_keypad.h:44:24: error: 'incomingByte' was not declared in this scope
         msg_len = (int)incomingByte;
                        ^~~~~~~~~~~~
Compiling .pioenvs/office-desk/efuse/src/esp_efuse_api_key_esp32.o
src/desk_keypad.h:50:20: error: 'incomingByte' was not declared in this scope
         msg_type = incomingByte;
                    ^~~~~~~~~~~~
src/desk_keypad.h:56:16: error: 'incomingByte' was not declared in this scope
         switch(incomingByte)
                ^~~~~~~~~~~~
src/desk_keypad.h:69:13: error: 'incomingByte' was not declared in this scope
         if (incomingByte == 0x9d && msg_type == 0x02 && msg_len == 6 && mReturnCommand && mReturnCommand != lastPublished)
             ^~~~~~~~~~~~
src/desk_keypad.h:78:22: error: 'incomingByte' was not declared in this scope
         history[0] = incomingByte;
                      ^~~~~~~~~~~~
/config/office-desk.yaml: In lambda function:
/config/office-desk.yaml:110:22: warning: 'void esphome::cover::Cover::open()' is deprecated: open() is deprecated, use make_call().set_command_open().perform() instead. [-Wdeprecated-declarations]
                 id(desk).open();
                      ^
In file included from src/esphome/core/controller.h:14,
                 from src/esphome/components/api/api_server.h:9,
                 from src/esphome/components/api/api_connection.h:6,
                 from src/esphome.h:3,
                 from src/main.cpp:3:
src/esphome/components/cover/cover.h:133:8: note: declared here
   void open();
        ^~~~
/config/office-desk.yaml:113:23: warning: 'void esphome::cover::Cover::close()' is deprecated: close() is deprecated, use make_call().set_command_close().perform() instead. [-Wdeprecated-declarations]
                 id(desk).close();
                       ^
In file included from src/esphome/core/controller.h:14,
                 from src/esphome/components/api/api_server.h:9,
                 from src/esphome/components/api/api_connection.h:6,
                 from src/esphome.h:3,
                 from src/main.cpp:3:
src/esphome/components/cover/cover.h:139:8: note: declared here
   void close();
        ^~~~~
/config/office-desk.yaml:131:22: warning: 'void esphome::cover::Cover::stop()' is deprecated: stop() is deprecated, use make_call().set_command_stop().perform() instead. [-Wdeprecated-declarations]
                 id(desk).stop();
                      ^
In file included from src/esphome/core/controller.h:14,
                 from src/esphome/components/api/api_server.h:9,
                 from src/esphome/components/api/api_connection.h:6,
                 from src/esphome.h:3,
                 from src/main.cpp:3:
src/esphome/components/cover/cover.h:146:8: note: declared here
   void stop();
        ^~~~
Compiling .pioenvs/office-desk/esp-tls/esp_tls.o
Compiling .pioenvs/office-desk/esp-tls/esp-tls-crypto/esp_tls_crypto.o
Compiling .pioenvs/office-desk/esp-tls/esp_tls_error_capture.o
Archiving .pioenvs/office-desk/esp-idf/efuse/libefuse.a
Compiling .pioenvs/office-desk/esp-tls/esp_tls_mbedtls.o
Compiling .pioenvs/office-desk/esp_adc_cal/esp_adc_cal_common.o
Compiling .pioenvs/office-desk/esp_adc_cal/esp32/esp_adc_cal.o
Compiling .pioenvs/office-desk/esp_common/src/esp_err_to_name.o
Compiling .pioenvs/office-desk/esp_eth/src/esp_eth.o
Archiving .pioenvs/office-desk/esp-idf/esp_adc_cal/libesp_adc_cal.a
Compiling .pioenvs/office-desk/esp_eth/src/esp_eth_phy.o
Compiling .pioenvs/office-desk/esp_eth/src/esp_eth_netif_glue.o
Compiling .pioenvs/office-desk/esp_eth/src/esp_eth_mac_esp.o
Compiling .pioenvs/office-desk/esp_eth/src/esp_eth_phy_dp83848.o
Compiling .pioenvs/office-desk/esp_eth/src/esp_eth_phy_ip101.o
Archiving .pioenvs/office-desk/esp-idf/esp-tls/libesp-tls.a
Archiving .pioenvs/office-desk/esp-idf/esp_common/libesp_common.a
Archiving .pioenvs/office-desk/esp-idf/driver/libdriver.a
Compiling .pioenvs/office-desk/esp_eth/src/esp_eth_phy_ksz80xx.o
Compiling .pioenvs/office-desk/esp_eth/src/esp_eth_phy_lan87xx.o
Compiling .pioenvs/office-desk/esp_eth/src/esp_eth_phy_rtl8201.o
Compiling .pioenvs/office-desk/esp_event/default_event_loop.o
*** [.pioenvs/office-desk/src/main.o] Error 1
========================== [FAILED] Took 7.16 seconds ==========================

Have you tried [Testers wanted] New ESPHome configuration and documentation improvements · Issue #67 · iMicknl/LoctekMotion_IoT (github.com)? :slight_smile:

Glad I found this thread. Considered ordering something like the Upsy Desky, but that’s way too expensive.
I put together this with parts I had laying around - basically an old network fly lead and NodeMCU - and after a bit of soldering, before I knew it I could control my desk wirelessly.

My desk has a HS01B-1 controller. The cover entity works and the height is shown, however I can’t get M, or any of the presets to work.

Spent a lot of time reading how we got to this point and it was very educational!

Thanks for your response. I was able to fix this by changing the byte types to uint8_t

I’ve got a new FlexiSpot E7 Pro - Controller that came with it says HS13M-1C0 on the desk mounted buttons
I haven’t cracked it open as yet… but has anyone tried the HS13A/B code with the HS13M