Xinyuan-LilyGO / T-ZigBee

Zigbee Ultra Low Power IOT Development Board
GNU Affero General Public License v3.0
72 stars 18 forks source link

Light demo better instructions #7

Closed Math1010 closed 1 year ago

Math1010 commented 2 years ago

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 !

lbuque commented 1 year ago

added: https://github.com/Xinyuan-LilyGO/T-ZigBee/tree/main/examples/light_demo

swkim01 commented 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. t_zigbee2mqtt_1 screenshot of z2m dashboard on HA. t_zigbee2mqtt_2

Math1010 commented 1 year ago

Thanks I have a CC2652 usb stick on a raspberry pi 4 with home assistant and Zigbee2MQTT and everything is working.

ejri commented 1 year ago

@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"