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
550 stars 56 forks source link

Update height when controlling through original keypad #71

Open lilaelephant opened 8 months ago

lilaelephant commented 8 months ago

Hi, thanks so much for this repo! I have followed the instructions over a year ago using the Flexispot E7 and it works quite well! I'm using the following keypad:

image

Luckily my adapter provides two RJ45 ports, so I still use the original keypad while also being able to control it using Home Assistant.

My problem

I'm trying to create push notifications and collect statistics, so that I can better motivate myself to regularly stand. But when I use the keypad, the new height doesn't get detected. It is displayed on the keypad itself but the only way to also get it into Home Assistant is by sending the the "M" command or rebooting the device. This is quite annoying because it always lights up the display (I sleep in the same room).

Is there any way to properly read out the current height without having to send the "M" command or control the device using Home Assistant? I would love to keep using the keypad but get the benefit of collecting statistics and to set up push notifications to remind myself to stand (for example when I'm currently in a work meeting).

iMicknl commented 8 months ago

Have you tried the V2 pinout and YAML? See the pinned issue.

lilaelephant commented 8 months ago

@iMicknl yes, I have tried it with both (current main branch and https://github.com/iMicknl/LoctekMotion_IoT/issues/67) and I can't manage to receive any updates on the height when I change the height on my physical keypad

j3mu5 commented 8 months ago

Hello everyone,

Perhaps a direct comparison will make things clearer? I have now compared the cable position for my E7 as shown in the picture below:

d28016152a24420d9ea8169860d709d8-image

RJ45 | Working (no desk height upon manual change) | #67 > Not working. -- | -- | -- 8 |   | VIN +5V 7 |   | GND 6 | RX2 (GPIO16) | TX2 (GPIO17) 5 | D23 (GPIO23) | RX2 (GPIO16) 4 |   | D23 (GPIO23) 3 | TX2 (GPIO17) |   2 | GND |   1 | VIN +5V |  
jacobbjo commented 8 months ago

Hi, I'm having the same issue where the height is not updated when using the original keypad or when pushing the preset buttons in home assistant.

Desk model: Flexispot E7 Control panel: HS13B-1 Control box: CB38M2J(IB)-1

Using this pinout: RJ45 pin Name ESP32
8 +5V (VDD) VIN
7 GND GND
6 TX TX2 (GPIO17)
5 RX RX2 (GPIO16)
4 PIN 20 D23 (GPIO23)
3 (unknown)  
2 SWIM  
1 RES  

I uncommented the ESP_LOGD lines in the "desk_height_sensor.h" to try to look at what is received.

When doing nothing, I can see that these six bytes are received over and over again: 0000009b 00000004 00000011 0000007c 000000c3 0000009d

When changing the table height with the up/down cover arrows in home assistant I can see that new height information is received continuously, all good.

When pressing the preset buttons in home assistant or when operating the original keypad (preset or up/down) I just see the above mentioned bytes over and over. The display on the original keypad is however updated continuously as the table moves.

It is just as if the two RJ45 jacks on the controller does not get the same data.

Anyone else with the same control panel + control box that has this working properly?

I'm thinking of creating a cable that piggybacks on the transmitting line to the original control panel to see if I can see some other data.

voydz commented 5 months ago

Hey there.

I am experiencing the same issue. No height update when using the keypad and presets (through HA).

I got the exact same setup and environment as @jacobbjo

best regards

voydz commented 5 months ago

Hey folks, here are some observations.

It is not entirely true, that the height is not updated at all. I am experience a single update tick after i.e. calling a preset. Afterwards there are no more updates. Unfortunately I do not have the time to look into this right now, but I am leaving it here, maybe someone got an idea or at least is pushed in the right direction with this information.

Bildschirmfoto 2024-02-19 um 11 57 35

SasStu commented 4 months ago

I have the same setup and same behavior. Everything works fine, except updating the desk height which will only update immediately after using software buttons to change the height.

voydz commented 4 months ago

Also, I noticed something that might (?) be relevant to this issue.

I read several times, that the control panel is protected against accidental touches. So you have to touch it once to wake the screen („Wake screen“ UART command?) and afterwards you are able to control the desk.

My desk does not have this „feature“. Accidental touches instantly move the desk. I think I will reach out to FlexiSpot and ask about that behavior.