Desky Standing Desk (ESPHome) [Works with Desky, Uplift, Jiecang, Assmann & others]

So I got this working a while ago and it’s been amazing. I’m trying to integrate it with some other stuff, and now I’d like to trigger automations based on the direction the desk is moving.

Is there a way to tell? The only way I can think of doing that is comparing the current height a second ago, but I have no clue how to do that.

1 Like

If you are moving the desk using the move_to command…

on_...:
  then:
    - lambda: id(my_desky).move_to(150);

Then you can make use of the DESKY_OPERATION feature that Ssieb kindly built at my request. Also see this bit. They were inspired by thier cover equivalents (COVER_OPERATION_OPENING, COVER_OPERATION_CLOSING)

How ever this feature won’t report direction if you use the desks native contoller or trigger the memory buttons via ESPHome.

I recently worked around this by basically doing what you’ve suggested, which is watch for changes in height.

My implementation is bascially a “delta sensor”. There’s probably a better way to do this but it’s ok for my purpose for the moment.

Make sense?

  - platform: copy
    source_id: desky_height_cm
    id: desky_height_cm_delta
    name: "Desky Desk Height Delta"
    accuracy_decimals: 1
    internal: true
    icon: mdi:arrow-expand-vertical
    unit_of_measurement: cm
    filters:
       #Convert to Delta
      - lambda: |-
          static float last_value = 0;
          float  change = 0;
          change = x - last_value;
          last_value = x;
          return change;
    on_value:
      then:
        - lambda: |-
            if ( x > 0){ return id(desky_last_movement_direction).publish_state("Up");}
            else if (x < 0){return id(desky_last_movement_direction).publish_state("Down"); }
        - lambda: |-
            if (id(desky_height_cm_delta).state != 0) {
                id(desky_is_moving).publish_state(true);
            }
        - delay: 200ms
        - lambda: return id(desky_is_moving).publish_state(false);

binary_sensor:
  - platform: template
    id: desky_is_moving
    name: Desky Is Moving
    # lambda: return id(my_desky).current_operation != desky::DESKY_OPERATION_IDLE;
    icon: "mdi:motion"
    filters:
      - delayed_off: 1s

Interesting, I’ll give it a try, thanks!

1 Like

Can anyone report success with a MAIDeSITe desk?

All desks so far have had Jiecang controllers. Have you done any digging to check whether this is a Jiecang controller? I think it’s pretty unlikely.

Acutally no, my main concern until now was the construction of the frame regarding stability. The MAIDeSITe desk seemed to be the most stiff compared to others.

Maybe this works: Turn your LoctekMotion/FlexiSpot standing desk into a smart desk! - #36 by m1scha

I’ll check the hardware once the desk arives and report about it.

1 Like

That’s probably the best idea. Don’t be too afraid to unscrew the controller box and take a peak at the board inside (although taking apart that may void your warranty). Even just Google imaging the control box and control panel you can often find out who the OEM is, which is the secret to finding the right project which will work or can be adapted.

Okay, thanks! Here are some close-up pictures. Can you possibly determine from the outward appearance if it is supported?

I think you will be in luck!

I would buy parts.

It’s possible the newer Jiecang controllers may have a different or slightly different protocol, but this is looking pretty promising as a start!

The hardware looks quite similar!

1 Like

Great, thank you so much for taking the the time!

1 Like

I have just received the desk and checked everything. Although it is manufactured by Jiecang, the controller seems to be different. Here are some additional pictures of the MaideSite desk.

There is one 6 wire RJ-12 connector that’s directly connected to the control box. Maybe I can hock up the esp there?



Could you send more photos please? Perhaps similar to those in this post. Or a vid.

Just want to get a clearer picture of the system diagram.

Also see if you can spot your controller here.

I couldn’t find the controller in the list you shared. It appears that the motor drivers are integrated with the display.

Here are some pictures and the wiring diagram. Each leg and power are directly connected to the touch display box.






Thanks. A few initial thoughts.

I think you’ve got some work and Investigations to do if you want this to work.

I don’t think you’ll be able to control it via the rj12 port. That is probably for a Bluetooth dongle and the protocol for that has had less development. But it’s probably still worth a tinker. Could have changed.

You may be better off trying to intercept signals at the jst connector between the handset face and the control box body. Similar to what I did here.

As a first step, I would investigate these pins here. Do any control up/down (like I documented in this thread?). Are any Rx/tx (can you see messages via uart debug or a logic analyser)?

Also check carefully for any labelling relating to these wires (Rx,tx p,g or similar).

1 Like

Looks great. Any chance of sharing that enclosure?

No problem. Here’s a link. Downloads are in the top-right.
https://a360.co/3P5P0RV

1 Like

If not going for a pass-through you could almost get this to usb stick type sizes I reckon. Not sure on best exact build materials/components.

Just found this amazing item on AliExpress. Check it out! AU $1.62 27%OFF | White RJ45 Tool-less Connector No Crimp Connectors Cat6 Connector Cat5e Connectors Cat5 Connectors
https://a.aliexpress.com/_mtudN7I

https://www.google.com/search?q=atom+light+esp32&tbm=isch&ved=2ahUKEwjIxfqe1rf_AhW0yKACHZJfAgYQ2-cCegQIABAC&oq&gs_lcp=ChJtb2JpbGUtZ3dzLXdpei1pbWcQARgCMgcIIxDqAhAnMgcIIxDqAhAnMgcIIxDqAhAnMgcIIxDqAhAnMgcIIxDqAhAnOgQIIxAnOgUIABCiBFAAWABg00hoAnAAeACAAbMBiAGzAZIBAzAuMZgBAKABAbABBcABAQ&sclient=mobile-gws-wiz-img&ei=TeKDZIjrLLSRg8UPkr-JMA&bih=737&biw=393

@jn3va3 Did you ever try this out with the Timotion, just bought a set of legs that use it and realized after I got them that they were not Jiecang, but Timotion.

@lizaoreo is the control box a TC11?

I really think there is slim to no chance of this project being compatible with Timotion looking at a controller teardown.

https://www.btod.com/blog/problems-autonomous-smartdesk-2he/#timotion

TC15, rather annoyed now. I was sure I was getting a Jiecang. I may just use this as a learning opportunity (as I don’t really want to return at this point) and determine if I’ll even use the stand up functionality. If so, then next time I’ll spend more for a better set of legs where I know what I’m getting. Brand of the legs is AIMEZO on Walmart/Amazon. So I’d avoid if you’re looking to use them with this project, assuming I can’t get this to work somehow. Worst part is I got the ones with just an up/down button because I assumed I could make this work, so I don’t even have memory.

1 Like