Skip to content

Instantly share code, notes, and snippets.

@CJ-Davies
Created September 29, 2021 12:22
Show Gist options
  • Save CJ-Davies/da97a299bcd0b4ed6843ea0c316ed6bf to your computer and use it in GitHub Desktop.
Save CJ-Davies/da97a299bcd0b4ed6843ea0c316ed6bf to your computer and use it in GitHub Desktop.
esphome:
name: kitchen_shtc3
platform: ESP8266
board: d1_mini
wifi:
ssid: "*******"
password: "*******"
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "*******"
password: "*******"
captive_portal:
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
i2c:
sda: D2
scl: D1
scan: True
id: bus_a
sensor:
- platform: shtcx
temperature:
name: "Kitchen Temperature"
humidity:
name: "Kitchen Humidity"
address: 0x70
update_interval: 1000s
# startup takes ~8 seconds, *then* run_duration starts
deep_sleep:
run_duration: 5s
sleep_duration: 112s
id: deep_sleep_1
mqtt:
broker: ***.***.***.***
username: *******
password: *******
on_message:
- topic: ota_mode
payload: 'ON'
then:
- deep_sleep.prevent: deep_sleep_1
- topic: ota_mode
payload: 'OFF'
then:
- deep_sleep.enter: deep_sleep_1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment