Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for H1M(ZNQBKG24LM) #5863

Merged
merged 2 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/converters/toZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -2285,7 +2285,7 @@ const converters = {
if (['SP-EUC01', 'ZNCZ04LM', 'ZNCZ12LM', 'ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM', 'SSM-U01', 'SSM-U02', 'DLKZMK11LM', 'DLKZMK12LM',
'WS-EUK01', 'WS-EUK02', 'WS-EUK03', 'WS-EUK04', 'QBKG19LM', 'QBKG20LM', 'QBKG25LM', 'QBKG26LM', 'QBKG28LM', 'QBKG29LM',
'QBKG31LM', 'QBKG34LM', 'QBKG38LM', 'QBKG39LM', 'QBKG40LM', 'QBKG41LM', 'ZNDDMK11LM', 'ZNLDP13LM', 'ZNQBKG31LM',
'WS-USC02', 'WS-USC03', 'WS-USC04',
'WS-USC02', 'WS-USC03', 'WS-USC04', 'ZNQBKG24LM',
].includes(meta.mapped.model)) {
await entity.write('aqaraOpple', {0x0201: {value: value ? 1 : 0, type: 0x10}}, manufacturerOptions.xiaomi);
} else if (['ZNCZ02LM', 'QBCZ11LM', 'LLKZMK11LM'].includes(meta.mapped.model)) {
Expand All @@ -2310,7 +2310,7 @@ const converters = {
if (['SP-EUC01', 'ZNCZ04LM', 'ZNCZ12LM', 'ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM', 'SSM-U01', 'SSM-U02', 'DLKZMK11LM', 'DLKZMK12LM',
'WS-EUK01', 'WS-EUK02', 'WS-EUK03', 'WS-EUK04', 'QBKG19LM', 'QBKG20LM', 'QBKG25LM', 'QBKG26LM', 'QBKG28LM', 'QBKG29LM',
'QBKG31LM', 'QBKG34LM', 'QBKG38LM', 'QBKG39LM', 'QBKG40LM', 'QBKG41LM', 'ZNDDMK11LM', 'ZNLDP13LM', 'ZNQBKG31LM',
'WS-USC02', 'WS-USC03', 'WS-USC04',
'WS-USC02', 'WS-USC03', 'WS-USC04', 'ZNQBKG24LM',
].includes(meta.mapped.model)) {
await entity.read('aqaraOpple', [0x0201]);
} else if (['ZNCZ02LM', 'QBCZ11LM', 'ZNCZ11LM'].includes(meta.mapped.model)) {
Expand Down Expand Up @@ -2429,7 +2429,7 @@ const converters = {
convertSet: async (entity, key, value, meta) => {
if (['ZNCZ04LM', 'ZNCZ12LM', 'ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM', 'QBKG19LM', 'QBKG20LM', 'QBKG25LM', 'QBKG26LM',
'QBKG28LM', 'QBKG29LM', 'QBKG31LM', 'QBKG34LM', 'DLKZMK11LM', 'SSM-U01', 'WS-EUK01', 'WS-EUK02',
'WS-EUK03', 'WS-EUK04', 'SP-EUC01'].includes(meta.mapped.model)) {
'WS-EUK03', 'WS-EUK04', 'SP-EUC01', 'ZNQBKG24LM'].includes(meta.mapped.model)) {
await entity.write('aqaraOpple', {0x0203: {value: value ? 1 : 0, type: 0x10}}, manufacturerOptions.xiaomi);
} else if (['ZNCZ11LM'].includes(meta.mapped.model)) {
const payload = value ?
Expand All @@ -2445,7 +2445,7 @@ const converters = {
convertGet: async (entity, key, meta) => {
if (['ZNCZ04LM', 'ZNCZ12LM', 'ZNCZ15LM', 'QBCZ15LM', 'QBCZ14LM', 'QBKG19LM', 'QBKG20LM', 'QBKG25LM', 'QBKG26LM',
'QBKG28LM', 'QBKG29LM', 'QBKG31LM', 'QBKG34LM', 'DLKZMK11LM', 'SSM-U01', 'WS-EUK01', 'WS-EUK02',
'WS-EUK03', 'WS-EUK04', 'SP-EUC01'].includes(meta.mapped.model)) {
'WS-EUK03', 'WS-EUK04', 'SP-EUC01', 'ZNQBKG24LM'].includes(meta.mapped.model)) {
await entity.read('aqaraOpple', [0x0203], manufacturerOptions.xiaomi);
} else {
throw new Error('Not supported');
Expand Down
23 changes: 21 additions & 2 deletions src/devices/xiaomi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3283,14 +3283,33 @@ const definitions: Definition[] = [
},
ota: ota.zigbeeOTA,
},
{
zigbeeModel: ['lumi.switch.acn029'],
model: 'ZNQBKG24LM',
vendor: 'Xiaomi',
description: 'Aqara smart wall switch H1M (with neutral, single rocker)',
fromZigbee: [fz.on_off, fz.xiaomi_power, fz.xiaomi_multistate_action, fz.aqara_opple],
toZigbee: [
tz.on_off, tz.xiaomi_switch_operation_mode_opple, tz.xiaomi_switch_power_outage_memory,
tz.xiaomi_led_disabled_night, tz.xiaomi_flip_indicator_light,
],
exposes: [
e.switch(), e.power(), e.energy(), e.voltage(), e.device_temperature(),
e.action(['single', 'double']),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled'])
.withDescription('Decoupled mode'),
e.power_outage_memory(), e.led_disabled_night(), e.flip_indicator_light(),
],
onEvent: preventReset,
ota: ota.zigbeeOTA,
},
{
zigbeeModel: ['lumi.switch.acn031'],
model: 'ZNQBKG26LM',
vendor: 'Xiaomi',
description: 'Aqara smart wall switch H1M (with neutral, triple rocker)',
fromZigbee: [fz.on_off, fz.xiaomi_multistate_action, fz.aqara_opple, fz.xiaomi_power],
toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode_opple, tz.aqara_switch_mode_switch,
tz.xiaomi_flip_indicator_light],
toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode_opple, tz.xiaomi_flip_indicator_light],
endpoint: (device) => {
return {'left': 1, 'center': 2, 'right': 3};
},
Expand Down