我今天装了个试了下,的确很方便。esphome只是一个ESP8266/32固件生成环境,只要设置好SSID、密码、在线OTA密码、传感器的一些参数,就可利用ESPHOME生成固件,第一次把生成的BIN固件文件手动烧进ESP8266,以后就可直接在线烧录。代码例子如下:
esphome:
name: esp_dht11_livingroom
platform: ESP8266
board: esp01_1m
wifi:
ssid: "1502-1"
password: "84864520"
# Enable logging
logger:
# Enable Home Assistant API
api:
password: "84864520"
ota:
password: "84864520"
# Example configuration entry
sensor:
- platform: dht
pin: GPIO2
temperature:
name: "Living Room Temperature"
humidity:
name: "Living Room Humidity"
update_interval: 60s
model: DHT11
|