Comments (31)
@leukanos at least you progressed 3 handles! π
does anybody know if it is possible to use esphome at the pull requests head?
(esphome/esphome#3320)
I think I'll try the pull request out with my installation (guide)
from esphome-idasen-desk-controller.
Looking at the documentation for BLE error codes:
Status | Status Hex | Description |
---|---|---|
5 | 0x05 | BLE_HCI_AUTHENTICATION_FAILURE |
Seems to be some sort of authentication failure. Any idea why? I pressed the pairing button, maybe I could also try completely resetting the desk
from esphome-idasen-desk-controller.
hmm so its nothing new then, where did u get your esp 32 i got mine off amazon it may be the ble chip (which i doubt)
from esphome-idasen-desk-controller.
Unfortunately we have not found a fix yet. But please send your progress here so others donβt have the same issue
from esphome-idasen-desk-controller.
See below for what I'm running currently. This is running on ESPHome 2022.3.2. I have 2 external_components
setup:
- My fork of this repository, which I've enhanced (or fixed?) the ability to auto drive on the desks that don't have auto drive. For example, when the component received a request to go to a certain position, it was sending that to the desk and the desk would start moving, but it would only move a couple of inches at most and then stop. But the component didn't attempt to continue sending the command even though it could see that it wasn't at the right position. I'm not sure if this was intentional or not...but regardless, I can auto drive my desk now. I still need to figure out the calibration though because I'm pretty sure the numbers are off, but I haven't measured. Also there are some edge cases where I've found that it gets stuck in the loop continuously sending the command to move, but the desk doesn't move. However because the ESP keeps sending the command, the paddle on the desk becomes non-responsive until I restart the ESP (and maybe the desk). Also, I think when the desk is moving, there are a lot of updates that come through, but I don't think all of them make it to home assistant. The buffer of queued messages gets too full. So for example, on my home assistant card I have a stand position at 117cm and if I press it, the desk does it's thing and it does in fact make it to the position, but home assistant may get the last update at like 115cm. A quick tap of the paddle that effectively doesn't move the desk much causes one more update to run through and home assistant shows it at 117cm.
- The PR I had submitted to ESPHome, which I believe is in the 2022.4.0b1 release
esphome:
name: office-desk-controller-frontier
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
level: INFO
# Enable Home Assistant API
api:
ota:
password: !secret ota_password
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Office-Desk-Controller-Frontier"
password: !secret ap_password
captive_portal:
external_components:
- source: github://ammmze/esphome-idasen-desk-controller@make-it-work
- source: github://pr#3320
components:
# list all components modified by this Pull Request here
- ble_client
- esp32_ble_tracker
globals:
# To store the Desk Connection Status
- id: ble_client_connected
type: bool
initial_value: 'false'
esp32_ble_tracker:
ble_client:
- mac_address: "00:00:00:00:00:00" # Replace with the desk bluetooth mac address
id: idasen_desk
on_connect:
then:
# Update the Desk Connection Status
- lambda: |-
id(ble_client_connected) = true;
- delay: 5s
# Update desk height and speed sensors after bluetooth is connected
- lambda: |-
id(desk_height).update();
id(desk_speed).update();
on_disconnect:
then:
# Update the Desk Connection Status
- lambda: |-
id(ble_client_connected) = false;
idasen_desk_controller:
# Reference to the ble client component id
# -----------
# Required
ble_client_id: idasen_desk
# Fallback to use only up and down commands (less precise)
# -----------
# Optional
only_up_down_command: false
cover:
- platform: idasen_desk_controller
name: "Office Desk"
sensor:
# Desk Height Sensor
- platform: ble_client
ble_client_id: idasen_desk
id: desk_height
name: 'Office Desk Height'
service_uuid: '99fa0020-338a-1024-8a49-009c0215f78a'
characteristic_uuid: '99fa0021-338a-1024-8a49-009c0215f78a'
icon: 'mdi:arrow-up-down'
unit_of_measurement: 'cm'
accuracy_decimals: 1
update_interval: never
notify: true
# filters:
# - debounce: 0.5s
lambda: |-
uint16_t raw_height = ((uint16_t)x[1] << 8) | x[0];
unsigned short height_mm = raw_height / 10;
return (float) height_mm / 10;
# Desk Speed Sensor
- platform: ble_client
ble_client_id: idasen_desk
id: desk_speed
name: 'Office Desk Speed'
service_uuid: '99fa0020-338a-1024-8a49-009c0215f78a'
characteristic_uuid: '99fa0021-338a-1024-8a49-009c0215f78a'
icon: 'mdi:speedometer'
unit_of_measurement: 'cm/min' # I'm not sure this unit is correct
accuracy_decimals: 0
update_interval: never
notify: true
# filters:
# - debounce: 0.5s
lambda: |-
uint16_t raw_speed = ((uint16_t)x[3] << 8) | x[2];
return raw_speed / 100;
binary_sensor:
# Desk Bluetooth Connection Status
- platform: template
name: 'Office Desk Connection'
id: desk_connection
lambda: 'return id(ble_client_connected);'
# Desk Moving Status
- platform: template
name: 'Office Desk Moving'
id: desk_moving
lambda: 'return id(desk_speed).state > 0;'
from esphome-idasen-desk-controller.
hey did you get a fix for this?
from esphome-idasen-desk-controller.
I didn't! If you have any additional information though, please let me know!
from esphome-idasen-desk-controller.
I was thinking maybe the desk is asking for a code but esphome does not support codes yet
If there was a code Iβd would be 0000 or 1111
from esphome-idasen-desk-controller.
mmmh, that could be a reason but I wouldn't think so, this is working for so many other people
what kind of board are you using?
from esphome-idasen-desk-controller.
esp 32 and my table is a new idasen
from esphome-idasen-desk-controller.
Okay, I bought mine in september 2020 π€
from esphome-idasen-desk-controller.
Got the same errors in the log unfortunately. Was working with 1.2.3 until a few days ago but now neither 3.0.0. nur 1.2.3 is working.
from esphome-idasen-desk-controller.
@j5lien can you please look into this?
from esphome-idasen-desk-controller.
Happens to me, too.
Workaround:
- add v1.2.3 with the accompanying config and install
- overwrite with the 3.0.0 config
Sensors are not updating, though...
from esphome-idasen-desk-controller.
I have the same issue :(
I was thinking maybe the desk is asking for a code but esphome does not support codes yet If there was a code Iβd would be 0000 or 1111
I don't think this is the case, since when pairing the desk to my phone it didn't ask for any pairing code
from esphome-idasen-desk-controller.
Workaround:
- add v1.2.3 with the accompanying config and install
- overwrite with the 3.0.0 config
Sensors are not updating, though...
In my case workaround doesn't help. Actually, it helps for a moment, and then I get the same error.
from esphome-idasen-desk-controller.
Happens to me, too.
Workaround:
1. add v1.2.3 with the accompanying config and install 2. overwrite with the 3.0.0 config
Sensors are not updating, though...
In the end, I tried this yesterday, and it worked! I've used v1.2.2, because v1.2.3 did not work for me. Saw this workaround originally here and followed its steps.
It is working since yesterday, both moving the desk and reading the sensors
To do the initial pairing with the desk used the following config:
esphome:
name: ********* <- put the desired name here
platform: ESP32
board: esp32dev
libraries:
- "ESP32 BLE Arduino"
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: ***************************************
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "*********"
password: "**************"
captive_portal:
external_components:
- source: github://j5lien/[email protected]
idasen_desk_controller:
mac_address: "**:**:**:**:**:**"
cover:
- platform: idasen_desk_controller
name: "Desk"
Once paired successfully, used the following config:
esphome:
name: ********* <- put the desired name here
esp32:
board: esp32dev
framework:
type: arduino
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: ***************************************
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: *********************
password: *********************
captive_portal:
external_components:
- source: github://j5lien/[email protected]
esp32_ble_tracker:
globals:
# To store the Desk Connection Status
- id: ble_client_connected
type: bool
initial_value: 'false'
ble_client:
- mac_address: "**:**:**:**:**:**"
id: idasen_desk
on_connect:
then:
# Update the Desk Connection Status
- lambda: |-
id(ble_client_connected) = true;
- delay: 5s
# Update desk height and speed sensors after bluetooth is connected
- lambda: |-
id(desk_height).update();
id(desk_speed).update();
on_disconnect:
then:
# Update the Desk Connection Status
- lambda: |-
id(ble_client_connected) = false;
idasen_desk_controller:
ble_client_id: idasen_desk
only_up_down_command: false
cover:
- platform: idasen_desk_controller
name: "Desk"
sensor:
# Desk Height Sensor
- platform: ble_client
ble_client_id: idasen_desk
id: desk_height
name: 'Desk Height'
service_uuid: '99fa0020-338a-1024-8a49-009c0215f78a'
characteristic_uuid: '99fa0021-338a-1024-8a49-009c0215f78a'
icon: 'mdi:arrow-up-down'
unit_of_measurement: 'cm'
accuracy_decimals: 1
update_interval: never
notify: true
lambda: |-
uint16_t raw_height = ((uint16_t)x[1] << 8) | x[0];
unsigned short height_mm = raw_height / 10;
return (float) height_mm / 10;
# Desk Speed Sensor
- platform: ble_client
ble_client_id: idasen_desk
id: desk_speed
name: 'Desk Speed'
service_uuid: '99fa0020-338a-1024-8a49-009c0215f78a'
characteristic_uuid: '99fa0021-338a-1024-8a49-009c0215f78a'
icon: 'mdi:speedometer'
unit_of_measurement: 'cm/min' # I'm not sure this unit is correct
accuracy_decimals: 0
update_interval: never
notify: true
lambda: |-
uint16_t raw_speed = ((uint16_t)x[3] << 8) | x[2];
return raw_speed / 100;
binary_sensor:
# Desk Bluetooth Connection Status
- platform: template
name: 'Desk Connection'
id: desk_connection
lambda: 'return id(ble_client_connected);'
# Desk Moving Status
- platform: template
name: 'Desk Moving'
id: desk_moving
lambda: 'return id(desk_speed).state > 0;'
from esphome-idasen-desk-controller.
Thanks for sharing. I'll try this approach.
from esphome-idasen-desk-controller.
Reading sensors works, for now, however moving is not :(
I'll see if it keep working over longer period of time
from esphome-idasen-desk-controller.
And it got disconnected after 2 days and doesn't connect anymore...
[W][idasen_desk_controller:104]: Error reading char at handle 29, status=5
[W][ble_sensor:082]: Error reading char at handle 29, status=5
[W][ble_sensor:082]: Error reading char at handle 29, status=5
[W][idasen_desk_controller:104]: Error reading char at handle 29, status=5
[W][ble_sensor:082]: Error reading char at handle 29, status=5
[W][ble_sensor:082]: Error reading char at handle 29, status=5
π€ for @ammmze PR mentioned above
from esphome-idasen-desk-controller.
I did pretty much what andrethrill said in the comment below me. Things work, but the sensors don't :/ I'm using Adafruit ESP32 feather board if that's any help. The controls don't work for down (up and stop do), but the automation does (because it's behaving like a curtain).
from esphome-idasen-desk-controller.
@leukanos at least you progressed 3 handles! π
does anybody know if it is possible to use esphome at the pull requests head?
(esphome/esphome#3320)I think I'll try the pull request out with my installation (guide)
ππ» Let us know how it goes. Hopefully it gets things rolling. While I got mine paired and from the logs it looks pretty good, I did notice some quirks in home assistant. Often I would be manually raising and lowering the desk and the speed and other statuses would get stuck showing it in motion (i.e. having a positive speed value greater than 0), however in the esphome logs I did see 0 as the last speed. So I wonder if esphome is throttling the messages to esphome and dropping some of them. Regardless, I think it's a separate issue that we can dig into more once we are successful in the pairing process.
Edit: Ah...yea...looks like the reason why home assistant doesn't always see the final state is because there's not enough buffer space to store all the messages that get produced when moving the desk up/down.
[10:43:45][V][api.connection:893]: Cannot send message because of TCP buffer space
from esphome-idasen-desk-controller.
Iβm also seeing this issue. I just got a new desk, partly because I wanted to automate it with this project π
Is there anything I can do to test/debug? It isnβt clear from reading the thread if there are any leads to follow up on.
Otherwise Iβll do my own investigation
from esphome-idasen-desk-controller.
small update from me:
-
I've updated my esphome in home assistant to this version (look at these release notes, they changed the install method: https://esphome.io/changelog/2022.2.0.html)
-
it worked for a bit, but the card showed wrong values so i tinkered a bit with the configuration. The reported height is correct now, but the connection status is false and sometimes it randomly stops working - I haven't found out why yet.
-
I'll post my configuration here later, probably tomorrow. I'll also continue to look into why the bugs are still occuring
from esphome-idasen-desk-controller.
well thanks to you this is the first time HA moved my desk
from esphome-idasen-desk-controller.
@ammmze Neat! I also tried this config out and it seems to partially work. I can now move the desk up and down with Home Assistant. However, the sensors don't seem to be updating. I don't need them for now, it isn't quite as nice but I can work with a cover percentage in Home Assistant so I just removed them for now. My more minimal config therefore look like...
external_components:
- source: github://ammmze/esphome-idasen-desk-controller@make-it-work
- source: github://pr#3320
components:
- ble_client
- esp32_ble_tracker
substitutions:
nicename: Study
devicename: study
esphome:
name: ${devicename}
platform: ESP32
board: esp32dev
# Enable logging
logger:
level: INFO
# Enable Home Assistant API
api:
ota:
password: "***************************************"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
esp32_ble_tracker:
ble_client:
- mac_address: "00:00:00:00:00:00" # Replace with the desk bluetooth mac address
id: idasen_desk
idasen_desk_controller:
ble_client_id: idasen_desk
only_up_down_command: false
cover:
- platform: idasen_desk_controller
name: "Study Desk"
from esphome-idasen-desk-controller.
@d0ugal the first time I loaded it in the sensors did not update but then I unplugged it and plugged it back in (the esp) and itβs working
from esphome-idasen-desk-controller.
Good point, the height did seem to update once after restart. It didn't seem to update after that but I'll do some experimentation.
from esphome-idasen-desk-controller.
@d0ugal Did you ever get a chance to do some experimenting? I'm getting the same thing where the sensors are updated when the ESP first boots up but never again.
Update: Slightly frustratingly the sensors seem to have started updating for me now and I'm not really sure why. The main thing I did before they started working was pair the desk to my computer using Bluetility (it's a mac app but I'm sure sure there are similar ones for other platforms) and subscribed to height changes there. Then I turned off bluetooth for my computer and my phone which I've previously connected to the desk and restarted the ESP holding down the pairing button on the physical desk control. I've restarted the ESP and unplugged and replugged in my desk many times at that point so I'm assuming it was something to do with the pairing and unpairing that did it rather than just the restarting but honestly I don't really have any idea what happened π€·ββοΈ
from esphome-idasen-desk-controller.
@callumgare I had some problems until 4.0.0 was released. Since then it has worked fine and I don't get the issue anymore. My full config is now the following;
external_components:
- source: github://j5lien/[email protected]
substitutions:
name: study-desk
esphome:
name: ${name}
platform: ESP32
board: esp32dev
esp32_ble_tracker:
ble_client:
- mac_address: "00:00:00:00:00:00" # Replace with the desk bluetooth mac address
id: idasen_desk
idasen_desk_controller:
ble_client_id: idasen_desk
only_up_down_command: false
cover:
- platform: idasen_desk_controller
name: "Study Desk"
# These just include some common things like wifi details that I share between devices. Nothing speicifc to the desk.
<<: !include .common.yaml
<<: !include .atom-identify.yaml
from esphome-idasen-desk-controller.
Thanks for that @d0ugal!
from esphome-idasen-desk-controller.
Related Issues (20)
- Desk Panel DPG1C connection not stable
- Desk not moving / Error reading char at handle 26, status=5 HOT 1
- Are you open to being sponsord? HOT 2
- Port to new Bluetooth integration HOT 5
- Second Desk HOT 1
- Error when installing component. HOT 6
- Installation of the cover component does not work
- new esphome version breaks compilation HOT 2
- Update compatibility HOT 2
- Down Button not working HOT 2
- ESP32 keeps crashing on ESPHome 2022.11.2 HOT 1
- [Wemos ESP32 Mini] A working ESPHome yaml example with some adjustments. (Ikea Idasen Liank DL110)
- unable to move after a while HOT 4
- DPG1C woes: cannot move using Cover and wrong sensor height HOT 1
- updating firmware of the controller HOT 1
- Disconnections & not fully responding to requests
- Error sending write request for cover, status=259
- Height is received only at startup HOT 1
- cover.stop_cover service not supported HOT 1
- base hight?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from esphome-idasen-desk-controller.