Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- esphome:
- name: myairsensor
- platform: ESP8266
- board: nodemcu
- name_add_mac_suffix: true
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- ota:
- password: "..."
- wifi:
- ssid: "..."
- password: "..."
- fast_connect: "on"
- # ...
- #reboot_timeout: "0s"
- manual_ip:
- # Set this to the IP of the ESP
- static_ip: 192.168.1.105
- # Set this to the IP address of the router. Often ends with .1
- gateway: 192.168.1.254
- # The subnet of the network. 255.255.255.0 works for most home networks.
- subnet: 255.255.255.0
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "Myairsensor Fallback Hotspot"
- password: "..."
- captive_portal:
- i2c:
- - id: bus_a
- sda: 4
- scl: 5
- scan: true
- uart:
- - id: uart_a
- rx_pin: D6
- tx_pin: D5
- baud_rate: 9600
- - id: uart_b
- rx_pin: D7
- baud_rate: 9600
- sensor:
- # Датчик BME280 - температура, влажность, давление
- - platform: bme280
- i2c_id: bus_a
- address: 0x76
- temperature:
- name: "BME280 Temperature"
- oversampling: 16x
- pressure:
- name: "BME280 Pressure"
- humidity:
- name: "BME280 Humidity"
- update_interval: 60s
- # Датчик CO2
- - platform: mhz19
- co2:
- name: "MH-Z19 CO2 Value"
- temperature:
- name: "MH-Z19 Temperature"
- update_interval: 60s
- automatic_baseline_calibration: false
- uart_id: uart_a
- - platform: pmsx003
- type: PMSX003
- pm_1_0:
- name: "Particulate Matter <1.0µm Concentration"
- filters:
- - lambda: if (id(pms_ready_to_read).state) { return(x); } else { return {}; };
- pm_2_5:
- name: "Particulate Matter <2.5µm Concentration"
- filters:
- - lambda: if (id(pms_ready_to_read).state) { return(x); } else { return {}; };
- pm_10_0:
- name: "Particulate Matter <10.0µm Concentration"
- filters:
- - lambda: if (id(pms_ready_to_read).state) { return(x); } else { return {}; };
- uart_id: uart_b
- interval:
- - interval: 5min
- then:
- - switch.turn_on: pms_set
- - delay: 30s
- - switch.turn_on: pms_ready_to_read
- - delay: 5s
- - switch.turn_off: pms_ready_to_read
- - switch.turn_off: pms_set
- switch:
- - platform: template
- name: "PMSX003 Ready to Read Post Warm-Up"
- id: pms_ready_to_read
- optimistic: true
- - platform: gpio
- pin:
- number: GPIO10
- id: pms_set
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement