ESPHome UART desk communication

Hi there, I am trying to control the Autonomous SmartDesk via an ESPHome ESP8266. Currently, I am trying to read the desk’s current height. It sends this value continuously. Here you see how the 6 byte message looks

In general, this GitHub repo ( should contain all the info to understand how the desk works. My goal is to have an entity for the height, moving the desk down (button) and up (button) as well as the 4 stored height presets (again a button). I would really appreciate any help because this is really outside of my abilities.

This is my current YAML.

And the “uart_read_line_sensor.h”

Hey @Om3gaOfficial - it’s a good idea to review How to help us help you - or How to ask a good question

Reading screenshots on a phone is not very practical and doesn’t promote others helping you and I do most of my reading on my phone….

This is untested, but the idea is to allow you to set height (in inches?)

  - platform: template
    name: height
    id: height
    entity_category: config
    min_value: 29.5
    max_value: 48.4
    step: 0.4
    initial_value: 29.5
    accuracy_decimals: 1
    mode: box
    unit_of_measurement: inches
    optimistic: true
    restore_value: true
    update_interval: never
      - uart.write: [0xD8, 0xD8, 0x66, (unsigned char)(int(x/0.3933)), (unsigned char)(int(x/0.3933))]

Do you know who is the OEM for your desk?

This page has some info.

For example if it is Jiecang, you might be able to use the Desky custom ESPHome component.

I am new to Home Assistant programing. Your “uart_read_line_sensor.h” is this a test file that is added to the directory or do I go in HA files and type it into another file?