diff --git a/src/lib/modernExtend.ts b/src/lib/modernExtend.ts index 17dc0dc5d6dcc..ddc551989f458 100644 --- a/src/lib/modernExtend.ts +++ b/src/lib/modernExtend.ts @@ -941,15 +941,18 @@ export function occupancy(args?: OccupancyArgs): ModernExtend { } export function co2(args?: Partial) { + const fraction_of_1: ScaleFunction = (value: number, type: 'from' | 'to') => { + return 1 / value; + }; return numeric({ name: 'co2', cluster: 'msCO2', label: 'CO2', attribute: 'measuredValue', - reporting: {min: '10_SECONDS', max: '1_HOUR', change: 0.00005}, // 50 ppm change + reporting: {min: '10_SECONDS', max: '1_HOUR', change: fraction_of_1(50 /*ppm*/, 'to')}, description: 'Measured value', unit: 'ppm', - scale: 0.000001, + scale: fraction_of_1, access: 'STATE_GET', ...args, });