HomeKit Integration (beta) How to expose Virtual switches/contact devices to operate Alexa-enabled WiFi lights?

Super happy that Habitat Elevation is working on native HomeKit integration. I've tried the beta and works great with my z-wave devices. Performance is good and so far liking it a lot. This is a great development.

The only trouble i seem to be having with the beta is exposing virtual switches or contact sensors into the HomeKit app. I am able to create a virtual device to control Atomi Smart WiFi lights from Habitat that are integrated into Alexa. However, even though the Alexa app sees the virtual device, I am not able to expose the virtual device into the HomeKit app to select it.

I did read the release notes that said that Custom Virtual devices are not supported. Not sure if what I'm trying to do would be considered "custom".

Many thanks in advance for any help.

Same here, I have some Govee lights on my pool fence outdoors that I run with Rule Machine, would be great to get them into HomeKit somehow.


If I use groups and scenes, it now shows my virtual switch!

I have a virtual switch that I exposed and it's working fine.

A virtual switch should be OK. If you are using a virtual switch and it does not show in the Homekit app try clicking the reload button at the bottom.
Virtual locks and garage doors should not show as I think they are considered border devices and not allowed by Apple to integrate through a third party app.

1 Like

Thanks for the reply. Would you mind sharing how your virtual switch is configured?

Pretty straight forward.

I then have a rule when this switch turns on to unlock my front door and when it is turned off to then lock it.

1 Like

I think if you look in the dropdown when you create a virtual, you'll see drivers with (user) at the end.. I suspect those are the "customs" that won't work today.

Screen Shot 2022-11-27 at 2.56.24 PM

Thank you all for the replies.

I had to "reload" to have the switch show up in the HomeKit integration app (thank you @amithalp ) but doing what I wanted required both a virtual swicth and a virtual contact sensor because Alexa (where the WiFi lightbulb sits) seems to only let you create a routine based on a contact sensor state change and in HomeKit (on the Apple side) I could not find a way to create a button to change the state of a contact sensor.

I then created a virtual switch that i could operate from HomeKit and then created a basic Hubitat rule to change the state of the contact switch which then allowed me to trigger the Alexa routine to turn the light on and off....

There probably is a better way but this worked.

Thank you all for the help.

I'm trying to use virtual switch that's linked to a wall switch via RM, the problem is that i can't figure out how to update the virtual switch state if the actual switch is turned on or off,
did you manage to achieve this?!!

I'd assume a rule that would trigger on the actual switch changing from on to off or vice versa and then an IF statement to turn the virtual on if the actual is on and the else to turn it off.

Not to belabor the point, but so my small mind is clear,
Can HE trigger HomeKit to lock doors?
It appears you've been able to use virtual switch to trigger HomeKit to lock and unlock?
I currently do this from HE to Alexa (WiFi locks). I hear some discussion where HomeKit restricts such actions for security.
If so, another fine point for HomeKit.

You can make a virtual switch and then a rule that will, on the Hubitat side, lock and unlock the door based on the switch being "on" or "off". You just can't export the actual lock to Homekit.

You could then setup a rule, I have not, that will also change that virtual switch when the door is unlocked or locked manually or by some other rule.

Awesome. Thank you for reassuring me. I expect to get a Apple hub soon and give it a go.

I can confirm that i can use the HomeKit app to open and close a z-wave garage door opener connected to Hubitat using a virtual switch. Havenโ€™t done the front door lock but it should be just as doable.

Excellent. Thanks Luis.

I have several virtual buttons that will not appear in Apple Home. They work on the HE dashboard, and they definitely are checked in the HomeKit Integration App.

I don't know if it matters or not by my virtual buttons are "three-button devices" I've created to control my Somfy shades. They basically replicate the up/down/stop buttons on the RF controller.

In any case it would be nice if these would show up on my iOS devices as well.

Thank you.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.