Facing some trouble to write a really clean and simple sketch for my configuration. Can someone help me for bounty?
I need what esp8266 sending CO2 and temperature state to pass via MQTT to HASS.
anyone please or suggestion?
Might want to check out ESP EASY. Looks like it supports the MH-Z19 sensor you’re looking to implement.
https://www.letscontrolit.com/wiki/index.php/"CO2_Sensor_MH-Z19"
There are also some forums specific to ESP Easy that someone their can help you with the specific configs.
I can confirm that the MH-Z19 and MH-Z19B sensors works with EspEasy in combination with Home Assistant
I compiled the version with this source: https://github.com/letscontrolit/ESPEasy/blob/mega/src/_P049_MHZ19.ino
I connected the sensor to a Wemos D1 mini (clone) to pin D7 and D8. PPM and temp are sent to Home Assistant with MQTT.
I spent a day getting it to work until i found this version of the EspEasy plugin. All other attempts failed.
How did you set it up with the wifi and mqtt details necessary for the connection to home assistant?
Wifi setup can be found here:
https://www.letscontrolit.com/wiki/index.php/ESPEasy
This is the setup for the MH-Z19:
And this for MQTT: