Skip to content

Commit

Permalink
Add ZBDongle-E (Koenkk#4641)
Browse files Browse the repository at this point in the history
* New device support for Sonoff Zigbee 3.0 USB Dongle Plus (EFR32MG21)

This PR will address the new device support request described under the below issue 
Koenkk/zigbee2mqtt#13894

* Fix lint issues

* Update sonoff.js

Co-authored-by: Koen Kanters <[email protected]>
  • Loading branch information
2 people authored and Mephistofeles committed Dec 13, 2022
1 parent 2e603b6 commit 30c0ef6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions devices/sonoff.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const constants = require('../lib/constants');
const reporting = require('../lib/reporting');
const extend = require('../lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const ota = require('../lib/ota');

const fzLocal = {
Expand All @@ -18,6 +19,16 @@ const fzLocal = {
}
},
},
router_config: {
cluster: 'genLevelCtrl',
type: ['attributeReport', 'readResponse'],
convert: (model, msg, publish, options, meta) => {
const result = {};
if (msg.data.hasOwnProperty('currentLevel')) {
result.light_indicator_level = msg.data['currentLevel'];
}
},
},
};

module.exports = [
Expand Down Expand Up @@ -189,4 +200,17 @@ module.exports = [
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
},
},
{
zigbeeModel: ['DONGLE-E_R'],
model: 'ZBDongle-E',
vendor: 'SONOFF',
description: 'Sonoff Zigbee 3.0 USB Dongle Plus (EFR32MG21) with router firmware',
fromZigbee: [fz.linkquality_from_basic, fzLocal.router_config],
toZigbee: [],
exposes: [exposes.numeric('light_indicator_level').withDescription('Brightness of the indicator light').withAccess(ea.STATE)],
configure: async (device, coordinatorEndpoint, logger) => {
device.powerSource = 'Mains (single phase)';
device.save();
},
},
];

0 comments on commit 30c0ef6

Please sign in to comment.