This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Is it possible to send OTA message to factory reset a HA devices?

Other Parts Discussed in Thread: Z-STACK

Dears,

If I want to implement a Zigbee HA bulb, Is it possible to send OTA message to factory reset a HA devices? this is because there shouldn't have physical button on bulb so we need this.

  • To the best of my knowledge, there is nothing in the spec that says how factory reset should be performed. If so, I think it is vendor dependent.

    Now, a bulb is either factory new or joined to a network. 

    If it is in a network, then it could can reset in two ways :

    a) From another device in the network by sending a zdo.leave (something like that) to ask the bulb leave , the bulb can take that as a trigger to reset itself

    b) From a device outside of the network that perform a ZLL touchlink -> factory reset procedure

    As far as I know, you can do that on ge link, cree, philips bulbs.

  • a. Yes, that is what I do in HA network.
    b. Yes, I can do this to GE and Philips hue. However, it doesn't work on Z-Stack Light Link 1.0.2.
  • Do you mean if the bulb itself is running zstack light link 1.0.2, then it cannot be reset using b) ?
  • Yes. I use ZLight2 HW and Z-Stack Light Link 1.0.2. Cannot factory reset to it. Have you been succesfully doing this on ZLight2 HW and Z-Stack Light Link 1.0.2?
  • Technically you could have the controller sending a 'Reset to factory defaults' command (from the Basic cluster) and implement a callback on the light which, upon the reception of this command, sends a NWK leave commands and clears the NV.

    Thanks,
    TheDarkSide
  • The problem is, if I reset ZC and forget to send leave to the bulb, I have no alternative to reset it. Another scenario is, if the bulb joins another network accidentally and I don't know it, there is no way to reset i too.
  • No, I haven't try that, so I cannot provide any insight.

    However, from your original question, you want to make a HA bulb, right? If so, then you are basically running HA and a partial ZLL, right?
  • Basically, ZLL has to compliant with HA profile. So I test with Z-Stack Light Link 1.0.2.
  • That's true. I was thinking there are some difference in the command structures that need attentions , i.e. interpan vs non-interpan.

    But you are right, ZLL should be compliant with HA, therefore Z-Stack Light Link 1.0.2 should accept/perfrom factory reset command.
  • Yes, Z-Stack Light Link 1.0.2 should accept/perfrom factory reset command but it doesn't. Hi TheDarkSide, do you have any comment on this?
  • Yes ZLight programmed with ZStack-Lighting1.0.2 does support a Factory Reset command. However there are 2 differences in resetting ZLight vs off the shelf ZLL devices.

    1. Zlight will NOT accept a TouchLink command from a device advertising a Key Bit Mask with ZLL Master Key. It requires the Certification bit to be set for it to respond to the touchlink scan request.

    What device are you using to reset the Philips / GE devices? As these devices are using the ZLL Master Key the same will not reset a ZLight. If the device doing the reset is built with ZStack-Lighting-1.0.2 then you can change the key bit mask in zll.h by changing the ZLL_KEY_INDEX:

    // For production:
    //#define ZLL_ENC_KEY  ZLL_MASTER_KEY
    //#define ZLL_LINK_KEY  ZLL_MASTER_LINK_KEY
    //#define ZLL_KEY_INDEX ZLL_KEY_INDEX_MASTER
    
    // For certification only:
    #define ZLL_ENC_KEY  ZLL_CERTIFICATION_ENC_KEY
    #define ZLL_LINK_KEY  ZLL_CERTIFICATION_LINK_KEY
    #define ZLL_KEY_INDEX ZLL_KEY_INDEX_CERT

    The ZLL_ENC_KEY and ZLL_LINK_KEY do not need to be set correctly as the touchlink reset does not use them (this is why an uncertified device can reset a certified device).

    2. TouchLink is proximity based. The Touchlink RSSI filter in ZLight is "strict" meaning that you may need to be closer for the touchlink to work.

    This can be changed in zll.h or in project options by changing ZLL_TL_WORST_RSSI:

    // Manufacturer specific threshold (greater than -128),
    // do not respond to Touch-link scan request if reached
    #ifndef ZLL_TL_WORST_RSSI
    #define ZLL_TL_WORST_RSSI -40 // dBm
    #endif

    Regards, TC.

  • Slight correction.

    TopCat said:
    1. Zlight will NOT accept a TouchLink command from a device advertising a Key Bit Mask with ZLL Master Key. It requires the Certification bit to be set for it to respond to the touchlink scan request.

    It is actually the remote that will not accept the scan response and send the identify if the keybit in the scan response does not match a bit in its key bit mask. The ZLL_KEY_INDEX must be changed on the remote and not the light.

    Regards, TC.

  • Thanks for the replies. We will test it.

  • Hi TC,
    If I use SampleRemote in Z-Stack Light 1.0.2 and add the revisions, which button can send Factory Reset command?
  • YK,
    The implementation of reset to factory new in the Remote Sample App first requires you to start the touch link session. TI have provided some "reset to fn" pre-built images in the past which start the TL session and then send the reset to FN from 1 button press, however this is not the same behavior as in our Sample Apps. In the Sample App you need to first press touchlink button to start the touch link session, then when the correct light identifies press reset to FN.

    If this does not explain the issue please send me a packet trace.

    Regards,
    TC.