Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- substitutions:
- device_name: d1-multi-sensor
- esphome:
- name: ${device_name}
- platform: ESP8266
- board: d1_mini
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- services:
- - service: mhz19_calibrate_zero
- then:
- - mhz19.calibrate_zero: co2_sensor
- ota:
- password: !secret ota_password
- wifi:
- networks:
- - ssid: !secret my_ap_ssid
- password: !secret my_ap_password
- - ssid: !secret my_phone_ap_ssid
- password: !secret my_phone_ap_password
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "d1-multi-sensor"
- password: "12345678"
- captive_portal:
- web_server:
- i2c:
- sda: D5
- scl: D6
- scan: true
- uart:
- - id: pm_bus #for pm1006
- rx_pin: D2
- baud_rate: 9600
- - id: co2_bus
- rx_pin: D4 #to MHZ19 TXD
- tx_pin: D3 #to MHZ19 RXD
- baud_rate: 9600
- sensor:
- - platform: pm1006
- uart_id: pm_bus
- pm_2_5:
- name: "${device_name} PM2.5 sensor"
- - platform: sht3xd
- temperature:
- name: "${device_name} Temperature"
- # filters:
- # - calibrate_polynomial:
- # degree: 2
- # datapoints:
- # - 0.0 -> 0.0
- # - 31.9 -> 29.2
- # - 31.4 -> 28.3
- humidity:
- name: "${device_name} Humidity"
- # filters:
- # - calibrate_polynomial:
- # degree: 2
- # datapoints:
- # - 0.0 -> 0.0
- # - 60.6 -> 71
- # - 51 -> 62
- # - 49.7 -> 61
- address: 0x44
- update_interval: 30s
- - platform: mhz19
- id: co2_sensor
- co2:
- name: "${device_name} CO2"
- uart_id: co2_bus
- update_interval: 30s
- automatic_baseline_calibration: false
- - platform: wifi_signal
- name: "${device_name} WiFi Signal"
- update_interval: 60s
- binary_sensor:
- - platform: gpio
- id: motion
- pin: D7
- name: "${device_name} Motion"
- device_class: motion
- - platform: status
- name: "${device_name} WiFi Status"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement