Skip to content

Commit

Permalink
fix: Fix Zemismart ZMR4 integration Koenkk/zigbee2mqtt#23187
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk committed Sep 5, 2024
1 parent e5c62b1 commit 0573499
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 37 deletions.
26 changes: 24 additions & 2 deletions src/devices/tuya.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3207,7 +3207,15 @@ const definitions: DefinitionWithExtend[] = [
*/
},
{
fingerprint: tuya.fingerprint('TS004F', ['_TZ3000_nuombroo', '_TZ3000_xabckq1v', '_TZ3000_czuyt8lz', '_TZ3000_0ht8dnxj', '_TZ3000_b3mgfu0d']),
fingerprint: tuya.fingerprint('TS004F', [
'_TZ3000_nuombroo',
'_TZ3000_xabckq1v',
'_TZ3000_czuyt8lz',
'_TZ3000_0ht8dnxj',
'_TZ3000_b3mgfu0d',
'_TZ3000_11pg3ima',
'_TZ3000_et7afzxz',
]),
model: 'TS004F',
vendor: 'Tuya',
description: 'Wireless switch with 4 buttons',
Expand All @@ -3223,6 +3231,9 @@ const definitions: DefinitionWithExtend[] = [
'brightness_step_down',
'brightness_move_up',
'brightness_move_down',
'color_temperature_step_up',
'color_temperature_step_down',
'brightness_stop',
'1_single',
'1_double',
'1_hold',
Expand All @@ -3237,7 +3248,18 @@ const definitions: DefinitionWithExtend[] = [
'4_hold',
]),
],
fromZigbee: [fz.battery, tuya.fz.on_off_action, fz.tuya_operation_mode, fz.command_on, fz.command_off, fz.command_step, fz.command_move],
fromZigbee: [
fz.battery,
tuya.fz.on_off_action,
fz.tuya_operation_mode,
fz.command_on,
fz.command_off,
fz.command_step,
fz.command_move,
fz.command_stop,
fz.command_step_color_temperature,
],
whiteLabel: [tuya.whitelabel('Zemismart', 'ZMR4', 'Wireless switch with 4 buttons', ['_TZ3000_11pg3ima', '_TZ3000_et7afzxz'])],
toZigbee: [tz.tuya_operation_mode],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
Expand Down
35 changes: 0 additions & 35 deletions src/devices/zemismart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -368,41 +368,6 @@ const definitions: DefinitionWithExtend[] = [
description: 'Smart 20A outlet',
extend: [identify(), tuya.modernExtend.tuyaOnOff({indicatorMode: true, onOffCountdown: true, childLock: true})],
},
{
fingerprint: tuya.fingerprint('TS004F', ['_TZ3000_11pg3ima', '_TZ3000_et7afzxz']),
model: 'ZMR4',
vendor: 'Zemismart',
description: 'Wireless switch with 4 buttons',
extend: [battery()],
exposes: [
e.action([
'1_single',
'1_double',
'1_hold',
'2_single',
'2_double',
'2_hold',
'3_single',
'3_double',
'3_hold',
'4_single',
'4_double',
'4_hold',
]),
],
fromZigbee: [tuya.fz.on_off_action],
toZigbee: [],
configure: async (device, coordinatorEndpoint) => {
const endpoint = device.getEndpoint(1);
await tuya.configureMagicPacket(device, coordinatorEndpoint);
await reporting.bind(endpoint, coordinatorEndpoint, ['genPowerCfg']);
for (const ep of [1, 2, 3, 4]) {
if (device.getEndpoint(ep)) {
await reporting.bind(device.getEndpoint(ep), coordinatorEndpoint, ['genOnOff']);
}
}
},
},
];

export default definitions;
Expand Down

0 comments on commit 0573499

Please sign in to comment.