Skip to content

Instantly share code, notes, and snippets.

@reconbot
Last active October 25, 2023 13:51
Show Gist options
  • Save reconbot/b4bb188515ad58d0255bace9ac476efc to your computer and use it in GitHub Desktop.
Save reconbot/b4bb188515ad58d0255bace9ac476efc to your computer and use it in GitHub Desktop.
esphome:
name: esphome-web-XXXXXX
friendly_name: XXXXX
esp8266:
board: esp01_1m
# Enable Home Assistant API
api:
encryption:
key: ""
ota:
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "XXXXXX"
password: ""
captive_portal:
# Disable logging
logger:
baud_rate: 0 # (UART logging interferes with cse7766)
uart:
rx_pin: RX
baud_rate: 4800
binary_sensor:
- platform: gpio
pin:
number: GPIO0
mode: INPUT_PULLUP
inverted: True
name: "button"
on_press:
- switch.toggle: relay
- platform: status
name: "status"
sensor:
- platform: wifi_signal
name: "wifi_signal"
update_interval: 60s
- platform: cse7766
current:
name: "current"
accuracy_decimals: 1
voltage:
name: "voltage"
accuracy_decimals: 1
power:
name: "power"
accuracy_decimals: 1
id: power
- platform: total_daily_energy
name: "Total Daily Energy"
power_id: power
time:
- platform: sntp
id: the_time
switch:
- platform: gpio
name: "relay"
pin: GPIO12
id: relay
restore_mode: RESTORE_DEFAULT_OFF
status_led:
pin: GPIO13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment