Fix Home Assistant unit of measurement error for voc ppb sensors. https://github.com/Koenkk/zigbee2mqtt/issues/16057

This commit is contained in:
Koen Kanters
2023-03-05 09:50:23 +01:00
parent 04ae93f00c
commit bbb19371f3
+6
View File
@@ -764,6 +764,12 @@ export default class HomeAssistant extends Extension {
delete discoveryEntry.discovery_payload.device_class;
}
// Home Assisstant only supports µg/m³, not other units like ppb.
// https://github.com/Koenkk/zigbee2mqtt/issues/16057
if (firstExpose.name === 'voc' && discoveryEntry.discovery_payload.unit_of_measurement !== 'µg/m³') {
delete discoveryEntry.discovery_payload.device_class;
}
discoveryEntries.push(discoveryEntry);
/**