esphome: name: jiecang-desk-controller friendly_name: Jiecang Desk Controller on_boot: # This script is required to initialize the following sensors: # height_pct, height_min, height_max, position1 - position4 # You can skip this if you don't use those. 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 logger: baud_rate: 0 # disable logging over uart, required when using the RX/TX pins for the controller jiecang_desk_controller: id: my_desk sensors: height: name: "Height" height_min: name: "Height Min" height_max: name: "Height Max" height_pct: name: "Height Percent" position1: name: "Position 1" position2: name: "Position 2" position3: name: "Position 3" position4: name: "Position 4" buttons: raise: name: "Raise" lower: name: "Lower" position1: name: "Position 1" position2: name: "Position 2" position3: name: "Position 3" position4: name: "Position 4" numbers: height: name: "Height" ## lambda usage # button: # - platform: template # name: "Raise" # on_press: # lambda: "id(my_desk).raise();" # - platform: template # name: "Lower" # on_press: # lambda: "id(my_desk).lower();" # - platform: template # name: "Position 1" # on_press: # lambda: "id(my_desk).goto_position(1);" # - platform: template # name: "Position 2" # on_press: # lambda: "id(my_desk).goto_position(2);" # - platform: template # name: "Position 3" # on_press: # lambda: "id(my_desk).goto_position(3);" # - platform: template # name: "Position 4" # on_press: # lambda: "id(my_desk).goto_position(4);" # the usual stuff esp8266: board: esp01_1m wifi: ssid: !secret wifi_ssid password: !secret wifi_password ap: ssid: "esphome-desk" password: "9ebc6eac0b4e0e26b8d3b955ec660557" captive_portal: api: encryption: key: !secret encryption_key ota: