Skip to content

Commit

Permalink
New device support for Sonoff Zigbee 3.0 USB Dongle Plus (EFR32MG21)
Browse files Browse the repository at this point in the history
This PR will address the new device support request described under the below issue 
Koenkk/zigbee2mqtt#13894
  • Loading branch information
sujithg9 authored Sep 8, 2022
1 parent 077e3a0 commit 19f3fa5
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 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 @@ -20,6 +21,19 @@ const fzLocal = {
},
};

const reader = {
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 = [
{
zigbeeModel: ['BASICZBR3'],
Expand Down Expand Up @@ -189,4 +203,18 @@ 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 (https://github.com/itead/Sonoff_Zigbee_Dongle_Firmware/tree/master/Dongle-E/Router)',
fromZigbee: [fz.linkquality_from_basic, reader.router_config],
toZigbee: [],
exposes: [exposes.numeric('light_indicator_level').withDescription('Brightness of the indicator light').withAccess(ea.STATE)],
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
device.powerSource = 'Mains (single phase)';
device.save();
},
},
];

0 comments on commit 19f3fa5

Please sign in to comment.