Skip to content

Instantly share code, notes, and snippets.

@duffyd
Created December 19, 2021 10:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save duffyd/9ce089b019ff66a6a84ec087e1cdca37 to your computer and use it in GitHub Desktop.
Save duffyd/9ce089b019ff66a6a84ec087e1cdca37 to your computer and use it in GitHub Desktop.
esphome:
name: d1mini-1
esp8266:
board: d1_mini
# Enable logging
logger:
level: VERY_VERBOSE
# Enable Home Assistant API
api:
services:
- service: control_servo
variables:
level: float
then:
- servo.write:
id: my_servo
level: !lambda 'return level / 100.0;'
ota:
password: [hidden]
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: [hidden]
gateway: [hidden]
subnet: [hidden]
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "D1Mini-1 Fallback Hotspot"
password: [hidden]
captive_portal:
servo:
- id: my_servo
output: pwm_output
output:
- platform: esp8266_pwm
id: pwm_output
pin: D4
frequency: 50 Hz
min_power: 5.0% # 5% at 50Hz is 1mS (20mS cycles)
max_power: 10.0% # 10% at 50Hz is 2mS (20mS cycles)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment