
PC-Active 329 contains a nice workshop on how to monitor the CO2 concentration in your home with Home Assistant and a ModeMCU Amica V2 developer board, while a second one is used as a water sensor. Below is the yaml source code for both sensors, good luck and enjoy.
First you will find the YAML source code for the water meter here:
esphome:
name: water sensor
esp8266:
board: nodemcuv2
# Enable logging
logger:
sensor:
– platform: adc
pin: A0
name: “Water sensor”
update_interval: 10s
accuracy_decimals: 1
unit_of_measurement: ‘V’
# Enable Home Assistant API
api:
password: “”
note:
password: “”
Wi-Fi:
ssid: “enter your ssid of your wifi network here”
password: “enter the password of your WiFi network here”
# Enable fallback hotspot (captive portal) in case wifi connection fails
app:
ssid: “Water Sensor Fallback Hotspot”
password: “XMpBwjLF5GBe”
captive_portal:
(article continues below the image)
Wiring diagram of the water detector
And below you will find the YAML source code for the CO2 meter:
esphome:
name: co2meter
esp8266:
board: nodemcuv2
# Enable logging
logger:
uart:
rx_pin: GPIO3
tx_pin: GPIO1
baud_rate: 9600
sensor:
– Platform:MHz19
co2:
name: “MH-Z19 CO2 Value”
temperature:
name: “MH-Z19 Temperature”
update_interval: 60s
automatic_baseline_calibration: false
# Enable Home Assistant API
api:
password: “”
note:
password: “”
Wi-Fi:
ssid: “enter your ssid of your wifi network here”
password: “enter the password of your WiFi network here”
# Enable fallback hotspot (captive portal) in case wifi connection fails
app:
ssid: “Co2Meter Fallback Hotspot”
password: “YPLFztzCmwqE”
captive_portal:
Connection diagram of the CO2 detector