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 Aqara WS-USC01 power_o_memory #6633

Closed
wants to merge 3 commits into from
Closed
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
4 changes: 2 additions & 2 deletions src/converters/toZigbee.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2235,7 +2235,7 @@ const converters2 = {
if (['SP-EUC01', 'ZNCZ04LM', 'ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM', 'SSM-U01', 'SSM-U02', 'DLKZMK11LM', 'DLKZMK12LM',
'WS-EUK01', 'WS-EUK02', 'WS-EUK03', 'WS-EUK04', 'QBKG19LM', 'QBKG18LM', 'QBKG20LM', 'QBKG25LM', 'QBKG26LM', 'QBKG28LM', 'QBKG29LM',
'QBKG30LM', 'QBKG31LM', 'QBKG32LM', 'QBKG34LM', 'QBKG38LM', 'QBKG39LM', 'QBKG40LM', 'QBKG41LM', 'ZNDDMK11LM', 'ZNLDP13LM',
'ZNQBKG31LM', 'WS-USC02', 'WS-USC03', 'WS-USC04', 'ZNQBKG24LM', 'ZNQBKG25LM', 'JWDL001A', 'SSWQD02LM', 'SSWQD03LM',
'ZNQBKG31LM', 'WS-USC01', 'WS-USC02', 'WS-USC03', 'WS-USC04', 'ZNQBKG24LM', 'ZNQBKG25LM', 'JWDL001A', 'SSWQD02LM', 'SSWQD03LM',
'XDD11LM', 'XDD12LM', 'XDD13LM', 'ZNLDP12LM', 'ZNLDP13LM', 'ZNXDD01LM',
].includes(meta.mapped.model)) {
await entity.write('aqaraOpple', {0x0201: {value: value ? 1 : 0, type: 0x10}}, manufacturerOptions.xiaomi);
Expand All @@ -2262,7 +2262,7 @@ const converters2 = {
if (['SP-EUC01', 'ZNCZ04LM', 'ZNCZ15LM', 'QBCZ14LM', 'QBCZ15LM', 'SSM-U01', 'SSM-U02', 'DLKZMK11LM', 'DLKZMK12LM',
'WS-EUK01', 'WS-EUK02', 'WS-EUK03', 'WS-EUK04', 'QBKG19LM', 'QBKG18LM', 'QBKG20LM', 'QBKG25LM', 'QBKG26LM', 'QBKG28LM', 'QBKG29LM',
'QBKG30LM', 'QBKG31LM', 'QBKG32LM', 'QBKG34LM', 'QBKG38LM', 'QBKG39LM', 'QBKG40LM', 'QBKG41LM', 'ZNDDMK11LM', 'ZNLDP13LM',
'ZNQBKG31LM', 'WS-USC02', 'WS-USC03', 'WS-USC04', 'ZNQBKG24LM', 'ZNQBKG25LM', 'JWDL001A', 'SSWQD02LM', 'SSWQD03LM',
'ZNQBKG31LM', 'WS-USC01', 'WS-USC02', 'WS-USC03', 'WS-USC04', 'ZNQBKG24LM', 'ZNQBKG25LM', 'JWDL001A', 'SSWQD02LM', 'SSWQD03LM',
'XDD11LM', 'XDD12LM', 'XDD13LM', 'ZNLDP12LM', 'ZNLDP13LM', 'ZNXDD01LM',
].includes(meta.mapped.model)) {
await entity.read('aqaraOpple', [0x0201]);
Expand Down
14 changes: 10 additions & 4 deletions src/devices/xiaomi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1092,14 +1092,20 @@ const definitions: Definition[] = [
vendor: 'Xiaomi',
description: 'Aqara smart wall switch (no neutral, single rocker)',
fromZigbee: [fz.on_off, fz.xiaomi_multistate_action, xiaomi.fromZigbee.aqara_opple],
toZigbee: [tz.on_off, tz.xiaomi_switch_operation_mode_opple,
tz.xiaomi_flip_indicator_light, tz.aqara_switch_mode_switch],
exposes: [e.switch(), e.action(['single', 'double']), e.flip_indicator_light(),
toZigbee: [
tz.on_off, tz.xiaomi_switch_operation_mode_opple, tz.xiaomi_flip_indicator_light,
tz.aqara_switch_mode_switch, tz.xiaomi_switch_power_outage_memory],
exposes: [
e.switch(),
e.action(['single', 'double']),
e.flip_indicator_light(),
e.power_outage_memory(),
e.enum('operation_mode', ea.ALL, ['control_relay', 'decoupled']).withDescription('Decoupled mode'),
e.enum('mode_switch', ea.ALL, ['anti_flicker_mode', 'quick_mode'])
.withDescription('Anti flicker mode can be used to solve blinking issues of some lights.' +
'Quick mode makes the device respond faster.'),
e.power_outage_count(), e.device_temperature().withAccess(ea.STATE)],
e.power_outage_count(),
e.device_temperature().withAccess(ea.STATE)],
onEvent: preventReset,
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint1 = device.getEndpoint(1);
Expand Down