Hi,
Without any coding knowledge I’m learning to swim in the HA and Zigbee2MQTT waters.
I’m trying to get a device working, but the provided converter code seems not to work. It prevents starting MQTT.
So what is wrong with this code (I removed the part that does not apply to my device)? I ran it through a Json parser and it returns a syntax error.
const exposes = require('../lib/exposes');
const fz = {...require('../converters/fromZigbee'), legacy: require('../lib/legacy').fromZigbee};
const e = exposes.presets;
const reporting = require('../lib/reporting');
const extend = require('../lib/extend');
module.exports = [
{
fingerprint: [
{type: 'Router', manufacturerName: 'EcoDim BV', modelID: 'EcoDim-Zigbee 3.0', endpoints: [
{ID: 1, profileID: 260, deviceID: 257, inputClusters: [0, 3, 4, 5, 6, 8, 2821, 4096], outputClusters: [25]},
{ID: 2, profileID: 260, deviceID: 257, inputClusters: [0, 3, 4, 5, 6, 8], outputClusters: []},
{ID: 242, profileID: 41440, deviceID: 97, inputClusters: [], outputClusters: [33]},
]},
],
model: 'Eco-Dim.05',
vendor: 'EcoDim',
description: 'LED dimmer duo 2x 0-100W',
extend: extend.light_onoff_brightness({noConfigure: true, disableEffect: true}),
meta: {multiEndpoint: true},
exposes: [e.light_brightness().withEndpoint('left'), e.light_brightness().withEndpoint('right')],
configure: async (device, coordinatorEndpoint, logger) => {
await extend.light_onoff_brightness().configure(device, coordinatorEndpoint, logger);
for (const ep of [1, 2]) {
const endpoint = device.getEndpoint(ep);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff', 'genLevelCtrl']);
await reporting.onOff(endpoint);
await reporting.brightness(endpoint);
}
},
endpoint: (device) => {
return {'left': 2, 'right': 1};
},
},
];