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

My goal also was to make it easy for beginners but we seem to have different approaches to reach that goal. :slight_smile:
Too me that means no serial data or (kind of) complicated scripts in the yaml. Just three lines for the external component and a plain as possible configuration for buttons etc. The downfall is that it only supports one version of the protocol.

But I also see the benefit in you configuration. Especially the “no cpp coder needed” argument is hard to beat when it comes to adapting to different versions of the protocol.

While were at it, my 2nd goal was to make it easy to combine the component with other features of esphome.
For example you could easily add some physical buttons to the spare pins of your controller and have them call the lambda-functions, you could create a secondary button interface like that. Or maybe a button that toggles between two desk heights.

Thank you for your answer! Keeping it public and in english is totally fine for me!

So if i understood you and the tutorials right… i can install ESPHome (done), solder de parts togehter and use this config: esphome_components/components/jiecang_desk_controller/jiecang_desk_controller.yaml at a083c17882361c58071b85d45587c410582cda75 · Rocka84/esphome_components · GitHub and it should work in totally Basic?

Yeah I think I agree that your approach “is probably easier” for a beginner. Especially now you have it as an external component, your config is very tight, and your docs are tidy;)

Probably part of me just wanted to tinker too;) And well I could support the yaml based one but not your cpp one if you aren’t so active on it ( my cpp skills are limited).

I’ve linked your project in my OP now. Thanks for contributing to this thread;)

1 Like

Hello.

Does your desk control box have both a rj12 port and a rj45 port? Or only one? (Which one). Post some photos if you are unsure.

Can you post picture of the label on the control box. Probably it’s a Jiecang but the label typically helps confirm. Like this.

Can you see your control box on the Jiecang site?

If you have the same desk as described in the blog article I mentioned… I can’t promise it but I’m very positive.
So as you already have the d1 mini all you need is an (old) landline phone cable and you could just give it a shot.

But just to be sure: no warranties! Don’t mix up plus and minus :sweat_smile:

1 Like

Thank you again for your answer!

Yes, i will add some photos here and i also found the controll box on the site from jiecang :slight_smile: I have an RJ45 cable but just for that you can confirm this i will also add a photo. @Rocka84 thank you also for your answer, here are the information you asked for :slight_smile:

(As i´m a new user here i am not allowed to upload photos… so here is a wetransfer link. Maybe someone can upload them WeTransfer - Send Large Files & Share Photos Online - Up to 2GB Free).

Additional i allready have the D1 mini and also two RJ45 female breakout connectors so that i can plug in the RJ45 cable from the button-thing and have then screws to connect wires :slight_smile: then i dont have to cut the original cable :slight_smile:

^^??

If your control box has both (like 1st two photo’s below), you’re probably better off using the RJ12 port for your smart control and building a dongle for that and then probably just use Rocka84’s project.

If you only have a RJ45 port, probably you should build a pass-through dongle.


Your photo’s

image

OH SORRY!! I read your question wrong. :slight_smile: YES i have also a RJ12 “F” port on my controller Box.

Then i will solder the cable on it and text again here when its going to configure this stuff :smiley: Thank you!!!

1 Like

should be correct? :slight_smile:

From what I can see it looks good to go!
Next step I would flash a basic ESPHome config via usb and then make sure it powers on ok when plugged into the port.

I had some poor quality RJ12 cables which caused me power issues.

I now have made a new device in ESPHome and edited like this:

esphome:
  name: ergotopia-david1
  friendly_name: ergotopia-david1
  on_boot:
    # don't touch if you don't know what you're doing!
    priority: 0 # when mostly everything else is done
    then:
      - lambda: "id(my_desk).request_physical_limits();"
      - delay: 0.1s # give controller a chance to handle the response before sending the next command
      - lambda: "id(my_desk).request_limits();"
      - delay: 0.1s
      - lambda: "id(my_desk).request_settings();"

external_components:
  - source:
      type: git
      url: https://github.com/Rocka84/esphome_components/
    components: [ jiecang_desk_controller ]

uart:
  id: uart_bus
  tx_pin: TX
  rx_pin: RX
  baud_rate: 9600

# Enable logging
logger:
  baud_rate: 0 # disable logging over uart, required when using the RX/TX pins for the controller

# see full example for more options: https://github.com/Rocka84/esphome_components/blob/a083c17882361c58071b85d45587c410582cda75/example_jiecang_desk_controller.yaml
jiecang_desk_controller:
  id: my_desk
  buttons:
    raise:
      name: "Raise"
    lower:
      name: "Lower"
    stop:
      name: "Stop"
    position1:
      name: "Position 1"
    position2:
      name: "Position 2"
    position3:
      name: "Position 3"
    position4:
      name: "Position 4"
  numbers:
    height:
      name: "Height"

# the usual stuff

esp8266:
  board: esp01_1m

# Enable Home Assistant API
api:
  encryption:
    key: "KEY"

ota:
  password: "PASSWORD"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Ergotopia-David1"
    password: "PASSWORD"

captive_portal:
    

that should be right? then i just have to flash the device like described in the esp home tutorials by connecting it to my raspberry from home assistant and then it should be found as device, add API Key and should work? :heart_eyes:

1 Like

All looks good to me at a quick look!

1 Like


very nice. That should work now exactly like the original buttons?

1 Like

WORKS PERFECTLY!

Thank you for your help! The only thing is that the buttons “raise” and “lower” are just moving the desk minimum, not until there is a “stop”.

But thats not a problem for me, i want to use the memory function and the height :slight_smile: Thank you!

3 Likes

Congratulations :tada:

In your screenshot the height input is empty. Does it stay like that or does is show the correct height later on? And when you enter a value by hand, does the desk go to that height?

Yes, that’s by design - at least for now. Maybe I should have called them “Step up” and “Step down”.

As for a continuous movement, I already had some code for that in one of the iterations - but removed it shortly after. The problem was that you can’t stop that movement with the physical buttons on the controller. Imagine clicking down in home assistant, realizing that the desk would crush something and then not being able to stop the desk from its controller. Instead you have to search your phone and click ‘stop’ there. I didn’t want to be responsible for that risk.

1 Like

I had a bit of a tinker with something for this. Seems to work ok but maybe you can come up with a cleaner solution?

Heyho, yes, the field is empty, when i add a number the desk goes to this position but there is no actual height. is there a way to get it?

We’ll see what @Rocka84 reckons, but I suspect if we confirm if you are recieving any uart data on your rx by adding this to your config then that would be useful debugging info.

uart:
  tx_pin: Xxxxx
  rx_pin: Xxxxx
  baud_rate: 9600
  debug:
    direction: BOTH
    dummy_receiver: true
    after:
      delimiter: [0x7E]
      # timeout: 5ms
    sequence:
        # Use mulcmu's method for reading uart without a custome component: https://community.home-assistant.io/t/how-to-uart-read-without-custom-component/491950?u=mahko_mahko
      - lambda: |-
          UARTDebug::log_int(direction, bytes, ',');                // Log the message as int. Good for height message checks.
          UARTDebug::log_hex(direction, bytes, ',');                // Log the message in hex. Good for checking against protocol documentation.
          

Add the extra config, move the desk, and then post your logs.

Yes, logs of the serial output would help!
I haven’t checked it but @Mahko_Mahko’s suggestion looks good to me.

So that idea was even better than I initially realized :star_struck:
In hindsight I should have thought of that much earlier. So thanks @Mahko_Mahko!
And I already implemented it as well:

Changes:

  • added buttons and lambdas for moving the desk up or down until stopped
    • move_up and move_down
  • renamed raise to step_up and lower to step_down
    • raise and lower are still supported but deprecated and undocumented
  • number entity for height in percent
1 Like