Skip to content

Commit

Permalink
Simplify ESPHome
Browse files Browse the repository at this point in the history
  • Loading branch information
iMicknl committed Mar 29, 2021
1 parent 484c71c commit d2022aa
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 23 deletions.
51 changes: 28 additions & 23 deletions packages/esphome/flexispot_ek5.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,41 @@
esphome:
substitutions:
device_name: Flexispot EK5
name: flexispot_ek5
comment: Flexispot EK5
platform: ESP8266 # Change to your type
board: nodemcuv2 # Change to your board
min_height: "73.6" # Min height + 0.1
max_height: "122.9" # Max height - 0.1

esphome:
name: ${name}
comment: ${device_name}
platform: ESP8266 # TODO Change to your platform
board: nodemcuv2 # TODO Change to your board
includes:
- desk_height_sensor.h

# Change to your WiFi
wifi:
ssid: "Abraham Linksys"
password: "PASSWORD42"
ssid: !secret wifi_ssid
password: !secret wifi_password

# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Flexispot EK5 Fallback Hotspot"
password: "VGhp4HGdsorM"
ssid: "${device_name} Fallback Hotspot"
password: !secret ap_fallback_password


captive_portal:

# Enable logging
logger:
#level: DEBUG
baud_rate: 0

# Enable Home Assistant API
api:
password: "1234"
password: !secret ha_api_password

ota:
password: "1234"

# Enable logging
logger:
# level: DEBUG # Enable if you face issues
baud_rate: 0
password: !secret ha_api_password

# General config
uart:
id: desk_uart
baud_rate: 9600
Expand Down Expand Up @@ -81,14 +86,14 @@ switch:
uart_id: desk_uart

- platform: uart
name: "Sit"
name: "Sit" # Preset 3 on some control panels
id: switch_sit
icon: mdi:chair-rolling
data: [0x9b, 0x06, 0x02, 0x00, 0x01, 0xac, 0x60, 0x9d]
uart_id: desk_uart

- platform: uart
name: "Stand"
name: "Stand" # Not available for all control panels
id: switch_stand
icon: mdi:human-handsup
data: [0x9b, 0x06, 0x02, 0x10, 0x00, 0xac, 0xac, 0x9d]
Expand Down Expand Up @@ -118,7 +123,7 @@ switch:
uart_id: desk_uart

- platform: uart
name: "(wake up)"
name: "(wake up)" # Not available on all control panels
id: switch_wake_up
icon: mdi:gesture-tap-button
data: [0x9b, 0x06, 0x02, 0x00, 0x00, 0x6c, 0xa1, 0x9d]
Expand All @@ -137,7 +142,7 @@ cover:
condition:
sensor.in_range:
id: desk_height
below: 122.9 # Max height
below: ${max_height}
then:
- logger.log: "Executing up command"
- switch.turn_on: switch_up
Expand All @@ -149,9 +154,9 @@ cover:
condition:
sensor.in_range:
id: desk_height
above: 73.6 # Min height
above: ${min_height}
then:
- logger.log: "Executing down command"
- switch.turn_on: switch_down
- delay: 10ms
optimistic: true
optimistic: true
4 changes: 4 additions & 0 deletions packages/esphome/secrets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wifi_ssid: "Abraham Linksys"
wifi_password: "PASSWORD42"
ap_fallback_password: "VGhp4HGdsorM"
ha_api_password: "1234"

0 comments on commit d2022aa

Please sign in to comment.