本帖最后由 jyz_0501 于 2020-2-28 03:51 编辑
ESPHOME YAML配置,使用论坛三开开关!接线:3v3 -> VCC,TXD -> RX, RXD -> TX,GND -> GND
先按住微动开关,再将usb插入电脑,保持3秒以上,即可松开微动开关。如果不出意外,此时应该进入刷机模式了!
esphome:
name: '自定义英文主机名称'
platform: ESP8266
board: esp01_1m
board_flash_mode: dout
wifi:
ssid: '你的WIFI名称'
password: '你的WIFI密码'
fast_connect: True
id: wifi
api:
password: ''
reboot_timeout: 0s
ota:
password: ''
logger:
switch:
- platform: gpio
name: 'hassmartch3_1_switch_1'
pin: GPIO12
id: relay_1
- platform: gpio
name: 'hassmartch3_1_switch_2'
pin: GPIO5
id: relay_2
- platform: gpio
name: 'hassmartch3_1_switch_3'
pin: GPIO4
id: relay_3
binary_sensor:
- platform: gpio
id: button_1
pin:
number: GPIO0
inverted: True
mode: INPUT_PULLUP
on_press:
then:
- switch.toggle:
id: relay_1
- platform: gpio
id: button_2
pin:
number: GPIO14
inverted: True
mode: INPUT_PULLUP
on_press:
then:
- switch.toggle:
id: relay_2
- platform: gpio
id: button_3
pin:
number: GPIO2
inverted: True
mode: INPUT_PULLUP
on_press:
then:
- switch.toggle:
id: relay_3
status_led:
pin: GPIO13
|