Skip to content

Commit

Permalink
Add support for switching scenes with LIDL FB21-001 remote control
Browse files Browse the repository at this point in the history
The LIDL FB21-001 remote control supports switching between four different scenes by pressing the On-button multiple times in a row.

1st press on On-Button: publish {"action":"on", ...}
2nd press on On-Button: publish {"action":"switch_scene", "scene": 0}
3rd press on On-Button: publish {"action":"switch_scene", "scene": 1}
4th press on On-Button: publish {"action":"switch_scene", "scene": 2}
5th press on On-Button: publish {"action":"switch_scene", "scene": 3}
[... repeat from scene 0 ...]

Pressing the Off-Button resets the scene counter to 0
  • Loading branch information
Martin Schlossarek committed Mar 4, 2023
1 parent b80ae22 commit 3d7933c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -2886,6 +2886,18 @@ const converters = {
return {action: `${button}${clickMapping[msg.data[3]]}`};
},
},
tuya_switch_scene: {
cluster: 'genOnOff',
type: 'raw',
convert: (model, msg, publish, options, meta) => {
if (hasAlreadyProcessedMessage(msg, model, msg.data[1])) return;
// Since it is a non standard ZCL command, no default response is send from zigbee-herdsman
// Send the defaultResponse here, otherwise the second button click delays.
// https://github.com/Koenkk/zigbee2mqtt/issues/8149
msg.endpoint.defaultResponse(0xfd, 0, 6, msg.data[1]).catch((error) => {});
return {action: 'switch_scene', action_scene: msg.data[3]};
},
},
tuya_water_leak: {
cluster: 'manuSpecificTuya',
type: 'commandDataReport',
Expand Down
4 changes: 2 additions & 2 deletions devices/lidl.js
Original file line number Diff line number Diff line change
Expand Up @@ -575,8 +575,8 @@ module.exports = [
vendor: 'Lidl',
description: 'Livarno Lux switch and dimming light remote control',
exposes: [e.action(['on', 'off', 'brightness_stop', 'brightness_step_up', 'brightness_step_down', 'brightness_move_up',
'brightness_move_down'])],
fromZigbee: [fz.command_on, fz.command_off, fz.command_step, fz.command_move, fz.command_stop],
'brightness_move_down', 'switch_scene'])],
fromZigbee: [fz.command_on, fz.command_off, fz.command_step, fz.command_move, fz.command_stop, fz.tuya_switch_scene],
toZigbee: [],
},
{
Expand Down

0 comments on commit 3d7933c

Please sign in to comment.