Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
76 lines (67 sloc)
1.53 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
esphome: | |
name: office_blinds | |
platform: ESP8266 | |
board: d1_mini | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_password | |
# Enable fallback hotspot (captive portal) in case wifi connection fails | |
ap: | |
ssid: "OfficeBlinds" | |
password: !secret fallback_ap_password | |
web_server: | |
port: 80 | |
stepper: | |
- platform: a4988 | |
id: my_stepper | |
sleep_pin: D3 | |
step_pin: D2 | |
dir_pin: D1 | |
max_speed: 800 steps/s | |
cover: | |
- platform: template | |
device_class: blind | |
name: "Office Blinds" | |
open_action: | |
- stepper.set_target: | |
id: my_stepper | |
target: 0 | |
close_action: | |
- stepper.set_target: | |
id: my_stepper | |
target: 15000 | |
stop_action: | |
- stepper.set_target: | |
id: my_stepper | |
target: !lambda return id(my_stepper).current_position; | |
optimistic: true | |
captive_portal: | |
# Enable logging | |
logger: | |
# Enable Home Assistant API | |
api: | |
services: | |
- service: set_closed_position | |
then: | |
- stepper.report_position: | |
id: my_stepper | |
position: 15000 | |
- stepper.set_target: | |
id: my_stepper | |
target: 15000 | |
- service: set_open_position | |
then: | |
- stepper.report_position: | |
id: my_stepper | |
position: 0 | |
- stepper.set_target: | |
id: my_stepper | |
target: 0 | |
- service: control_stepper | |
variables: | |
target: int | |
then: | |
- stepper.set_target: | |
id: my_stepper | |
target: !lambda 'return target;' | |
ota: |