Yeah I think I agree that your approach “is probably easier” for a beginner. Especially now you have it as an external component, your config is very tight, and your docs are tidy;)
Probably part of me just wanted to tinker too;) And well I could support the yaml based one but not your cpp one if you aren’t so active on it ( my cpp skills are limited).
I’ve linked your project in my OP now. Thanks for contributing to this thread;)
If you have the same desk as described in the blog article I mentioned… I can’t promise it but I’m very positive.
So as you already have the d1 mini all you need is an (old) landline phone cable and you could just give it a shot.
But just to be sure: no warranties! Don’t mix up plus and minus
Yes, i will add some photos here and i also found the controll box on the site from jiecang I have an RJ45 cable but just for that you can confirm this i will also add a photo. @Rocka84 thank you also for your answer, here are the information you asked for
Additional i allready have the D1 mini and also two RJ45 female breakout connectors so that i can plug in the RJ45 cable from the button-thing and have then screws to connect wires then i dont have to cut the original cable
If your control box has both (like 1st two photo’s below), you’re probably better off using the RJ12 port for your smart control and building a dongle for that and then probably just use Rocka84’s project.
If you only have a RJ45 port, probably you should build a pass-through dongle.
From what I can see it looks good to go!
Next step I would flash a basic ESPHome config via usb and then make sure it powers on ok when plugged into the port.
I had some poor quality RJ12 cables which caused me power issues.
I now have made a new device in ESPHome and edited like this:
esphome:
name: ergotopia-david1
friendly_name: ergotopia-david1
on_boot:
# don't touch if you don't know what you're doing!
priority: 0 # when mostly everything else is done
then:
- lambda: "id(my_desk).request_physical_limits();"
- delay: 0.1s # give controller a chance to handle the response before sending the next command
- lambda: "id(my_desk).request_limits();"
- delay: 0.1s
- lambda: "id(my_desk).request_settings();"
external_components:
- source:
type: git
url: https://github.com/Rocka84/esphome_components/
components: [ jiecang_desk_controller ]
uart:
id: uart_bus
tx_pin: TX
rx_pin: RX
baud_rate: 9600
# Enable logging
logger:
baud_rate: 0 # disable logging over uart, required when using the RX/TX pins for the controller
# see full example for more options: https://github.com/Rocka84/esphome_components/blob/a083c17882361c58071b85d45587c410582cda75/example_jiecang_desk_controller.yaml
jiecang_desk_controller:
id: my_desk
buttons:
raise:
name: "Raise"
lower:
name: "Lower"
stop:
name: "Stop"
position1:
name: "Position 1"
position2:
name: "Position 2"
position3:
name: "Position 3"
position4:
name: "Position 4"
numbers:
height:
name: "Height"
# the usual stuff
esp8266:
board: esp01_1m
# Enable Home Assistant API
api:
encryption:
key: "KEY"
ota:
password: "PASSWORD"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Ergotopia-David1"
password: "PASSWORD"
captive_portal:
that should be right? then i just have to flash the device like described in the esp home tutorials by connecting it to my raspberry from home assistant and then it should be found as device, add API Key and should work?
In your screenshot the height input is empty. Does it stay like that or does is show the correct height later on? And when you enter a value by hand, does the desk go to that height?
Yes, that’s by design - at least for now. Maybe I should have called them “Step up” and “Step down”.
As for a continuous movement, I already had some code for that in one of the iterations - but removed it shortly after. The problem was that you can’t stop that movement with the physical buttons on the controller. Imagine clicking down in home assistant, realizing that the desk would crush something and then not being able to stop the desk from its controller. Instead you have to search your phone and click ‘stop’ there. I didn’t want to be responsible for that risk.
We’ll see what @Rocka84 reckons, but I suspect if we confirm if you are recieving any uart data on your rx by adding this to your config then that would be useful debugging info.
uart:
tx_pin: Xxxxx
rx_pin: Xxxxx
baud_rate: 9600
debug:
direction: BOTH
dummy_receiver: true
after:
delimiter: [0x7E]
# timeout: 5ms
sequence:
# Use mulcmu's method for reading uart without a custome component: https://community.home-assistant.io/t/how-to-uart-read-without-custom-component/491950?u=mahko_mahko
- lambda: |-
UARTDebug::log_int(direction, bytes, ','); // Log the message as int. Good for height message checks.
UARTDebug::log_hex(direction, bytes, ','); // Log the message in hex. Good for checking against protocol documentation.
Add the extra config, move the desk, and then post your logs.
So that idea was even better than I initially realized
In hindsight I should have thought of that much earlier. So thanks @Mahko_Mahko!
And I already implemented it as well:
Changes:
added buttons and lambdas for moving the desk up or down until stopped
move_up and move_down
renamed raise to step_up and lower to step_down
raise and lower are still supported but deprecated and undocumented
Hi! I’m attempting this project for the first time and had a quick question. The ESP8266 board that I bought has a 3V instead of 5V power pin. Is this going to cause issues with connecting the RJ12 port?