tjhorner / upsy-desky

Make your standing desk smarter
https://upsy-desky.tjhorner.dev
Other
478 stars 24 forks source link

IKEA UPPSPEL support #15

Closed murraythegoz closed 1 year ago

murraythegoz commented 1 year ago

Hi,

asking for support for the IKEA's UPPSEL controller seems to be a rebranded JCB36N2 (https://www.jiecang.com/JCB36N2-pd45762211.html)

Works partially.

I set both uplift and jarvis template. All 4 desk preset works (both from web page and via MQTT) Current height is not handled.

How can I help debugging?

thank you

m.

murraythegoz commented 1 year ago

A small update. desk height is handled, but there is an offset.

Lowest height: 72 cm

height #1: 108 cm reported height #1: 26 cm

height #2: 72 cm reported height #2: 25.9 cm

height #3: 120 cm reported height #3: 26 cm

murraythegoz commented 1 year ago

upsy-desky-page2

tjhorner commented 1 year ago

Thanks for the detailed report! I can make a separate decoder which offsets the height by -72 cm and send that to you for testing. I'll let you know when that is available.

murraythegoz commented 1 year ago

Thank you,

please let me know if in the meanwhile can help somehow (e.g. how to check whether the problem is due not only to offset or also different way of handling/decoding actual height)

murraythegoz commented 1 year ago

Hi any update? May I help somehow?

thanks

tjhorner commented 1 year ago

Hi @murraythegoz, sorry for the delay. A lot on my plate right now! I should have a firmware for you to test this weekend.

nicholasgk commented 1 year ago

I had the same issue with my Omnidesk Pro. I found that the file uplift_decoder.cpp on line 27, was only looking for a value of 0 or 1. The desk was returning values up to 4. I think it is due to mm vs inches. I changed this one line to if (b == 0x00 || b == 0x01 || b == 0x02 || b == 0x03 || b == 0x04) { and it started returning the correct height values.

I am not a C++ programmer, so there probably is a better way to write this. Hope this helps.

murraythegoz commented 1 year ago

I had the same issue with my Omnidesk Pro. I found that the file uplift_decoder.cpp on line 27, was only looking for a value of 0 or 1. The desk was returning values up to 4. I think it is due to mm vs inches. I changed this one line to if (b == 0x00 || b == 0x01 || b == 0x02 || b == 0x03 || b == 0x04) { and it started returning the correct height values.

I am not a C++ programmer, so there probably is a better way to write this. Hope this helps.

Yup. this made the trick!

I'd instantiate a new variant with the suggested change, to avoid scramble working variants.

There is some inconsistency in the least significant bits (the position is off by a variable of 0.2-2 cms), but you caught the main issue.

Thank you!

pedrams1 commented 1 year ago

Tested this and confirming it resolves the issue reported here - https://github.com/tjhorner/wifi-desk-controller/discussions/18

Thank you so much for this!!! The desk is working perfectly now :)

tjhorner commented 1 year ago

@pedrams1 could you provide the model number for your desk's control box? I'd like to add it to the list of supported desks in the documentation. Thanks!