Skip to content

Instantly share code, notes, and snippets.

@jptrsn
Last active November 29, 2021 22:39
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jptrsn/f4f2bb59966299d8e2c1d8133536aedf to your computer and use it in GitHub Desktop.
Save jptrsn/f4f2bb59966299d8e2c1d8133536aedf to your computer and use it in GitHub Desktop.
ESP Home firmware code to power a 3D printed, Home Assistant-connected dog and/or glove dryer.
esphome:
name: boot_dryer
platform: ESP8266
board: d1_mini
# WiFi connection, correct these
# with values for your WiFi.
wifi:
ssid: !secret ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Boot Dryer"
captive_portal:
# Enable logging.
logger:
# Enable Home Assistant API.
api:
# Enable over-the-air updates.
ota:
# Enable Web server.
web_server:
port: 80
# Sync time with Home Assistant.
time:
- platform: homeassistant
id: homeassistant_time
# Text sensors with general information.
text_sensor:
# Expose WiFi information as sensors.
- platform: wifi_info
ip_address:
name: Boot Dryer IP
ssid:
name: Boot Dryer SSID
# Sensors with general information.
sensor:
# Uptime sensor.
- platform: uptime
name: Boot Dryer Uptime
# WiFi Signal sensor.
- platform: wifi_signal
name: Boot Dryer WiFi Signal
update_interval: 60s
- platform: dht
pin:
number: D7
mode: input_pullup
model: DHT11
update_interval: 60s
temperature:
name: "Boot Dryer Fan 1 Temperature"
id: fan_1_temp
humidity:
name: "Boot Dryer Fan 1 Humidity"
id: fan_1_hum
# on_value:
# if:
# condition:
# lambda: 'return x > 70;'
# then:
# - script.execute: start
- platform: dht
pin:
number: D6
mode: input_pullup
model: DHT11
update_interval: 60s
temperature:
name: "Boot Dryer Fan 2 Temperature"
id: fan_2_temp
humidity:
name: "Boot Dryer Fan 2 Humidity"
id: fan_2_hum
# Enable the following block to automatically attempt to dry boots that are over 70% relative humidity.
# This is useful if you mount the DHT sensor on the end of the boot dryer insert.
# on_value:
# if:
# condition:
# lambda: 'return x > 70;'
# then:
# - script.execute: start
binary_sensor:
- platform: status
name: Boot Dryer Status
- platform: gpio
id: sw
pin:
number: D5
mode: INPUT_PULLUP
inverted: true
filters:
- delayed_on: 10ms
on_multi_click:
- timing:
- ON for at most 1s
- OFF for at most 1s
- ON for at most 1s
- OFF for at least 0.2s
then:
- light.toggle: li
- timing:
- ON for at most 1s
- OFF for at least 0.5s
then:
if:
condition:
- script.is_running: start
then:
- script.stop: start
- script.execute: stop
else:
- script.execute: start
status_led:
pin:
number: D4
inverted: true
output:
- platform: esp8266_pwm
pin: D1
frequency: 22000 Hz
id: pwm_1
- platform: esp8266_pwm
pin: D2
frequency: 22000 Hz
id: pwm_2
fan:
- platform: speed
output: pwm_1
id: fan_1
name: "Boot Dryer Fan 1"
speed:
low: 0.6
medium: 0.8
high: 1
- platform: speed
output: pwm_2
id: fan_2
name: "Boot Dryer Fan 2"
speed:
low: 0.6
medium: 0.8
high: 1
light:
- platform: fastled_clockless
chipset: WS2812
pin: D3
num_leds: 1
rgb_order: GRB
name: "Boot Dryer Light"
id: li
effects:
- addressable_flicker:
name: Flicker Effect With Custom Values
update_interval: 16ms
intensity: 5%
script:
- id: start
then:
- if:
condition:
- script.is_running: start
then:
- script.stop: start
else:
- light.turn_on: li
- fan.turn_on:
id: fan_1
speed: HIGH
- fan.turn_on:
id: fan_2
speed: HIGH
- delay: 14400s
- script.execute: stop
- id: stop
then:
- light.turn_off: li
- fan.turn_off: fan_1
- fan.turn_off: fan_2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment