I have a few repairs that have been bugging me for a while.
From the group integration
"Units of measurement are not correct
Units of measurement ppm, ppm of input sensors sensor.m5s_nano_c6_1d8ec8_tvoc_sgp30, sensor.m5s_as3_lite_953844_voc_equivalent_bme688 are not compatible and can’t be converted with the device class volatile_organic_compounds_parts of sensor group sensor.f1_living_room_tvoc.
Please correct the unit of measurement on the source entities and reload the group sensor to fix this issue."
From developer-tools/state
This group sensor
# entity_id: sensor.f1_living_room_tvoc
state_class: measurement
entity_id:
- sensor.m5s_nano_c6_1d8ec8_tvoc_sgp30
- sensor.m5s_as3_lite_953844_voc_equivalent_bme688
device_class: volatile_organic_compounds_parts
The two source sensors
# entity_id: sensor.m5s_nano_c6_1d8ec8_tvoc_sgp30
state_class: measurement
unit_of_measurement: ppm
device_class: volatile_organic_compounds_parts
# entity_id: sensor.m5s_as3_lite_953844_voc_equivalent_bme688
state_class: measurement
unit_of_measurement: ppm
device_class: volatile_organic_compounds_parts
I don’t see why the group sensor does not inherit the UoM from the sources.
This same issue also occurs with an AQI group sensor.
“Units of measurement IAQ, IAQ, IAQ, IAQ, IAQ of input sensors sensor.m5s_as3_lite_9539bc_combined_iaq_bme688, sensor.m5s_as3u_b62a18_combined_iaq_bme688, sensor.m5s_as3_lite_970ab4_combined_iaq_bme688, sensor.m5s_as3_lite_953844_combined_iaq_bme688, sensor.m5s_as3_lite_970dec_combined_iaq_bme688 are not compatible and can’t be converted with the device class aqi of sensor group sensor.home_aqi .”
# entity_id: sensor.home_aqi
state_class: measurement
entity_id:
- sensor.m5s_as3_lite_9539bc_combined_iaq_bme688
- sensor.m5s_as3u_b62a18_combined_iaq_bme688
- sensor.m5s_as3_lite_970ab4_combined_iaq_bme688
- sensor.m5s_as3_lite_953844_combined_iaq_bme688
- sensor.m5s_as3_lite_970dec_combined_iaq_bme688
device_class: aqi
All the source sensors have the same configuration
# entity_id: sensor.m5s_as3_lite_970dec_combined_iaq_bme688
state_class: measurement
unit_of_measurement: IAQ
device_class: aqi
Here’s the ESPHome configuration for the sensors, but looking at the developer-tools/state in HA it does seem as the configuration is correct.
The SGP30
sensor:
- platform: sgp30
tvoc:
id: tvoc_sgp30
name: "TVOC SGP30"
device_class: "volatile_organic_compounds_parts"
state_class: "measurement"
unit_of_measurement: "ppm"
filters:
# PPB to PPM
- multiply: 0.001
- sliding_window_moving_average:
window_size: 30
send_every: 30
The BME688
sensor:
- platform: bme68x_bsec2
###
breath_voc_equivalent:
id: evoc_bme688
name: "VOC equivalent BME688"
device_class: "volatile_organic_compounds_parts"
filters:
- sliding_window_moving_average:
window_size: 10
send_every: 10
iaq:
id: iaq_bme688
name: "IAQ BME688"
disabled_by_default: true
device_class: "aqi"
entity_category: diagnostic
filters:
- sliding_window_moving_average:
window_size: 10
send_every: 10
iaq_static:
id: static_iaq_bme688
name: "Static IAQ BME688"
disabled_by_default: true
device_class: "aqi"
entity_category: diagnostic
filters:
- sliding_window_moving_average:
window_size: 10
send_every: 10
###
###
- platform: combination
type: median
id: combined_iaq_bme688
name: "Combined IAQ BME688"
device_class: "aqi"
state_class: "measurement"
entity_category: diagnostic
sources:
- source: iaq_bme688
- source: static_iaq_bme688
I could see the tVOC being a problem because
The SGP30 default to reporting ppb, so I convert to ppm before sending to HA with an explicit UoM.
I don’t do the same for the BME688 as that reports in ppm already.
But as I said, the developer-tools/state does show them both correctly.
And the AQI sensors all have the same exact configuration but still show up as a repair issue. ![]()
I am aware I could use the combination/sum sensor to achieve the same effect, but I like the function of the group integration to have the source sensors as attributes.
I looked at this issue
From gjohansson-ST
Actually the repair is a bit misleading I see now reading it again.
Unless you manually configure aunit_of_measurementon your group sensor it will not populate a UoM unless you also have a device class set ( which you can only do in YAML, not from the UI ).So it’s behaving as it’s supposed to but again, not being clear on the description of the repair issue.
Anyway we should probably allow to have a calculated UoM if all UoM’s on the source entities are the same when not having any device class.
In the developer-tools/state my group sensors does have device_class correctly set (they are configured from GUI)