The Unit MQ component reads combustible gas detection data and heating status.
| Item | Information |
|---|---|
| Product Name | Unit MQ |
| SKU | U199 |
| Main Function | Combustible gas and heating status detection |
| Communication Interface | I2C |
| Default I2C Address | 0x11 |
| ESPHome Component | m5stack_unit_mq (external component) |
| ESPHome Version Requirement | / |
external_components:
- source: github://m5stack/esphome-yaml/components
components: [m5stack_unit_mq]
refresh: 0s Add the m5stack_unit_mq Sensor Platform to configure the heating mode and read MQ, NTC, and reference voltage data. The led option additionally creates a Binary Sensor entity indicating whether the data is valid.
sensor:
- platform: m5stack_unit_mq
heat_mode: SWITCH
temperature:
name: "Unit MQ Temperature"
mq_adc:
name: "MQ ADC"
ntc_adc:
name: "NTC ADC"
ntc_resistance:
name: "NTC Resistance"
reference_voltage:
name: "Internal Reference Voltage"
mq_voltage:
name: "MQ Voltage"
ntc_voltage:
name: "NTC Voltage"
led:
name: "MQ Data Valid"
update_interval: 20s Main parameters:
| Parameter | Description |
|---|---|
heat_mode | Heating mode: CONTINUOUS, SWITCH, or OFF. |
temperature | Temperature calculated from thermistor data. |
mq_adc | 12-bit raw ADC reading from the MQ channel. |
ntc_adc | 12-bit raw ADC reading from the NTC channel. |
ntc_resistance | NTC resistance. |
reference_voltage | Internal reference voltage. |
mq_voltage | MQ channel voltage. |
ntc_voltage | NTC channel voltage. |
led | Binary data-valid status; this option reads the status and does not control the onboard LED. |
high_level_time | High-level duration in SWITCH mode, in seconds; default 30, minimum 30. |
low_level_time | Low-level duration in SWITCH mode, in seconds; default 5, minimum 5. |
update_interval | Sensor data update interval. |
heat_mode: CONTINUOUS, the device heats continuously. Avoid touching the hot probe.i2c:
sda: GPIOXX
scl: GPIOXX
scan: true
external_components:
- source: github://m5stack/esphome-yaml/components
components: [m5stack_unit_mq]
refresh: 0s
sensor:
- platform: m5stack_unit_mq
heat_mode: SWITCH
temperature:
id: mq_temp
name: "Unit MQ Temperature"
mq_adc:
id: mq_adc_val
name: "MQ ADC"
ntc_adc:
id: ntc_adc_val
name: "NTC ADC"
ntc_resistance:
id: ntc_resistance_val
name: "NTC Resistance"
reference_voltage:
id: in_ref_volt
name: "Internal Reference Voltage"
mq_voltage:
id: mq_volt
name: "MQ Voltage"
ntc_voltage:
id: ntc_volt
name: "NTC Voltage"
led:
id: mq_led
name: "MQ Data Valid"
update_interval: 20sAfter configuration and connection to Home Assistant, the result is displayed as follows: