espressif / esp-homekit-sdk

562 stars 105 forks source link

Error: "Accessory Already Added" in HomeKit #75

Closed ankurag12 closed 1 year ago

ankurag12 commented 2 years ago

I was adding and removing ESP32 accessory, trying out a few things in the code (starting from fan example) and it was running smoothly but once after removing the accessory, Homekit refused to add accessory saying that the accessory has already been added. I’ve tried

Not sure if it's an ESP or HomeKit issue, but any help would be appreciated!

drawing
shahpiyushv commented 2 years ago

@ankurag12 , for me, adding manually instead of via QR code had worked. Have you tried that?

ankurag12 commented 2 years ago

I tried adding manually (using code 11122333) but the app still isn't able to detect the accessory

drawing
ankurag12 commented 2 years ago

It seems like the device was thinking it was still paired, even though the HomeKit app showed otherwise. I was able to clean the pairing information using this command

esptool.py -p $ESPPORT erase_region 0x10000 0x6000

and it works now! Let me know if there's a better way to clean the pairing information.

shahpiyushv commented 2 years ago

@ankurag12 , the cleanest way to remove an accessory is to delete it from Home app while it is reachable. Otherwise, you can press and hold the boot button for more than 10 seconds to trigger a factory reset.

The solution i mentioned earlier applies to cases wherein iOS throws an error even when accessory is removed from the Home app and is also factory reset.

wdqwd3213 commented 2 years ago

It seems like the device was thinking it was still paired, even though the HomeKit app showed otherwise. I was able to clean the pairing information using this command

esptool.py -p $ESPPORT erase_region 0x10000 0x6000

and it works now! Let me know if there's a better way to clean the pairing information.

hey, i have the same problem but im not really a tech guy... where can i type in the command?

shahpiyushv commented 2 years ago

@wdqwd3213 if you are asking about esptool.py -p $ESPPORT erase_region 0x10000 0x6000, then it is executed from your host's terminal, from the same place where you execute idf.py flash

wdqwd3213 commented 2 years ago

no' i mean what is the host terminal? i didnt even know iphone had commands. i need the most basic explentions

shahpiyushv commented 2 years ago

@wdqwd3213 , The "host" here is your development host, which you use for compilation and flashing. If you are using VS code or similar IDE, just erase the flash and re-flash the example using the commands mentioned here.

Kenerick commented 1 year ago

Is there a video for this specific issue?

shahpiyushv commented 1 year ago

@Kenerick , not sure what video you are looking for here. Anyways, closing this issue since a solution was provided. Moreover this commit also fixes a related issue wherein iOS shows all accessories as "Blinds" when the QR code is scanned.