Enabling and then disabling the virtual device in HomeKit Integration app does not unlink it from the HomeKit Integration app.
Steps to reproduce:
Here are the steps I used when I saw the problem.
I created a Virtual Fan device using built-in Virtual Fan Controller device type.
Then I enabled (checked) the Virtual Fan device in the HomeKit Integration app.
On the Virtual Fan's device page the In Use By field shows the HomeKit Integration link. This is expected behavior.
Then I disabled (unchecked) the Virtual Fan device in the HomeKit Integration app.
On the Virtual Fan's device page the In Use By field still shows the HomeKit Integration link. This is NOT the expected behavior.
When I tried to press the Remove Device button, it shows me the message:
Remove device?
Virtual Fan is in use by 1 app listed below. Remove it from the app first or they may be damaged by the device removal.
HomeKit Integration
This is NOT the expected behavior.
I pressed Cancel button to keep the Virtual Fan device intact.
In HomeKit Integration app the Virtual Fan device is disabled (not checked).
When I press on the gear icon at the top right corner, the app details and settings page shows that the Virtual Fan device is listed in the authorizedDevices capability.
I'm also experiencing this with a Virtual Switch on a C-8 on version 2.3.6.146.
I unchecked the device in the homekit integration and clicked done at the bottom of the page, then went to the device details page and the devices was still marked as In Use By the homekit integration, rebooted the hub and was still marked as in use.
Today I've registered new ZWave device in Hubitat-C7 hub:
Device Name: Floor 2 Bathroom Sink WLS
Device Type: Zooz ZSE42
Device Driver: Zooz ZSE42 WATER LEAK XS SENSOR
Then I opened HomeKit Integration app and enabled (checked) Floor 2 Bathroom Sink WLS device. I've pressed Done button at the bottom of the page to close the app.
The Floor 2 Bathroom Sink WLS device was successfully added to the Home app on iPhone. I tested the integration and I was able to receive the water leak notifications on my iPhone.
When I opened the Floor 2 Bathroom Sink WLS device page in Hubitat, I didn't see the HomeKit Integration link in the In Use By field.
This is NOT the expected behavior.
I've opened HomeKit Integration app again and clicked on the gear button at the top right corner. The authorizedDevices field does not contain the Floor 2 Bathroom Sink WLS device.
This is NOT the expected behavior.
Additional Information
I do have another device called Floor 3 Bathroom Toilet WLS, which is the same kind of device as above and it uses the same device driver. I've enabled the Floor 3 Bathroom Toilet WLS in HomeKit Integration app long time ago - this was the release of the Hubitat firmware when the HomeKit integration was initially added.
The Floor 3 Bathroom Toilet WLS device does have a link to HomeKit Integration app in the In Use By field.
The authorizedDevices field in HomeKit Integration app does have a link to Floor 3 Bathroom Toilet WLS device.
I.e. the cross-referencing logic did work in the past.
However, now when I try to disable the Floor 3 Bathroom Toilet WLS device in HomeKit Integration app, the end result is that the device disappears from the Home app on iPhone, but the cross-referencing links in Hubitat remains intact.
Summary
The cross-referencing logic for the devices used by HomeKit Integration has been broken in some firmware version between the initial release that introduced the HomeKit Integration app and the current version (2.3.6.146),