Skip to content

Commit 1c92165

Browse files
committed
fix: Fix Lumi ZNCLBL01LM state and position reporting Koenkk/zigbee2mqtt#23557
1 parent 96b0cad commit 1c92165

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/lib/lumi.ts

+5-4
Original file line numberDiff line numberDiff line change
@@ -2948,7 +2948,8 @@ export const fromZigbee = {
29482948

29492949
let position = precisionRound(msg.data['presentValue'], 2);
29502950
position = options.invert_cover ? 100 - position : position;
2951-
return {position};
2951+
const closed = options.invert_cover ? position === 100 : position === 0;
2952+
return {position, state: closed ? 'CLOSE' : 'OPEN'};
29522953
},
29532954
} satisfies Fz.Converter,
29542955
lumi_curtain_position_tilt: {
@@ -4783,7 +4784,7 @@ export const toZigbee = {
47834784
await entity.command('closuresWindowCovering', 'stop', {}, getOptions(meta.mapped, entity));
47844785
}
47854786

4786-
if (!['ZNCLDJ11LM', 'ZNJLBL01LM', 'ZNCLBL01LM'].includes(meta.mapped.model)) {
4787+
if (!['ZNCLDJ11LM', 'ZNCLBL01LM'].includes(meta.mapped.model)) {
47874788
// The code below is originally added for ZNCLDJ11LM (Koenkk/zigbee2mqtt#4585).
47884789
// However, in Koenkk/zigbee-herdsman-converters#4039 it was replaced by reading
47894790
// directly from currentPositionLiftPercentage, so that device is excluded.
@@ -4796,8 +4797,6 @@ export const toZigbee = {
47964797
// Lumi curtain does not send position update on stop, request this.
47974798
await entity.read('genAnalogOutput', [0x0055]);
47984799
}
4799-
4800-
return {state: {state: 'STOP'}};
48014800
} else {
48024801
const lookup = {open: 100, close: 0, on: 100, off: 0};
48034802

@@ -4819,6 +4818,8 @@ export const toZigbee = {
48194818
const payload = {presentValue: value};
48204819
await entity.write('genAnalogOutput', payload);
48214820
}
4821+
4822+
return {state: {position: value}};
48224823
}
48234824
},
48244825
convertGet: async (entity, key, meta) => {

0 commit comments

Comments
 (0)