Konnected Contact Sensor in HomeKit Integration

I am using Konnected Contact Sensors in my home. When attempting to use them in "HomeKit Integration (beta)", these devices are listed as incompatible devices.

When I create a virtual contact device and use Rule Engine to copy the state from the physical Konnected device to virtual device the state, these Virtual Sensors show up just fine in "Contact Sensor" section and I can see the states change within Apple Home App. The workaround is good but cumbersome as I have a lot of devices to tackle and seems extraneous.

As I understand it, the required capability is "Contact Sensor" and that's listed in the drivers code.

metadata {
  definition (name: "Konnected Contact Sensor", namespace: "konnected-io", author: "konnected.io", mnmn: "SmartThings", vid: "generic-contact") {
    capability "Contact Sensor"
    capability "Sensor"
  }

Actual drivers code is very simple and listed here.

Is this a limitation of the beta or is there something in the drivers that can be tweaked to surface these devices directly in HomeKit?

First off welcome to the HE Community!

Yes per Apple restrictions and mentioned on HE Docs:
Most Z-Wave, Zigbee, and built-in virtual devices are supported. Devices that are not supported (per Apple restrictions for HomeKit bridges) include:

  • locks and garage door openers
  • LAN, Wi-Fi, or cloud devices
  • User (custom) virtual drivers

Alternatives folks are using to get around this is to host homebridge on an always running PC or NAS.

1 Like

Hi, I’m new to Hubitat and haven’t bought a Konnected panel yet. I’m curious, are the virtual devices that are visible in HomeKit functional, ie do they successfully show state changes and can you use them to drive automations like announce contacts opening on HomePods? I’d rather not run Homebridge if I can avoid it.
Thanks!

Yes... They show status in homekit and I've found the virtual switches and other devices very reliable.

1 Like

Same. That’s how I solved it. You can create rules for each pair of physical and virtual sensors.

I had too many of these sensors. So I just wrote a quick app for easy pairing with virtual.

If you’re interested,

Two apps, to keep the grouping together.

Edit: Updated Url to GH repo

2 Likes

You ought to throw that into HPM with konnected tag

I have a Qolsys system that I was successfully added to Hubitat with help from other users here and the drivers provided but it says incompatible devices to move to HomeKit. What connected panel should I buy to be able to have my alarm system in HomeKit. Thank you

You can't. Konnected would have to make a deal with Apple to get it Homekit certified and they are not doing that. Hubitat going for Homekit certification is not allowed to bring in LAN devices (which konnected is) or Locks/garage door openers. What you do is when it's connected to Hubitat, use virtual switches/contacts etc to monitor konnected and have those brought into homekit. Very simple.

very nice solution ! thank you

1 Like

New hubitat user here. This worked great for my contact sensors. Is there something similar I can do to integrate my motion sensors?

Thanks!

Hey @user5800 Are you able to see a virtual motion sensor in home kit? (I don't have home kit so no way for me to check this) if you can try using the below app code (copy and replace the existing app code) I added motion sensors, they seem to work (at least they sync the motion status)

Virtual Device Sync App Code

/**

  • Virtual Device Sync
  • Copyright 2023 Ahmed L
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

*/
// Modified to add Motion Sensors By Michael G

public static String version() { return "0.0.1MSG" }

definition(
name: "Virtual Device Sync",
parent: "ahmedl-HubbaHubba:Virtual Device Sync Manager",
namespace: "ahmedl-HubbaHubba",
author: "Ahmed L",
description: "Updates Virtual Device to same state as Physical Device",
category: "Convenience",
iconUrl: "",
iconX2Url: ""
)

//https://docs2.hubitat.com/developer/driver/capability-list
//https://docs2.hubitat.com/developer/app/building-a-simple-app
//https://docs2.hubitat.com/developer/app/overview

preferences {
page(name: "mainPage", title: "Virtual Device Sync", install: true, uninstall: true) {
section("Contact Sensor") {
paragraph "Virtual Device Sync v${version()}"
input name: "physicalSensor", type: "capability.contactSensor", title: "When open/close is detected on...", submitOnChange: true, required: false, multiple: false
input name: "virtualSensor", type: "capability.contactSensor", title: "Then update state on this sensor ...", submitOnChange: true, required: false, multiple: false
}
section("Motion Sensor") {
paragraph "Virtual Device Sync v${version()}"
input name: "physicalmotionSensor", type: "capability.motionSensor", title: "When motion is detected on...", submitOnChange: true, required: false, multiple: false
input name: "virtualmotionSensor", type: "capability.motionSensor", title: "Then update state on this sensor ...", submitOnChange: true, required: false, multiple: false
}
}
}

def installed() {
log.info "installed()"
log.debug "installed()"
updated()
}

def updated() {
log.info "updated()"
unsubscribe()
app.updateLabel("${physicalSensor?.displayName} --> ${virtualSensor?.displayName} ")
app.updateLabel("${physicalmotionSensor?.displayName} --> ${virtualmotionSensor?.displayName} ")
subscribe(physicalSensor, "contact", contactHandler)
subscribe(physicalmotionSensor, "motion", motionHandler)
}

def uninstalled() {
log.info "uninstalled()"
unsubscribe()
}

def contactHandler(evt) {
log.info "contactHandler() called: ${evt.descriptionText} ${evt.device?.name}"
log.debug "contactHandler() called: ${evt.name} ${evt.value}"
if(evt.value == "open"){
log.info "Sending open() to ${virtualSensor.name}"
virtualSensor.open()
}
else {
log.info "Sending close() to ${virtualSensor.name}"
virtualSensor.close()
}
}
def motionHandler(evt) {
log.info "motionHandler() called: ${evt.descriptionText} ${evt.device?.name}"
log.debug "motionHandler() called: ${evt.name} ${evt.value}"
if(evt.value == "active"){
log.info "Sending active() to ${virtualmotionSensor.name}"
virtualmotionSensor.active()
}
else {
log.info "Sending inactive() to ${virtualmotionSensor.name}"
virtualmotionSensor.inactive()
}
}