Advertisement
Guest User

Untitled

a guest
Nov 5th, 2021
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.51 KB | None | 0 0
  1. esphome:
  2.   name: myairsensor
  3.   platform: ESP8266
  4.   board: nodemcu
  5.   name_add_mac_suffix: true
  6.  
  7. # Enable logging
  8. logger:
  9. # Enable Home Assistant API
  10. api:
  11. ota:
  12.   password: "..."
  13.  
  14. wifi:
  15.   ssid: "..."
  16.   password: "..."
  17.   fast_connect: "on"
  18.   # ...
  19.  
  20.   #reboot_timeout: "0s"
  21.  
  22.   manual_ip:
  23.    # Set this to the IP of the ESP
  24.     static_ip: 192.168.1.105
  25.     # Set this to the IP address of the router. Often ends with .1
  26.     gateway: 192.168.1.254
  27.     # The subnet of the network. 255.255.255.0 works for most home networks.
  28.     subnet: 255.255.255.0
  29.  
  30.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  31.   ap:
  32.     ssid: "Myairsensor Fallback Hotspot"
  33.     password: "..."
  34.  
  35.  
  36.  
  37. captive_portal:
  38. i2c:
  39.  - id: bus_a
  40.    sda: 4
  41.    scl: 5
  42.    scan: true
  43.    
  44. uart:
  45. - id: uart_a
  46.   rx_pin: D6
  47.   tx_pin: D5
  48.   baud_rate: 9600
  49.  
  50. - id: uart_b
  51.   rx_pin: D7
  52.   baud_rate: 9600
  53.  
  54.  
  55. sensor:
  56.  # Датчик BME280 - температура, влажность, давление
  57.   - platform: bme280
  58.     i2c_id: bus_a
  59.     address: 0x76
  60.     temperature:
  61.       name: "BME280 Temperature"
  62.       oversampling: 16x
  63.     pressure:
  64.       name: "BME280 Pressure"
  65.     humidity:
  66.       name: "BME280 Humidity"
  67.     update_interval: 60s
  68.  
  69.  
  70.   # Датчик CO2
  71.   - platform: mhz19
  72.     co2:
  73.       name: "MH-Z19 CO2 Value"
  74.     temperature:
  75.       name: "MH-Z19 Temperature"
  76.     update_interval: 60s
  77.     automatic_baseline_calibration: false
  78.     uart_id: uart_a
  79.    
  80.   - platform: pmsx003
  81.     type: PMSX003
  82.     pm_1_0:
  83.       name: "Particulate Matter <1.0µm Concentration"
  84.       filters:
  85.         - lambda: if (id(pms_ready_to_read).state) { return(x); } else { return {}; };
  86.     pm_2_5:
  87.       name: "Particulate Matter <2.5µm Concentration"
  88.       filters:
  89.         - lambda: if (id(pms_ready_to_read).state) { return(x); } else { return {}; };
  90.     pm_10_0:
  91.       name: "Particulate Matter <10.0µm Concentration"
  92.       filters:
  93.         - lambda: if (id(pms_ready_to_read).state) { return(x); } else { return {}; };
  94.     uart_id: uart_b
  95.    
  96.    
  97. interval:
  98.   - interval: 5min
  99.     then:
  100.       - switch.turn_on: pms_set
  101.       - delay: 30s
  102.       - switch.turn_on: pms_ready_to_read
  103.       - delay: 5s
  104.       - switch.turn_off: pms_ready_to_read
  105.       - switch.turn_off: pms_set
  106.  
  107. switch:
  108.   - platform: template
  109.     name: "PMSX003 Ready to Read Post Warm-Up"
  110.     id: pms_ready_to_read
  111.     optimistic: true
  112.    
  113.   - platform: gpio
  114.     pin:
  115.       number: GPIO10
  116.     id: pms_set
  117.  
  118.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement