Ergostol Optima 2.0 (ESPHome) 000-DH16_V0.2 controller

I have an Ergostol Optima 2.0 desk with a PH02 controller (board 000-DH16_V2.0). And I want to control it in Home Assistant. As far as I understand, this can be done by using ESP Home and controlling the board via the UART protocol. I don’t have any special knowledge of working with it, so I ask more experienced people to help with the implementation.

At the moment, there are photos:




Well, and the desire to learn how to work with UART, by putting together a useful project for myself and, perhaps, others :smiling_face:

I’m trying to get debug from the board of the table, it gives something strange. Tried on baud_rate: 9600

Mahko_Mahko, Any ideas on this? Maybe try changing the UART frequency?

I still get a jumble of characters. When the desk is not moving, there is no jumble.

Here is the code I uploaded. If it matters, I have a Node MCU V1:

uart:
  - id: desk_uart
    baud_rate: 9600
    rx_pin: GPIO3
    debug:
      after:
        timeout: 10ms
      dummy_receiver: true
      sequence:
        - lambda: UARTDebug::log_hex(UART_DIRECTION_RX, bytes, ':');

What plugs into the control panel?

Is it one cable to a wall power cord and two cables to motor boxes?

Is there another control box or is that it?

What kind of functions does it have via the buttons?

I take it the height is shown in the display?

I would also measure the voltage across each of the two center wires both when the desk is idle and when operating via the buttons and see if they get pulled high or low. It’s possible they are control lives rather than uart (maybe).

The table is controlled exclusively by the panel. It receives a cable from the power supply (29V) and motor control cables. There is no external control unit.

The panel has the following buttons:
“S” - table settings: Gyroscope settings, overheating protection on/off, tabletop tilt, etc.

“Up” and “Down” buttons, when held down, the table moves.

There are also three (buttons 1 2 3) preset modes.

The display shows altitude, errors and the “Settings Menu” in the format S - 1 to S - 8.

I measured the voltage on the middle contacts of the table. When it is standing still, there is no voltage on them.

If you press any button (Up/Down or any of the presets), the contacts have an AC voltage of ~3.2v and the table will move in the given direction.

I connected a USB tester to the board and this is what I was able to record. Change in voltage on contacts D+ and D- when pressing the buttons (and the corresponding movement of the table).

UP:

DOWN:

Any ideas?

Hmm I’m not exactly sure what to make of those signals.

Also be careful of shock as you probably have 30V on that board there.

I think it is more likely that D+ and D- are control wires rather than uart wires. But not sure. I’m not really an expert on these things by the way. Just learnt a few basics for the Desky project.

There’s two things you can try.

One is to short the D+ and Gnd wires (briefly) and see if the desk moves. Then do the same for D-. This is the point where you could damage your desk though. But probably ok.

Then after that you can maybe experiment with some some gpio switches that pull those wires high or low in different combinations.

Similar to this, but you’ll need to adjust. You might need to look at your signals closer and consider if each wire should be pulled high or low. You may or may not need to change inverted to false.

# You'll need to modify this. Make two.
# Raise the desk 
  - platform: gpio
    id: raise_desk
    name: "Raise Desk"
    pin:
      number: D2
      # mode: INPUT_PULLUP
      inverted: true
    interlock: lower_desk
    on_turn_on:
    #Auto off after 15s just in case
    - delay: 15s
    - switch.turn_off: raise_desk

I think first you should try to determine if D+ are or aren’t control wires that move the desk up or down by pulling the wires some combination of high or low, per above.

If those wires do serve that function, then you can go looking for other signals on traces that send for example the height data to the display from the MCU.

Finally got some time to tinker with the table. So, for now I’ve tried the following:

switch:
  - platform: gpio
    pin:
      number: GPIO4    # D2
      inverted: true
      mode:
        input: true
        pullup: true
    name: "Вверх"
    id: up
    interlock: [down]

  - platform: gpio
    pin:
      number: GPIO5    # D1
      inverted: true
      mode:
        input: true
        pullup: true
    name: "Вниз"
    id: down
    interlock: [up]

This does not work. I also tried to manually short-circuit the contacts to GND, the table does not want to move anywhere.
Maybe these contacts are for flashing the embedded controller?

I don’t even know where to look next.
I think I’ll try “Switching” the buttons using transistors. Not the best idea, looks a bit weird.
But at least I’ll be able to use the timer and switch between the two modes “Sitting” and “Standing”…
Any other ideas on how to find the controls for this table?:sweat_smile:

That is possible.

I don’t really have any more ideas at this point ;(

There seem to be “missing” components here. Perhaps they have something “smart” planned for that area? Bluetooth/wifi etc. I have no clue though.

image