Hi Mahko_Mahko and ssieb,
Thank you for your great work! I can confirm that the Ergotopia Desktopia Lite also works with the RJ45 dongle. I just built the pass-through adapter yesterday and it neatly integrates into HA.
Thanks for reporting back - Iāve added your model to the works-with list!
Hi,
Iāve also got an Ergotopia Desktopia Lite an wanted to rebuild the pass-through dongle. Since Iāve got some ESP32-WROOM-32 at home I thought I could use these. But following https://community-assets.home-assistant.io/original/3X/9/9/99c36ea684b9d479f26a99b929566d109f7443dc.png this ESP only has a 3.3V pin.
Will this also work?
Use VIN
which will output the 5V from the USB assuming thereās no diode.
With the main pass through dongle wiring scheme, the esp is actually powered from the desks 5v wire.
So it should just be a matter of using the pin labelled VIN rather than 5V I believe.
@freh ā¦
Thanks. This project teaches me a lot about esphome.
Iāve managed to build the dongle, but still got some problems by adapting the software to my esp.
This whole thread is really exciting! It is also a bit overwhelming.
I am located in Germany. I plan to build an L-shape desk with my own top plate. Any recommendations for which desk frame to get, because hackability but also because of general quality!?
Thanks!
If you describe what you do and donāt have working, I may be able to provide some pointers.
Photos and logs etc typically help.
You could look through the āworks withā list in the first post and see if any of the brands sell L shaped legs and ship to your region.
Desky does, but I think they are mainly an Australian seller.
Jiecang is generally seen as ācheaper and lower qualityā than say Linak.
Itās worth watching a few of this guys vids.
https://www.btod.com/blog/electric-standing-desk-review-videos/
Hi @Mahko_Mahko ,
First of all thanks so much for this project. I built it and it works perfectly fine with a Desktopia except one tiny thing. Maybe you can help.
I have set it up like this in HA
All the functionality except Desky Sitting Height 1 works for me. It doesnāt matter what value I choose in the slider and then press lower desk it goes down to 87.5. I have so clue where the 87.5 come from.
My questions:
1.) Is the described behaviour how it should work?
2.) Is 87.5 somewhere hardcoded?
The ESP Code I only changed slightly:
####################################################################################################
##Notes/Info
####################################################################################################
## Home Assistant Thread: https://community.home-assistant.io/t/desky-standing-desk/383790/3
## ssieb who generously donated his time and knowledge to developing the custom component may offer some support on the Discord thread (please read both threads first).
## https://discord.com/channels/429907082951524364/952464939480645642
#Notes:
# 1. Use this component at own risk. It has not had extensive testing. May void warranty or cause desk faults etc.
# 2. This controller may bypass desk safety features like collision detection.
# 3. This component doesn't know about the values stored in your desk. Values in this config are (and must be) set independently.
# 4. ssieb's solution may be a lot simpler and cleaner for most people. I've cobbled together some more features in this config because I can't programn in C++.
#Troubleshooting Tips:
#If you ever get a flashing ASr message, you might need to reset your desk.
#https://desky.com.au/blogs/news/reset-standing-desk-control-panel#:~:text=When%20ready%2C%20press%20and%20hold,Hooray!
#TODO
#Ask ssieb to make change requests (move logic to component code)
# Invert pins
# Get Desk Height On Boot
# Interlock Up/Down Pins (If not done already)
# Interrupt/stop movement function (Stop desk motion)
#other
# Test collision detection
# Limit external component fetch to just desky?
# Fix Desk Is moving on Boot.
esphome:
name: standingdesk
platform: ESP8266
board: d1_mini #pinout: https://i0.wp.com/randomnerdtutorials.com/wp-content/uploads/2019/05/ESP8266-WeMos-D1-Mini-pinout-gpio-pin.png?quality=100&strip=all&ssl=1
on_boot:
priority: -100.0
then:
#Request a desk height update after boot.
- delay: 5s
- switch.turn_on: wake_desk_and_get_height
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
api:
encryption:
key: "dreyeQ10Lucl0C2qE9DFdCna9iK0jF3wGoILiB4Ih/8="
ota:
password: "0746407152149cf59f272ecb06c21855"
# Enable Web server.
web_server:
port: 80
logger:
# level: VERY_VERBOSE ##Uncomment to see UART debug messages
external_components:
#Fetch ssieb's custom component# https://github.com/ssieb/custom_components/tree/master/components/desky
- source:
type: git
url: https://github.com/ssieb/custom_components
components: [ desky ]
uart:
- id: desk_uart
baud_rate: 9600
rx_pin: 1 #Labelled TX on my D1mini clone (mislabelled?)
##You can uncomment the debug section below to see UART messages.
# debug:
# direction: RX
# dummy_receiver: true
# after:
# bytes: 4
# sequence:
# - lambda: UARTDebug::log_int(direction, bytes, ',');
desky:
id: my_desky
####################################################################################
##Uncomment this block to use Ssieb's move_to componet function.
# up:
# number: 4 #D2
# inverted: true
# down:
# number: 5 #D1
# inverted: true
# stopping_distance: 15 # optional distance from target to turn off moving, default 15
####################################################################################
height: # Sensor publishing the current height
name: Desky Height
id: desky_height
accuracy_decimals: 1
unit_of_measurement: cm
#any other sensor options
filters:
- delta: 0.05 #Only send values to HA if they change
- throttle: 200ms #Limit values sent to Ha to 5 per sec.
- multiply: 0.1 #convert from mm to cm
on_value:
then:
#If the value changes, then the desk is moving
- binary_sensor.template.publish:
id: desky_is_moving
state: ON
- delay: 300ms
#Assume it's stopped moving if no height changes after a short time.
- binary_sensor.template.publish:
id: desky_is_moving
state: Off
binary_sensor:
- platform: template
id: desky_is_moving
name: "Desky Is Moving"
filters:
- delayed_off: 400ms
#If the desk isn't moving for a bit we better turn off attempts at movement. It's like poor man's collision detection?
on_release:
then:
- button.press: desky_stop_desk
button:
#Stop movement
- platform: template
name: Stop Desk
id: desky_stop_desk
on_press:
then:
- switch.turn_off: raise_desk
- switch.turn_off: lower_desk
#Move to function
- platform: template
name: Go To Desky Height x
id: go_to_desky_preset_height_x
on_press:
then:
##Option 1: Uncomment to use Ssieb's move_to componet functions
# - lambda: id(my_desky).move_to(id(desky_target_height).state*10);
##Option 2: Uncomment to use Mahko's lambda alternative
#Check if we need to move desk up or down from current position
if:
condition:
#Current height is more than target height, then move desk down
lambda: |-
return id(desky_target_height).state < id(desky_height).state;
then:
- switch.turn_on: lower_desk
- wait_until:
#Run until the difference between current and target state is < stopping distance
condition:
lambda: return abs((id(desky_height).state - (id(desky_target_height).state)))<(id(stopping_distance_cm).state);
- switch.turn_off: lower_desk
else:
#Current height is less than target height, move desk up
- switch.turn_on: raise_desk
- wait_until:
condition:
lambda: return abs((id(desky_height).state - (id(desky_target_height).state)))<(id(stopping_distance_cm).state);
#Run until the difference between current and target state is <0.3cm
- switch.turn_off: raise_desk
number:
#Target Height ("Move desk to height x").
#You should probably limit the range you can move the desk to to within the limits you've set via the control panel, perhaps offset a little within the range.
#Sending commands higher/lower than this may cause error messages and require desk reset (or worse).
- platform: template
id: desky_target_height
name: "Desky Target Height"
optimistic: true
unit_of_measurement: cm
min_value: 80
max_value: 130.0
step: 0.1
#Offset correction - Adjust until you get the best accuracy.
#The desk keeps moving for a little while after the up/down pins are released and we try to account for this.
#1.5cm was about right on mine
- platform: template
name: "Desky Stopping Distance cm"
id: stopping_distance_cm
unit_of_measurement: cm
optimistic: true
min_value: 0
max_value: 2
step: 0.1
restore_value: true
initial_value: 1.5
###############################################
#Define some preset heights.
###############################################
#You can freely define as many adjustable presets as you like.
#These are all seperate/independant of what you've set via the control panel (we can't retrieve them currently).
#Standing Height #1 - Set a standing height.
- platform: template
id: desky_standing_height_1
name: "Desky Standing Height 1"
optimistic: true
unit_of_measurement: cm
#Limit the range
min_value: 120
max_value: 130
step: 0.1
restore_value: true
initial_value: 130
#Sitting Height #1 - Set a sitting height. This is independant of what you've set via the control panel.
- platform: template
id: desky_sitting_height_1
name: "Desky Sitting Height 1"
optimistic: true
unit_of_measurement: cm
#Limit the range
min_value: 88.0
max_value: 98.0
step: 0.1
restore_value: true
initial_value: 94.0
switch:
#wake up ther desk and request it sends its height
- platform: gpio
id: wake_desk_and_get_height
name: "Request Desk Height"
pin:
number: D5
inverted: true
on_turn_on:
- delay: 100ms
- switch.turn_off: wake_desk_and_get_height
#Raise the desk
- platform: gpio
id: raise_desk
name: "Raise Desk"
pin:
number: D2
# mode: INPUT_PULLUP
inverted: true
interlock: lower_desk
on_turn_on:
#Auto off after 15s just in case
- delay: 15s
- switch.turn_off: raise_desk
#Lower the desk
- platform: gpio
id: lower_desk
name: "Lower Desk"
pin:
number: D1
# mode: INPUT_PULLUP
inverted: true
interlock: raise_desk
on_turn_on:
#Auto off after 15s just in case
- delay: 15s
- switch.turn_off: lower_desk
Any help is appreciated.
From memory:
- the lower desk switch will just lower the desk while on. If youāre pushing that it may just be lowering to its lowest point?
- if you enter a Desk Target Height and then push the button Go To Desky Height x does it move to the entered position?
You use the height presets like this (put this under button:
). Not sure why I didnāt include that in my example.
#Define as many single press presets like this as you like
button:
- platform: template
name: Move Desky to Sit Height 1
id: desky_move_to_sit_height1
icon: mdi:seat-passenger
on_press:
then:
- lambda: id(my_desky).move_to(int((id(desky_sit_height_1).state) * 10));
- platform: template
name: Move Desky to Stand Height 1
id: desky_move_to_stand_height1
icon: mdi:karate
on_press:
then:
- lambda: id(my_desky).move_to(int((id(desky_stand_height_1).state) * 10));
- platform: template
name: Move Desky to Stow Height 1
id: desky_move_to_stow_height1
icon: mdi:table-chair
on_press:
then:
- lambda: id(my_desky).move_to(int((id(desky_stow_height_1).state) * 10));
You can browse my more advanced config for advanced options.
Thank you. Yes Desk Target height and the button works fine. But what is the slider for then and how can I use it?
See edited post above;)
That did the trick. Thanks so much.
Hello Mahko_Mahko! Sorry to hijack a bit, but I was hoping I could get your attention and perspective on a thread I just created: Need help troubleshooting standing desk
Iād appreciate any help or advice you can offer, thank you!
Thanks to all the contributors of this awesome esphome project.
Just finished my own implementation on D1 mini using the links in this thread. Went the extra mile and printed the box design.
And here is the resulting dashboard.
The only automation for now is to raise the desk at my preferred position based on a schedule helper and input boolean for the days that Iām working from home.
Had the parts to complete this project for a year now. Damn glad I did.
Looking good. Thanks for sharing back!
My favourite routine is āpush-up modeā.
I can sit for a maximum of x min and then it automatically raises (subject to a bunch of constraints). Then I stand as long as I feel like it and repeat.
Hey all
so i followed this guide to setting this up few questions:
my d1 mini seems to require usb power then unplugging to allow 5v to take over so it will not bot if just 5v is supplied
when in esp home the Desky Target Height no matter what i set it just raises it
Desky Height randomly jumps in the thousands i.e 25cm jump to 2551.9cm
####################################################################################################
##Notes/Info
####################################################################################################
## Home Assistant Thread: https://community.home-assistant.io/t/desky-standing-desk/383790/3
## ssieb who generously donated his time and knowledge to developing the custom component may offer some support on the Discord thread (please read both threads first).
## https://discord.com/channels/429907082951524364/952464939480645642
#Notes:
# 1. Use this component at own risk. It has not had extensive testing. May void warranty or cause desk faults etc.
# 2. This controller may bypass desk safety features like collision detection.
# 3. This component doesn't know about the values stored in your desk. Values in this config are (and must be) set independently.
# 4. ssieb's solution may be a lot simpler and cleaner for most people. I've cobbled together some more features in this config because I can't programn in C++.
#Troubleshooting Tips:
#If you ever get a flashing ASr message, you might need to reset your desk.
#https://desky.com.au/blogs/news/reset-standing-desk-control-panel#:~:text=When%20ready%2C%20press%20and%20hold,Hooray!
#TODO
#Ask ssieb to make change requests (move logic to component code)
# Invert pins
# Get Desk Height On Boot
# Interlock Up/Down Pins (If not done already)
# Interrupt/stop movement function (Stop desk motion)
#other
# Test collision detection
# Limit external component fetch to just desky?
# Fix Desk Is moving on Boot.
esphome:
name: desky-d1mini-v2
platform: ESP8266
board: d1_mini #pinout: https://i0.wp.com/randomnerdtutorials.com/wp-content/uploads/2019/05/ESP8266-WeMos-D1-Mini-pinout-gpio-pin.png?quality=100&strip=all&ssl=1
on_boot:
priority: -100.0
then:
#Request a desk height update after boot.
- delay: 5s
- switch.turn_on: wake_desk_and_get_height
logger:
# level: VERY_VERBOSE ##Uncomment to see UART debug messages
external_components:
#Fetch ssieb's custom component# https://github.com/ssieb/custom_components/tree/master/components/desky
- source:
type: git
url: https://github.com/ssieb/custom_components
components: [ desky ]
uart:
- id: desk_uart
baud_rate: 9600
rx_pin: 1 #Labelled TX on my D1mini clone (mislabelled?)
##You can uncomment the debug section below to see UART messages.
# debug:
# direction: RX
# dummy_receiver: true
# after:
# bytes: 4
# sequence:
# - lambda: UARTDebug::log_int(direction, bytes, ',');
desky:
id: my_desky
####################################################################################
##Uncomment this block to use Ssieb's move_to componet function.
up:
number: 4 #D2
inverted: true
down:
number: 5 #D1
inverted: true
request: # optional <pin> config to request height updates at boot
number: 12
inverted: true # probably needed
stopping_distance: 15 # optional distance from target to turn off moving, default 15
timeout: 15s # optional time limit for moving, default is none
# stopping_distance: 15 # optional distance from target to turn off moving, default 15
####################################################################################
height: # Sensor publishing the current height
name: Desky Height
id: desky_height
accuracy_decimals: 1
unit_of_measurement: cm
#any other sensor options
filters:
- delta: 0.05 #Only send values to HA if they change
- throttle: 200ms #Limit values sent to Ha to 5 per sec.
- multiply: 0.1 #convert from mm to cm
on_value:
then:
#If the value changes, then the desk is moving
- binary_sensor.template.publish:
id: desky_is_moving
state: ON
- delay: 300ms
#Assume it's stopped moving if no height changes after a short time.
- binary_sensor.template.publish:
id: desky_is_moving
state: Off
binary_sensor:
- platform: template
id: desky_is_moving
name: Desky moving
lambda: return id(my_desky).current_operation != desky::DESKY_OPERATION_IDLE;
button:
#Stop movement
- platform: template
name: Stop Desk
id: desky_stop_desk
on_press:
then:
- switch.turn_off: raise_desk
- switch.turn_off: lower_desk
#Move to function
- platform: template
name: Go To Desky Height x
id: go_to_desky_preset_height_x
on_press:
then:
##Option 1: Uncomment to use Ssieb's move_to componet functions
# - lambda: id(my_desky).move_to(id(desky_target_height).state*10);
##Option 2: Uncomment to use Mahko's lambda alternative
#Check if we need to move desk up or down from current position
if:
condition:
#Current height is more than target height, then move desk down
lambda: |-
return id(desky_target_height).state < id(desky_height).state;
then:
- switch.turn_on: lower_desk
- wait_until:
#Run until the difference between current and target state is < stopping distance
condition:
lambda: return abs((id(desky_height).state - (id(desky_target_height).state)))<(id(stopping_distance_cm).state);
- switch.turn_off: lower_desk
else:
#Current height is less than target height, move desk up
- switch.turn_on: raise_desk
- wait_until:
condition:
lambda: return abs((id(desky_height).state - (id(desky_target_height).state)))<(id(stopping_distance_cm).state);
#Run until the difference between current and target state is <0.3cm
- switch.turn_off: raise_desk
number:
#Target Height ("Move desk to height x").
#You should probably limit the range you can move the desk to to within the limits you've set via the control panel, perhaps offset a little within the range.
#Sending commands higher/lower than this may cause error messages and require desk reset (or worse).
- platform: template
id: desky_target_height
name: "Desky Target Height"
optimistic: true
unit_of_measurement: cm
min_value: 80
max_value: 130.0
step: 0.1
#Offset correction - Adjust until you get the best accuracy.
#The desk keeps moving for a little while after the up/down pins are released and we try to account for this.
#1.5cm was about right on mine
- platform: template
name: "Desky Stopping Distance cm"
id: stopping_distance_cm
unit_of_measurement: cm
optimistic: true
min_value: 0
max_value: 2
step: 0.1
restore_value: true
initial_value: 1.5
###############################################
#Define some preset heights.
###############################################
#You can freely define as many adjustable presets as you like.
#These are all seperate/independant of what you've set via the control panel (we can't retrieve them currently).
#Standing Height #1 - Set a standing height.
- platform: template
id: desky_standing_height_1
name: "Desky Standing Height 1"
optimistic: true
unit_of_measurement: cm
#Limit the range
min_value: 120
max_value: 130
step: 0.1
restore_value: true
initial_value: 124
#Sitting Height #1 - Set a sitting height. This is independant of what you've set via the control panel.
- platform: template
id: desky_sitting_height_1
name: "Desky Sitting Height 1"
optimistic: true
unit_of_measurement: cm
#Limit the range
min_value: 79.7
max_value: 82
step: 0.1
restore_value: true
initial_value: 79.9
switch:
#wake up ther desk and request it sends its height
- platform: gpio
id: wake_desk_and_get_height
name: "Request Desk Height"
pin:
number: D5
inverted: true
on_turn_on:
- delay: 100ms
- switch.turn_off: wake_desk_and_get_height
#Raise the desk
- platform: gpio
id: raise_desk
name: "Raise Desk"
pin:
number: D2
# mode: INPUT_PULLUP
inverted: true
interlock: lower_desk
on_turn_on:
#Auto off after 15s just in case
- delay: 15s
- switch.turn_off: raise_desk
#Lower the desk
- platform: gpio
id: lower_desk
name: "Lower Desk"
pin:
number: D1
# mode: INPUT_PULLUP
inverted: true
interlock: raise_desk
on_turn_on:
#Auto off after 15s just in case
- delay: 15s
- switch.turn_off: lower_desk
Hello. Could you please try to rephrase and clarify your issues and situation please?
I canāt quite follow it.
sorry life was busy there
ok so i have wired a d1mini up as your guide shows my main issue is its not getting powered by the ethernet out any suggestions