Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* Experimental support E1743. Koenkk/zigbee2mqtt#997

* Add battery support and fix model. Koenkk/zigbee2mqtt#997

* Add missing battery converter. Koenkk/zigbee2mqtt#997

* Add ignore_power_change. Koenkk/zigbee2mqtt#997
  • Loading branch information
Koenkk authored Feb 11, 2019
1 parent d0dc65b commit 0447491
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 3 deletions.
25 changes: 23 additions & 2 deletions converters/fromZigbee.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,41 @@ const holdUpdateBrightness324131092621 = (deviceID) => {


const converters = {
AC0251100NJ_on: {
genOnOff_cmdOn: {
cid: 'genOnOff',
type: 'cmdOn',
convert: (model, msg, publish, options) => {
return {click: 'on'};
},
},
AC0251100NJ_off: {
genOnOff_cmdOff: {
cid: 'genOnOff',
type: 'cmdOff',
convert: (model, msg, publish, options) => {
return {click: 'off'};
},
},
E1743_brightness_up: {
cid: 'genLevelCtrl',
type: 'cmdMove',
convert: (model, msg, publish, options) => {
return {click: 'brightness_up'};
},
},
E1743_brightness_down: {
cid: 'genLevelCtrl',
type: 'cmdMoveWithOnOff',
convert: (model, msg, publish, options) => {
return {click: 'brightness_down'};
},
},
E1743_brightness_stop: {
cid: 'genLevelCtrl',
type: 'cmdStopWithOnOff',
convert: (model, msg, publish, options) => {
return {click: 'brightness_stop'};
},
},
AC0251100NJ_long_middle: {
cid: 'lightingColorCtrl',
type: 'cmdMoveHue',
Expand Down
30 changes: 29 additions & 1 deletion devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const repInterval = {
MAX: 58000,
};

const coordinatorGroup = 99;

const generic = {
light_onoff_brightness: {
supports: 'on/off, brightness',
Expand Down Expand Up @@ -599,6 +601,32 @@ const devices = [
],
toZigbee: [],
},
{
zigbeeModel: ['TRADFRI on/off switch'],
model: 'E1743',
vendor: 'IKEA',
description: 'TRADFRI ON/OFF switch',
supports: 'on, off',
fromZigbee: [
fz.genOnOff_cmdOn, fz.genOnOff_cmdOff, fz.E1743_brightness_up, fz.E1743_brightness_down,
fz.E1743_brightness_stop, fz.generic_battery, fz.ignore_power_change,
],
toZigbee: [],
configure: (ieeeAddr, shepherd, coordinator, callback) => {
const device = shepherd.find(ieeeAddr, 1);
const cfg = {
direction: 0, attrId: 33, dataType: 32, minRepIntval: 0, maxRepIntval: repInterval.MAX, repChange: 0,
};

const actions = [
(cb) => device.bind('genOnOff', coordinatorGroup, cb),
(cb) => device.bind('genPowerCfg', coordinator, cb),
(cb) => device.foundation('genPowerCfg', 'configReport', [cfg], foundationCfg, cb),
];

execute(device, actions, callback);
},
},
{
zigbeeModel: ['TRADFRI signal repeater'],
model: 'E1746',
Expand Down Expand Up @@ -1115,7 +1143,7 @@ const devices = [
description: 'Smart+ switch mini',
supports: 'on/off, brightness',
fromZigbee: [
fz.AC0251100NJ_on, fz.AC0251100NJ_off, fz.AC0251100NJ_long_middle,
fz.genOnOff_cmdOn, fz.genOnOff_cmdOff, fz.AC0251100NJ_long_middle,
fz.cmd_stop, fz.cmd_move, fz.cmd_move_with_onoff,
fz.cmd_move_to_level_with_onoff, fz.generic_batteryvoltage_3000_2500,
],
Expand Down

0 comments on commit 0447491

Please sign in to comment.