Good afternoon.
I’m using a mhz19 on spome. Everything is working, I just don’t understand how to calibrate it.
mhz19.calibrate_zero
Action
This action executes zero point calibration command on the sensor with the given ID.
If you want to execute zero point calibration, the MH-Z19 sensor must work in stable gas environment (400ppm) for over 20 minutes and you execute this function.
on_…: then: - mhz19.calibrate_zero: my_mhz19_id
You can provide service to call it from Home Assistant
api: services: - service: mhz19_calibrate_zero then: - mhz19.calibrate_zero: my_mhz19_id
mhz19.abc_enable
Action
This action enables automatic baseline calibration on the sensor with the given ID.
on_…: then: - mhz19.abc_enable: my_mhz19_id
mhz19.abc_disable
Action
This action disables automatic baseline calibration on the sensor with the given ID.
on_…: then: - mhz19.abc_disable: my_mhz19_id
You can provide switch and control ABC from Home Assistant
switch: - platform: template name: “MH-Z19 ABC” optimistic: true on_turn_on: mhz19.abc_enable: my_mhz19_id on_turn_off: mhz19.abc_disable: my_mhz19_id
Where do I put this?
Right now my file looks like this:
esphome:
name: xxxx
platform: ESP32
board: esp32dev
# Enable logging
logger:
# Enable Home Assistant API
api:
ota:
password: "sdfasdfafasdfaf"
wifi:
ssid: "Wifi"
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "xxxx Fallback Hotspot"
password: "ghdfghdh"
captive_portal:
uart:
rx_pin: 16
tx_pin: 17
baud_rate: 9600
sensor:
- platform: mhz19
co2:
name: "MH-Z19 CO2 Value"
temperature:
name: "MH-Z19 Temperature"
automatic_baseline_calibration: false
update_interval: 10s