Closed Nik71git closed 2 years ago
GREAT UPGRADE !!! IT WORK'S !!! here the file .js
const fz = require('zigbee-herdsman-converters/converters/fromZigbee');
const tz = require('zigbee-herdsman-converters/converters/toZigbee');
const exposes = require('zigbee-herdsman-converters/lib/exposes');
const reporting = require('zigbee-herdsman-converters/lib/reporting');
const extend = require('zigbee-herdsman-converters/lib/extend');
const e = exposes.presets;
const ea = exposes.access;
const definition = {
zigbeeModel: ['Mains_Power_Outlet_v1.0'],
model: '16493',
vendor: 'Vimar',
description: 'attuatore',
fromZigbee: [fz.on_off],
toZigbee: [tz.on_off],
exposes: [e.switch()],
// The configure method below is needed to make the device reports on/off state changes
// when the device is controlled manually through the button on it.
configure: async (device, coordinatorEndpoint, logger) => {
const endpoint = device.getEndpoint(1);
await reporting.bind(endpoint, coordinatorEndpoint, ['genOnOff']);
await reporting.onOff(endpoint);
},
};
module.exports = definition;
The problem is that something is wrong after commented lines, if device is drive by Zigbee2mqtt it works very well, if I drive the device manually it doesn't report the state on/off on zigbee2mqtt... As soon as I correct it (with your help if possible) the device is ready for pull request on supported device (it expose only on/off, really I don't know if it expose consumption too as when it is bluetooth converted...)
SOLVED! feedback when manually actuated by reporting endpoint --> cluster onOff --> attribute onOff --> min 1--> max 3600 --> 0