Skip to content

Commit

Permalink
Support E1524. Koenkk/zigbee2mqtt#102
Browse files Browse the repository at this point in the history
  • Loading branch information
Koenkk authored and qosmio committed Dec 25, 2019
1 parent 9bdebcd commit 216554d
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 0 deletions.
77 changes: 77 additions & 0 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -3845,6 +3845,83 @@ const converters = {
};
},
},
E1524_toggle: {
cid: 'genOnOff',
type: 'cmdToggle',
convert: (model, msg, publish, options) => {
return {action: 'toggle'};
},
},
E1524_arrow_click: {
cid: 'genScenes',
type: 'cmdTradfriArrowSingle',
convert: (model, msg, publish, options) => {
const direction = msg.data.data.value === 257 ? 'left' : 'right';
return {action: `arrow_${direction}_click`};
},
},
E1524_arrow_hold: {
cid: 'genScenes',
type: 'cmdTradfriArrowHold',
convert: (model, msg, publish, options) => {
const direction = msg.data.data.value === 3329 ? 'left' : 'right';
store[msg.endpoints[0].device.ieeeAddr] = direction;
return {action: `arrow_${direction}_hold`};
},
},
E1524_arrow_release: {
cid: 'genScenes',
type: 'cmdTradfriArrowRelease',
convert: (model, msg, publish, options) => {
const direction = store[msg.endpoints[0].device.ieeeAddr];
if (direction) {
delete store[msg.endpoints[0].device.ieeeAddr];
return {action: `arrow_${direction}_release`, duration: msg.data.data.value / 1000};
}
},
},
E1524_brightness_up_click: {
cid: 'genLevelCtrl',
type: 'cmdStepWithOnOff',
convert: (model, msg, publish, options) => {
return {action: `brightness_up_click`};
},
},
E1524_brightness_down_click: {
cid: 'genLevelCtrl',
type: 'cmdStep',
convert: (model, msg, publish, options) => {
return {action: `brightness_down_click`};
},
},
E1524_brightness_up_hold: {
cid: 'genLevelCtrl',
type: 'cmdMoveWithOnOff',
convert: (model, msg, publish, options) => {
return {action: `brightness_up_hold`};
},
},
E1524_brightness_up_release: {
cid: 'genLevelCtrl',
type: 'cmdStopWithOnOff',
convert: (model, msg, publish, options) => {
return {action: `brightness_up_release`};
},
},
E1524_brightness_down_hold: {
cid: 'genLevelCtrl',
type: 'cmdMove',
convert: (model, msg, publish, options) => {
return {action: `brightness_down_hold`};
},
},
E1524_brightness_down_release: {
cid: 'genLevelCtrl',
type: 'cmdStop',
convert: (model, msg, publish, options) => {
return {action: `brightness_down_release`};
},
},

// Ignore converters (these message dont need parsing).
ignore_onoff_report: {
Expand Down
16 changes: 16 additions & 0 deletions devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -1322,6 +1322,22 @@ const devices = [
execute(device, actions, callback);
},
},
{
zigbeeModel: ['TRADFRI remote control'],
model: 'E1524',
description: 'TRADFRI remote control',
supports:
'toggle, arrow left/right click/hold/release, brightness up/down click/hold/release ' +
'(**[requires additional setup!]' +
'(https://github.com/Koenkk/zigbee2mqtt/blob/dev/docs/getting_started/pairing_devices.md)**)',
vendor: 'IKEA',
fromZigbee: [
fz.E1524_toggle, fz.E1524_arrow_click, fz.E1524_arrow_hold, fz.E1524_arrow_release,
fz.E1524_brightness_up_click, fz.E1524_brightness_down_click, fz.E1524_brightness_up_hold,
fz.E1524_brightness_up_release, fz.E1524_brightness_down_hold, fz.E1524_brightness_down_release,
],
toZigbee: [],
},

// Philips
{
Expand Down

0 comments on commit 216554d

Please sign in to comment.