[DIY Hack] Connect Adjustable desks to eWeLink and major platforms via Home Assistant

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.

Showcase vid.

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

:warning:This guide is for beginners but still requires a basic understanding of electrical equipment.
:warning: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.

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.

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 your relay

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.

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.

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 HA

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.

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.

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.

3 Likes

Well Done :money_mouth_face:

1 Like