Closed Math1010 closed 1 year ago
In case of using wired coordinator such as sonoff zigbee 3.0 usb dongle plus, the following switch converter as to this procedure would work .
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: ['LILYGO.Light'],
model: 'LILYGO.Light',
vendor: 'LilyGO',
description: 'light_demo',
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;
screenshot of z2m device list on HA. screenshot of z2m dashboard on HA.
Thanks I have a CC2652 usb stick on a raspberry pi 4 with home assistant and Zigbee2MQTT and everything is working.
@liangyingy @Math1010 would you please provide better instructions?
What are the steps you followed? just upload light_demo.ino? How does the board enter pairing mode?
Long press doesn't seem to work. The board doesn't get recognized by Zigbee2MQTT on HA. Single press returns: "Not joined the zigbee network"
Hello, Is it possible to have more explanation about the light demo application which button press to go in pairing mode ? Have you an example of the external converter file used in zigbee2MQTT ?
Thanks you !