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
image

In general, this GitHub repo (https://github.com/Stefichen5/AutonomousControl) 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”
image

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?)

number:
  - 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
    set_action:
      - 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.
https://www.btod.com/blog/2017/12/15/autonomous-home-edition-electric-standing-desk-review/

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?