本帖最后由 GraceYang 于 2022-11-21 16:07 编辑
下午抽时间倒腾了一会儿,竟然读到数据了,现在把成果贴出,给有需要的同学一个参考
板子:ESP8266 nodemcu v3
代码如下:
esphome:
name: airquality
platform: ESP8266
board: esp01_1m
wifi:
ssid: "WHH"
password: "ww12345678.."
captive_portal:
logger:
api:
password: 'es123456api'
ota:
password: 'es123456ota'
web_server:
port: 80
time:
- platform: sntp
id: esp485_time
# Example configuration entry
uart:
rx_pin: 3
tx_pin: 1
baud_rate: 9600
sensor:
- platform: sm300d2
co2:
name: "SM300D2 CO2 Value"
formaldehyde:
name: "SM300D2 Formaldehyde Value"
tvoc:
name: "SM300D2 TVOC Value"
pm_2_5:
name: "SM300D2 PM2.5 Value"
pm_10_0:
name: "SM300D2 PM10 Value"
temperature:
name: "SM300D2 Temperature Value"
humidity:
name: "SM300D2 Humidity Value"
update_interval: 60s
|