diff --git a/components/jiecang_desk_controller/README.md b/components/jiecang_desk_controller/README.md index c5a2ccb..0d7ab6c 100644 --- a/components/jiecang_desk_controller/README.md +++ b/components/jiecang_desk_controller/README.md @@ -58,11 +58,19 @@ TX | RX ## Usage ```yaml -uart: - id: uart_bus - tx_pin: TX - rx_pin: RX - baud_rate: 9600 +esphome: + ... + 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 + - lambda: "id(my_desk).request_limits();" + - delay: 0.1s + - lambda: "id(my_desk).request_settings();" external_components: - source: @@ -70,6 +78,15 @@ external_components: 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: diff --git a/example_jiecang_desk_controller.yaml b/example_jiecang_desk_controller.yaml index 30e264b..8d67ede 100644 --- a/example_jiecang_desk_controller.yaml +++ b/example_jiecang_desk_controller.yaml @@ -2,37 +2,22 @@ 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 + - 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();" -esp8266: - board: esp01_1m - -logger: - level: WARN - baud_rate: 0 # disable logging over uart, required when using the RX/TX pins for the controller - -api: - -ota: - -wifi: - ssid: !secret wifi_ssid - password: !secret wifi_password - - # Enable fallback hotspot (captive portal) in case wifi connection fails - ap: - ssid: "esphome-desk" - password: "9ebc6eac0b4e0e26b8d3b955ec660557" - -captive_portal: - - +external_components: + - source: + type: git + url: https://github.com/Rocka84/esphome_components/ + components: [ jiecang_desk_controller ] uart: id: uart_bus @@ -40,11 +25,8 @@ uart: rx_pin: RX baud_rate: 9600 -external_components: - - source: - type: git - url: https://github.com/Rocka84/esphome_components/ - components: [ jiecang_desk_controller ] +logger: + baud_rate: 0 # disable logging over uart, required when using the RX/TX pins for the controller jiecang_desk_controller: id: my_desk @@ -106,3 +88,22 @@ jiecang_desk_controller: # 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: +