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

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