j5lien / esphome-idasen-desk-controller

ESPHome component for Ikea Idasen desk control
MIT License
187 stars 36 forks source link

Desk move down only and doesn't move up #43

Closed amaharek closed 2 years ago

amaharek commented 2 years ago

In Home assistant the Up button is grey (disabled).

esphome:
  name: idasen

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Idasen Fallback Hotspot"
    password: "ym47kfFy6eEl"

external_components:
  - source: github://j5lien/esphome-idasen-desk-controller@v3.0.0

esp32_ble_tracker:

ble_client:
  - mac_address: "D9:B7:84:82:99:0F"
    id: idasen_desk

idasen_desk_controller:
  ble_client_id: idasen_desk
  only_up_down_command: false

cover:
  - platform: idasen_desk_controller
    name: "Desk"
INFO Reading configuration /config/esphome/idasen.yaml...
INFO Generating C++ source...
INFO Compiling app...
Processing idasen (board: esp32dev; framework: arduino; platform: platformio/espressif32 @ 3.5.0)
--------------------------------------------------------------------------------
HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- <WiFi> 1.0
|-- <ESPmDNS> 1.0
|-- <Update> 1.0
Compiling /data/idasen/.pioenvs/idasen/src/main.cpp.o
Linking /data/idasen/.pioenvs/idasen/firmware.elf
RAM:   [==        ]  16.2% (used 53008 bytes from 327680 bytes)
Flash: [========  ]  79.4% (used 1456298 bytes from 1835008 bytes)
Building /data/idasen/.pioenvs/idasen/firmware.bin
esp32_create_combined_bin(["/data/idasen/.pioenvs/idasen/firmware.bin"], ["/data/idasen/.pioenvs/idasen/firmware.elf"])
Wrote 0x173910 bytes to file /data/idasen/.pioenvs/idasen/firmware-factory.bin, ready to flash to offset 0x0
========================= [SUCCESS] Took 13.20 seconds =========================
INFO Successfully compiled program.
esptool.py v3.2
Serial port /dev/ttyUSB0
Connecting.........................
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 58:bf:25:93:5d:ec
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 460800
Changed.
Configuring flash size...
Auto-detected Flash size: 4MB
Flash will be erased from 0x00010000 to 0x00173fff...
Flash will be erased from 0x00001000 to 0x00005fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x0000e000 to 0x0000ffff...
Compressed 1456400 bytes to 875531...
Wrote 1456400 bytes (875531 compressed) at 0x00010000 in 20.7 seconds (effective 564.1 kbit/s)...
Hash of data verified.
Compressed 17104 bytes to 11191...
Wrote 17104 bytes (11191 compressed) at 0x00001000 in 0.6 seconds (effective 221.8 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 144...
Wrote 3072 bytes (144 compressed) at 0x00008000 in 0.1 seconds (effective 332.4 kbit/s)...
Hash of data verified.
Compressed 8192 bytes to 47...
Wrote 8192 bytes (47 compressed) at 0x0000e000 in 0.1 seconds (effective 454.9 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...
INFO Successfully uploaded program.
INFO Starting log output from /dev/ttyUSB0 with baud rate 115200
[14:44:54][I][logger:214]: Log initialized
[14:44:54][C][ota:461]: There have been 9 suspected unsuccessful boot attempts.
[14:44:54][D][esp32.preferences:114]: Saving preferences to flash...
[14:44:54][I][app:029]: Running through setup()...
[14:44:55][D][esp32_ble_tracker:217]: Starting scan...
[14:44:55][C][wifi:037]: Setting up WiFi...
[14:44:55][D][wifi:373]: Starting scan...
[14:44:56][D][esp32_ble_tracker:723]: Found device FC:59:9D:EE:EF:78 RSSI=-86
[14:44:56][D][esp32_ble_tracker:744]:   Address Type: RANDOM
[14:44:56][D][ble_client:047]: Found device at MAC address [D9:B7:84:82:99:0F]
[14:44:56][I][ble_client:085]: Attempting BLE connection to d9:b7:84:82:99:0f
[14:44:56][I][idasen_desk_controller:042]: [Desk] Connected successfully!
[14:44:58][I][ble_client:161]: Service UUID: 0x1800
[14:44:58][I][ble_client:162]:   start_handle: 0x1  end_handle: 0x9
[14:44:58][I][ble_client:347]:  characteristic 0x2A00, handle 0x3, properties 0xa
[14:44:58][I][ble_client:347]:  characteristic 0x2A01, handle 0x5, properties 0x2
[14:44:58][I][ble_client:347]:  characteristic 0x2A04, handle 0x7, properties 0x2
[14:44:58][I][ble_client:347]:  characteristic 0x2AA6, handle 0x9, properties 0x2
[14:44:58][I][ble_client:161]: Service UUID: 0x1801
[14:44:58][I][ble_client:162]:   start_handle: 0xa  end_handle: 0xd
[14:44:58][I][ble_client:347]:  characteristic 0x2A05, handle 0xc, properties 0x20
[14:44:58][I][ble_client:161]: Service UUID: 99FA0001-338A-1024-8A49-009C0215F78A
[14:44:58][I][ble_client:162]:   start_handle: 0xe  end_handle: 0x13
[14:44:58][I][ble_client:347]:  characteristic 99FA0002-338A-1024-8A49-009C0215F78A, handle 0x10, properties 0xc
[14:44:58][I][ble_client:347]:  characteristic 99FA0003-338A-1024-8A49-009C0215F78A, handle 0x12, properties 0x12
[14:44:58][I][ble_client:161]: Service UUID: 99FA0010-338A-1024-8A49-009C0215F78A
[14:44:58][I][ble_client:162]:   start_handle: 0x14  end_handle: 0x17
[14:44:58][I][ble_client:347]:  characteristic 99FA0011-338A-1024-8A49-009C0215F78A, handle 0x16, properties 0x1e
[14:44:58][I][ble_client:161]: Service UUID: 99FA0020-338A-1024-8A49-009C0215F78A
[14:44:58][I][ble_client:162]:   start_handle: 0x18  end_handle: 0x1f
[14:44:58][I][ble_client:347]:  characteristic 99FA0021-338A-1024-8A49-009C0215F78A, handle 0x1a, properties 0x12
[14:44:58][I][ble_client:347]:  characteristic 99FA0029-338A-1024-8A49-009C0215F78A, handle 0x1d, properties 0x2
[14:44:58][I][ble_client:347]:  characteristic 99FA002A-338A-1024-8A49-009C0215F78A, handle 0x1f, properties 0x2
[14:44:58][I][ble_client:161]: Service UUID: 99FA0030-338A-1024-8A49-009C0215F78A
[14:44:58][I][ble_client:162]:   start_handle: 0x20  end_handle: 0xffff
[14:44:58][I][ble_client:347]:  characteristic 99FA0031-338A-1024-8A49-009C0215F78A, handle 0x22, properties 0xc
[14:44:58][D][esp32_ble_tracker:217]: Starting scan...
[14:44:58][D][wifi:388]: Found networks:
[14:44:58][I][wifi:432]: - 'XXXXXXXX-XXXX' (60:CE:86:BF:7A:47) [redacted]▂▄▆█
[14:44:58][D][wifi:433]:     Channel: 13
[14:44:58][D][wifi:434]:     RSSI: -44 dB
[14:44:58][D][wifi:437]: - '826 The Gates'[redacted] (02:AA:3F:AA:22:22) [redacted]▂▄▆█
[14:44:58][D][wifi:437]: - ''[redacted] (02:AA:3F:AA:22:21) [redacted]▂▄▆█
[14:44:58][D][wifi:437]: - ''[redacted] (96:9A:4A:94:C3:2B) [redacted]▂▄▆█
[14:44:58][D][wifi:437]: - 'VM9892009'[redacted] (90:9A:4A:94:C3:2B) [redacted]▂▄▆█
[14:44:58][D][wifi:437]: - 'Horizon Wi-Free'[redacted] (AE:F8:CC:08:52:15) [redacted]▂▄▆█
[14:44:58][D][wifi:437]: - ''[redacted] (02:5F:67:E9:DE:C8) [redacted]▂▄▆█
[14:44:58][D][wifi:437]: - 'TP-Link_79B8'[redacted] (00:5F:67:D9:DE:C8) [redacted]▂▄▆█
[14:44:58][I][wifi:248]: WiFi Connecting to 'XXXXXXXX-XXXX'...
[14:44:59][D][esp32_ble_tracker:723]: Found device 57:20:94:25:5A:40 RSSI=-94
[14:44:59][D][esp32_ble_tracker:744]:   Address Type: RANDOM
[14:44:59][D][esp32_ble_tracker:748]:   TX Power: 2
[14:45:00][D][esp32_ble_tracker:723]: Found device C1:69:99:B1:40:17 RSSI=-91
[14:45:00][D][esp32_ble_tracker:744]:   Address Type: RANDOM
[14:45:01][D][esp32_ble_tracker:723]: Found device 6D:BF:B2:BA:F8:8D RSSI=-78
[14:45:01][D][esp32_ble_tracker:744]:   Address Type: RANDOM
[14:45:01][D][esp32_ble_tracker:748]:   TX Power: 2
[14:45:01][I][wifi:505]: WiFi Connected!
[14:45:01][C][wifi:353]:   Local MAC: 58:BF:25:93:5D:EC
[14:45:01][C][wifi:354]:   SSID: 'XXXXXXXX-XXXX'[redacted]
[14:45:01][C][wifi:355]:   IP Address: 192.168.1.16
[14:45:01][C][wifi:357]:   BSSID: 60:CE:86:BF:7A:47[redacted]
[14:45:01][C][wifi:358]:   Hostname: 'idasen'
[14:45:01][C][wifi:360]:   Signal strength: -43 dB ▂▄▆█
[14:45:01][C][wifi:364]:   Channel: 13
[14:45:01][C][wifi:365]:   Subnet: 255.255.255.0
[14:45:01][C][wifi:366]:   Gateway: 192.168.1.1
[14:45:01][C][wifi:367]:   DNS1: 192.168.1.1
[14:45:01][C][wifi:368]:   DNS2: 0.0.0.0
[14:45:01][D][wifi:514]: Disabling AP...
[14:45:01][C][ota:085]: Over-The-Air Updates:
[14:45:01][C][ota:086]:   Address: idasen.local:3232
[14:45:01][C][ota:089]:   Using Password.
[14:45:01][W][ota:095]: Last Boot was an unhandled reset, will proceed to safe mode in 1 restarts
[14:45:01][C][api:025]: Setting up Home Assistant API server...
[14:45:01][C][idasen_desk_controller:019]: Setting up Idasen Desk Controller...
[14:45:01][I][app:062]: setup() finished successfully!
[14:45:01][I][app:102]: ESPHome version 2022.2.6 compiled on Mar  7 2022, 14:44:12
[14:45:01][C][wifi:491]: WiFi:
[14:45:01][C][wifi:353]:   Local MAC: 58:BF:25:93:5D:EC
[14:45:01][C][wifi:354]:   SSID: 'XXXXXXXX-XXXX'[redacted]
[14:45:01][C][wifi:355]:   IP Address: 192.168.1.16
[14:45:01][C][wifi:357]:   BSSID: 60:CE:86:BF:7A:47[redacted]
[14:45:01][C][wifi:358]:   Hostname: 'idasen'
[14:45:01][C][wifi:360]:   Signal strength: -44 dB ▂▄▆█
[14:45:01][C][wifi:364]:   Channel: 13
[14:45:01][C][wifi:365]:   Subnet: 255.255.255.0
[14:45:01][C][wifi:366]:   Gateway: 192.168.1.1
[14:45:01][C][wifi:367]:   DNS1: 192.168.1.1
[14:45:01][C][wifi:368]:   DNS2: 0.0.0.0
[14:45:01][C][logger:233]: Logger:
[14:45:01][C][logger:234]:   Level: DEBUG
[14:45:01][C][logger:235]:   Log Baud Rate: 115200
[14:45:01][C][logger:236]:   Hardware UART: UART0
[14:45:01][C][esp32_ble_tracker:709]: BLE Tracker:
[14:45:01][C][esp32_ble_tracker:710]:   Scan Duration: 300 s
[14:45:01][C][esp32_ble_tracker:711]:   Scan Interval: 320.0 ms
[14:45:01][C][esp32_ble_tracker:712]:   Scan Window: 30.0 ms
[14:45:01][C][esp32_ble_tracker:713]:   Scan Type: ACTIVE
[14:45:01][C][ble_client:035]: BLE Client:
[14:45:01][C][ble_client:036]:   Address: d9:b7:84:82:99:0f
[14:45:01][C][mdns:084]: mDNS:
[14:45:01][C][mdns:085]:   Hostname: idasen
[14:45:01][C][ota:085]: Over-The-Air Updates:
[14:45:01][C][ota:086]:   Address: idasen.local:3232
[14:45:01][C][ota:089]:   Using Password.
[14:45:01][W][ota:095]: Last Boot was an unhandled reset, will proceed to safe mode in 1 restarts
[14:45:01][C][api:138]: API Server:
[14:45:01][C][api:139]:   Address: idasen.local:6053
[14:45:01][C][api:143]:   Using noise encryption: NO
[14:45:01][C][idasen_desk_controller:024]: Idasen Desk Controller:
[14:45:02][C][idasen_desk_controller:025]:   MAC address        : d9:b7:84:82:99:0f
[14:45:02][C][idasen_desk_controller:026]:   Notifications      : enable
[14:45:02][C][idasen_desk_controller:027]:   Desk 'Desk'
[14:45:02][D][esp32_ble_tracker:723]: Found device 42:60:82:ED:EC:DB RSSI=-94
[14:45:02][D][esp32_ble_tracker:744]:   Address Type: RANDOM
[14:45:02][D][esp32_ble_tracker:748]:   TX Power: 2
[14:45:02][D][api:102]: Accepted ::FFFF:C0A8:114
[14:45:02][D][api.connection:826]: Home Assistant 2022.3.1 (::FFFF:C0A8:114): Connected successfully
[14:45:03][D][cover:172]: 'Desk' - Publishing:
[14:45:03][D][cover:175]:   Position: 100%
[14:45:03][D][cover:188]:   Current Operation: OPENING
[14:45:05][D][cover:172]: 'Desk' - Publishing:
[14:45:05][D][cover:175]:   Position: 100%
[14:45:05][D][cover:188]:   Current Operation: OPENING
[14:45:08][D][esp32_ble_tracker:723]: Found device DD:5D:45:67:89:DD RSSI=-84
[14:45:08][D][esp32_ble_tracker:744]:   Address Type: RANDOM
[14:45:11][D][cover:172]: 'Desk' - Publishing:
[14:45:11][D][cover:175]:   Position: 0%
[14:45:11][D][cover:188]:   Current Operation: CLOSING
[14:45:11][D][cover:172]: 'Desk' - Publishing:
[14:45:11][D][cover:175]:   Position: 100%
[14:45:11][D][cover:188]:   Current Operation: OPENING
[14:45:11][D][cover:172]: 'Desk' - Publishing:
[14:45:11][D][cover:175]:   Position: 100%
[14:45:11][D][cover:188]:   Current Operation: OPENING
[14:45:11][D][cover:172]: 'Desk' - Publishing:
[14:45:11][D][cover:175]:   Position: 100%
[14:45:11][D][cover:188]:   Current Operation: OPENING
[14:45:11][D][cover:172]: 'Desk' - Publishing:
[14:45:11][D][cover:175]:   Position: 100%
[14:45:11][D][cover:188]:   Current Operation: OPENING
[14:45:16][D][esp32_ble_tracker:723]: Found device 64:E0:03:CC:5A:80 RSSI=-77
[14:45:16][D][esp32_ble_tracker:744]:   Address Type: PUBLIC

Screenshot from 2022-03-07 14-55-51

amaharek commented 2 years ago

@j5lien appreciate your help, the desk is now stuck at very low level

amaharek commented 2 years ago

sorted by going all the way down to the very bottom