64 bit source address of Xiaomi's Aqara Zigbee sensors changed to FF FF FF FF FF FF FF FF

I have one coordinator, router and few xioami zigbee sensor devices.The Aqara sensor’s parent is router and data is received at the coordinator via this router. Initially 64 bit source address in the data received from the sensor was
00 15 8D 00 02 B8 4D AA

But after turning power Off and On of coordinator, the 64 bit source address in the data received changed to

FF FF FF FF FF FF FF FF

Zigbee Sensor Data before power off was as follows.

Explicit RX Indicator (API 1)

7E 00 19 91 00 15 8D 00 02 B8 4D AA BF 50 01 01 00 06 01 04 00 18 10 0A 00 00 10 00 BD

Start delimiter: 7E
Length: 00 19 (25)
Frame type: 91 (Explicit RX Indicator)
64-bit source address: 00 15 8D 00 02 B8 4D AA
16-bit source address: BF 50
Source endpoint: 01
Destination endpoint: 01
Cluster ID: 00 06
Profile ID: 01 04
Receive options: 00
RF data: 18 10 0A 00 00 10 00
Checksum: BD 

After Power Off and On at coordinator

Explicit RX Indicator (API 1)

  7E 00 19 91 FF FF FF FF FF FF FF FF BF 50 01 01 00 06 01 04 00 18 16 0A 00 00 10 00 12
        Start delimiter: 7E
        Length: 00 19 (25)
        Frame type: 91 (Explicit RX Indicator)
        64-bit source address: FF FF FF FF FF FF FF FF
        16-bit source : BF 50
        Source endpoint: 01
        Destination endpoint: 01
        Cluster ID: 00 06
        Profile ID: 01 04
        Receive options: 00
        RF data: 18 16 0A 00 00 10 00
        Checksum: 12

Why 64 bit source address changed?

What coordinator are you using?

Hi,
I am using digi xbee s2c module.

I assumed it was zigpy-xbee. I ran into the same thing, not sure why the xiaomi devices behave that way, but I ended up modifying zigpy-xbee to look up devices by nwk when they report a generic ieee. See https://github.com/zigpy/zigpy-xbee/pull/32 once I made that change, my xiaomi devices have been stable through multiple resets.

Hi,
I am not familiar with python, could you explain the function of self.getdevice(nwk=src_nwk).

All that line does is attempt to look up the device by the network id. The xiaomi devices stop reporting their ieee, but the network id is still in the frame and if the device is known we can look it up by that instead.

It might be best to just open a issue on zigpy-xbee.

Well, it works.

Explicit Addressing Command Frame (API 1)

7E 00 19 11 01 00 00 00 00 00 00 FF FF FF FE 00 00 00 01 00 00 00 00 00 0B 38 00 00 AE

Start delimiter: 7E
Length: 00 19 (25)
Frame type: 11 (Explicit Addressing Command Frame)
Frame ID: 01 (1)
64-bit dest. address: 00 00 00 00 00 00 FF FF
16-bit dest. address: FF FE
Source endpoint: 00
Dest. endpoint: 00
Cluster ID: 00 01
Profile ID: 00 00
Broadcast radius: 00 (0)
Transmit options: 00
RF data: 00 0B 38 00 00
Checksum: AE

Explicit RX Indicator (API 1)

7E 00 1E 91 00 13 A2 00 41 89 BC 54 57 49 00 00 80 01 00 00 01 00 00 AA 4D B8 02 00 8D 15 00 0B 38 27

Start delimiter: 7E
Length: 00 1E (30)
Frame type: 91 (Explicit RX Indicator)
64-bit source address: 00 13 A2 00 41 89 BC 54
16-bit source address: 57 49
Source endpoint: 00
Destination endpoint: 00
Cluster ID: 80 01
Profile ID: 00 00
Receive options: 01
RF data: 00 00 AA 4D B8 02 00 8D 15 00 0B 38
Checksum: 27