Apologies for necro’ing this thread.
@nebhead77 your gist has been very helpful. I just wanted to share a custom external converter I use in Z2M that helps expose a few features with this switch that aren’t in Z2M.
(I’m not a coder and barely know how to use github, therefore I know the best thing to do is to submit a PR(?) but no clue on how or protocol.)
DG6HD-1BW.js
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const fz = {...require('zigbee-herdsman-converters/converters/fromZigbee'), legacy: require('zigbee-herdsman-converters/lib/legacy').fromZigbee};
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
module.exports = [
{
zigbeeModel: ['DG6HD'],
model: 'DG6HD-1BW',
vendor: 'Leviton',
description: 'Zigbee in-wall smart dimmer',
extend: extend.light_onoff_brightness({disableEffect: true, noConfigure: true}),
fromZigbee: [fz.brightness, fz.identify, fz.lighting_ballast_configuration, fz.level_config],
toZigbee: [tz.light_onoff_brightness, tz.ballast_config, tz.level_config],
exposes: [e.light_brightness(),
exposes.numeric('ballast_minimum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the minimum brightness value. [Set to 10 for LED bulbs]'),
exposes.numeric('ballast_maximum_level', ea.ALL).withValueMin(1).withValueMax(254)
.withDescription('Specifies the maximum brightness value. [Set to 254 for LED bulbs]'),
exposes.numeric('ballast_power_on_level', ea.ALL).withValueMin(1).withValueMax(255)
.withDescription('Specifies the initialisation light level. Can not be set lower than "ballast_minimum_level" ' +
'[254=Full Brightness, 255=Previous Level]')],
configure: async (device, coordinatorEndpoint, logger) => {
await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl', 'lightingBallastCfg']);
await reporting.onOff(endpoint);
},
},
];
I forget where I got this from or if I made it, but wanted to share it for others.