This article was written by Ward Zhou. The original post:
[Hack-on] Connect Adjustable desks to eWeLink and major platforms

0. Introduction

Many adjustable desk models utilize traditional controls, featuring a panel often mounted on the desk’s surface. Though some offer Bluetooth connectivity, these options typically come with a higher price tag. The good news is, there’s a DIY alternative. This beginner guide details how to connect an adjustable desk to a smart home platform using a relay module.

4chpror3 smart relay

Learn more about this module: SONOFF 4CHPROR3

The goal

  • To allow adjustable desk control via a smart home platform
  • To integrate the desk with a presence sensor for automation
  • To enable automation based on the user’s location
  • To provide historical data on desk status

To-do

  • Override the anti-misoperation algorithm
  • Acquire the height
  • Lift and decent buttons need further work

⚠️This guide is for beginners but still requires a basic understanding of electrical equipment.

⚠️This DIY modification may void the desk’s warranty and can potentially result in damage.

You would need

  • SONOFF 4CHPROR3 or other relays with dry contact points
  • Multimeter
  • Welding kit
  • Wires (ideally in varying colors for easy identification)
  • Hot glue gun
  • Screw/drill (optional)
  • Patience and maybe an engineer friend to handle welding work

1. Preliminary steps

Start by identifying the type of control panel assembled on your desk. If it determines that it’s button-based, you can proceed with the guide. However, be careful during the dismantling process.

pow elite

I have a control panel consisting of six buttons, four of which allow for customized height adjustments, and two control the desk’s lift and descent. The panel also included an LED screen to display the desk’s current height.

The buttons I found after the teardown are common four-feet ones. I then use a multimeter to check its working voltage and currency. Since this guide uses dry points, there is no need to care about the polarity.

You can switch to the currency mode to see how to trigger the button and mark them.

l3 pro-4
Next, you’ll link your relay module to your desk’s buttons. Depending on the desk, a two-channel relay module should suffice.

2. Setup 4CHPROR3

Before doing any welding, it’s important to set up and test your relay modules.

Please follow the guides with the modules you have to pair up and test whether the switch would work. For an antique Wi-Fi device from eWeLink/SONOFF, you may need to connect to its AP for setups. eWeLink and SONOFF offer options like Interlock for relays, and be wise to toggle them on conditions.

l3 pro-5

Certain controls may use a button combo to activate high memory or kid lock features. However, a lagging wireless network can cause issues. This is where the Interlock feature steps in, effectively countering such problems.

And when you are well aware of the function of the contact points for each gang, it’s time to move on.

3. Installation

First, attach the wires to the base of the required buttons. Be cautious to avoid touching the metal casing of certain button types to prevent short-circuiting. After wiring, test the buttons before proceeding.

Next, connect these wires to your modules and perform a test to ensure they can be accurately triggered. This is a crucial step, so ensure everything functions correctly before proceeding.

I would recommend using hot glue to secure the wires, as it doubles as an insulative material. Strong adhesive tapes designed for electronics, such as those from 3M, also work well for this purpose.

app

Finally, reassemble the gadget casing and secure the relay modules to the back of your table. In this instance, it is advised to use a drill and screws for secure fixation to prevent accidental falls and potential damage.

4. Further automation in Home Assistant

As of the last step, you should be able to control your desk via the corresponding smart home app. However, please note that if the module you are using does not support automatic toggling, usually in cases where a relay acts more like a switch than a resettable button, you may need to set up an Apple shortcut script or additional automation for it to work.

l3 pro-5

I am gonna detail a demo in HA.

For starters, ensure that your device is connected to HA using SONOFF LAN integration. There are plenty of guides available, so I won’t delve deeper into this step.

Next, create two automations for the dual switches. When a status change from ‘off’ to ‘on’ is detected, the system will immediately revert them back to ‘off’. This makes the switch function more like a button.

From then on, you can establish additional automation based on your needs. For instance, I use an Aqara FP2 presence sensor in my setup. This sensor detects my presence around the desk. Once it notes that I’ve been sitting for over 45 minutes, the desk is programmed to elevate, prompting me to stand up, and then it lowers back down after a five-minute duration.

Another choice: SONOFF SNZB-06P Zigbee Human Presence Sensor

Some control panels have a built-in misoperation prevention design, which requires two consecutive activations to gain control, so make sure to add more actions to your automation.

If you want to track the status history, you can create a helper entity in HA under the Device and Integration page and set the status each time you trigger its controls.

I’ve also set it up so that my desk elevates whenever I’m away. It’s a precaution to prevent my cat from tampering with my desk. The beauty of it all is the limitless creativity that automation offers.