From 8f1b6196d7c72ab0d83177b026fa37ecf0aca6a9 Mon Sep 17 00:00:00 2001 From: Stephan Hadinger Date: Fri, 6 Nov 2020 21:59:08 +0100 Subject: [PATCH] Zigbee remove unwanted 0x0000 --- tasmota/xdrv_23_zigbee_8_parsers.ino | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tasmota/xdrv_23_zigbee_8_parsers.ino b/tasmota/xdrv_23_zigbee_8_parsers.ino index 7b6a96381..8dca8c6a7 100644 --- a/tasmota/xdrv_23_zigbee_8_parsers.ino +++ b/tasmota/xdrv_23_zigbee_8_parsers.ino @@ -1470,8 +1470,10 @@ void Z_IncomingMessage(class ZCLFrame &zcl_received) { // log the packet details zcl_received.log(); - Z_Device & device = zigbee_devices.getShortAddr(srcaddr); - if (srcaddr != localShortAddr) { + // create the device entry if it does not exist and if it's not the local device + Z_Device & device = (srcaddr != localShortAddr) ? zigbee_devices.getShortAddr(srcaddr) : + device_unk; + if (device.valid()) { device.setLQI(linkquality != 0xFF ? linkquality : 0xFE); // EFR32 has a different scale for LQI device.setLastSeenNow(); } @@ -1522,7 +1524,9 @@ void Z_IncomingMessage(class ZCLFrame &zcl_received) { // since we just receveived data from the device, it is reachable zigbee_devices.resetTimersForDevice(srcaddr, 0 /* groupaddr */, Z_CAT_REACHABILITY); // remove any reachability timer already there - device.setReachable(true); // mark device as reachable + if (device.valid()) { + device.setReachable(true); // mark device as reachable + } if (defer_attributes) { // Prepare for publish