diff --git a/src/devices/lumi.ts b/src/devices/lumi.ts index 76927efa560f0..fe4045f7e9e7b 100644 --- a/src/devices/lumi.ts +++ b/src/devices/lumi.ts @@ -2353,7 +2353,7 @@ const definitions: DefinitionWithExtend[] = [ e.vibration(), e.action(['vibration', 'tilt', 'drop']), e.numeric('strength', ea.STATE), - e.enum('sensitivity', ea.STATE_SET, ['low', 'medium', 'high']), + e.numeric('sensitivity', ea.STATE_SET).withDescription('Sensitivity, 1 = highest, 21 = lowest').withValueMin(1).withValueMax(21), e.angle_axis('angle_x'), e.angle_axis('angle_y'), e.angle_axis('angle_z'), diff --git a/src/lib/lumi.ts b/src/lib/lumi.ts index e5d483acefa64..29990f88d5165 100644 --- a/src/lib/lumi.ts +++ b/src/lib/lumi.ts @@ -4691,12 +4691,12 @@ export const toZigbee = { lumi_vibration_sensitivity: { key: ['sensitivity'], convertSet: async (entity, key, value, meta) => { - assertString(value, key); - value = value.toLowerCase(); - const lookup = {low: 0x15, medium: 0x0b, high: 0x01}; - + if (isString(value)) { + value = getFromLookup(value, {low: 0x15, medium: 0x0b, high: 0x01}); + } + assertNumber(value); const options = {...manufacturerOptions.lumi, timeout: 35000}; - await entity.write('genBasic', {0xff0d: {value: getFromLookup(value, lookup), type: 0x20}}, options); + await entity.write('genBasic', {0xff0d: {value, type: 0x20}}, options); return {state: {sensitivity: value}}; }, } satisfies Tz.Converter,