The SCD40 is a compact CO2 sensor that provides accurate carbon dioxide (CO2) measurements along with temperature and relative humidity readings. Key features include its small form factor, low-power consumption. It I2C- compatible sensor where you should configure the SDA and SCL pins, and define the sensor I2C address (see an example below). Of course, you can have different pins in your setup.
If your device is configured for power saving, the sensor measures all values only once when the firmware sends a periodic report. Please note, that every measurement takes about 6 seconds.
Otherwise, the sensor measures all values periodically every 5 seconds, but the firmware sends measured values with periodic reports.
⚠️ THIS FEATURE IS AVAILABLE ON CC2652 or CC1352 CHIPS ONLY

Additional parameters
Altitude – altitude over a sea level of your location for precise results.
Auto-calibration – the sensor will self-calibrate every several hours if you enabled this option.
Zigbee commands
You may send some sensor-specific commands to your higher-level system. You should write the necessary command single precision value to the “Analog input” cluster.
63000 – factory reset.
63001 – sensor restart (re-init).
63002 – start self testing. It takes about 10 seconds.
63900 – 64100 – set a temperature offset (64000 + offset value, so, the offset can be positive or negative). By default, the sensor has the temperature offset of 4 °C. If you see that the sensor measures a wrong temperature value, you can change this offset (note, this is an environment’s temperature).
65000 – 66100 – set the ambient pressure in kPa (65000 + pressure value). The maximum pressure value is 1100 kPa.
write - Zigbee write command. Topic: zigbee2mqtt/[friedly_name]/set Payload: {"[channel]": 63002} Channel: l1, l2, l3 … l16