---
# System prepended metadata

title: ESPHome-ESP01
tags: [ESPHOME, HA, ESP8266]

---

###### tags: `HA`,`ESPHOME`,`ESP8266`

# ESPHome-ESP01

* 首次上傳，必須下載bin後，用[esphome-flasher](https://github.com/esphome/esphome-flasher/releases)燒錄
* ESP01 燒錄線路，RUN的時候要把GPIO接地拔掉
![](https://behind-the-scenes.net/wp-content/uploads/esp8266-ftdi-programmer-connection.jpg)

# Relay模組
![](https://i.imgur.com/7EDzT5T.jpg)
* [相關教學](https://www.instructables.com/ESP0101S-RELAY-MODULE-TUTORIAL/)
* 硬體修改  
    * 移除 R2 的 10K 電阻
    * 飛一條線 CH_PD---VCC

# YAML
```yaml=
esphome:
  name: esp01-single-relay
  platform: ESP8266
  board: esp01_1m

switch:
  - platform: gpio
    name: "Relay"
    pin: GPIO0


# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "335ad36744dd8596d94b8d19998278d1"

wifi:
  ssid: "*****"
  password: "*****"

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esp01-Single-Relay"
    password: "dMMCOUL9CGcc"

captive_portal:

```
