iMicknl / LoctekMotion_IoT

Learn how to connect your Flexispot (LoctekMotion) desk to the internet. This repository contains a collection of scripts to get your started, combined with research and instructions.
MIT License
626 stars 61 forks source link

Desk Height #95

Open wernerhp opened 1 month ago

wernerhp commented 1 month ago

The desk height component has some glitches.

When setting the height from 72.5cm to 105cm it starts but then stops shortly after with with a height value of 800cm (I suspect this hsould be 80.0cm). Similarly, when it lowers from 105cm to 72.5, it stops shortly after with a height value of 10cm (I suspect this should be 100.0cm)

image image image

https://github.com/user-attachments/assets/eba648d9-71a5-4aa3-b842-8471fe5c6cf0

iMicknl commented 1 month ago

Which version do you use? We just published a new version of this component, see the README.

Number entity will still overshoot, but in general the code is better.

wernerhp commented 1 month ago

I tried main and v2

source: github://iMicknl/LoctekMotion_IoT@v2
  components: [ loctekmotion_desk_height ]
wernerhp commented 1 month ago

Screenshot_20241018-190954

I'd have expected the cponent to be updated. That's where the problem appeared to have been.

The hex_to_int func doesn't output the correct value for all decimal values from what I could tell.

iMicknl commented 1 month ago

@wernerhp I would need to investigate if I face the same issue, or if your device is different..

wernerhp commented 1 month ago

Have a look at this height decoder https://www.mikrocontroller.net/attachment/452474/Schreibtisch_Dekoder.xlsx

Maybe you could add a test to check that the examples form the sheet are correctly decoded.