Im submitting the following code modifcations that add some features and fix some bugs I found with the App.
BOND_Home_Integration.groovy
Line 184
if (deviceid.key == "_" || deviceid.key == "__")
Prevents NPE in getDeviceById. My issue was caused by double underscores, so test for that too.
Line 279
def component = dev.getChildDevice(hubId + ":bond:" + deviceId)
The arg was missing hubId + and the :. Prevents DNI name collision by creating child devices that already exist.
Line 688
if (deviceState.open == 1)
{
device.sendEvent(name: "switch", value: "on")
device.sendEvent(name: "windowShade", value: "open")
device.sendEvent(name: "position", value: 100)
}
else
{
device.sendEvent(name: "switch", value: "off")
device.sendEvent(name: "windowShade", value: "closed")
device.sendEvent(name: "position", value: 0)
}
Adding the position event for open and close fixes HomeKit window shade state in the Home App. Without it, the icon always showed closed and tapping the shade button would only open a closed shade, not close an open one, as it assumed it was already closed.
A further neat UX enhancement would be to have it say "opening" and "closing" for a settable amount of time, like the virtual window shade driver does.
Line 1219
4: ["high": 4, "medium-high": 3, "medium": 3, "medium-low": 2, "low": 1],
3: ["high": 3, "medium-high": 2, "medium": 2, "medium-low": 2, "low": 1],
2: ["high": 2, "medium-high": 2, "medium": 1, "medium-low": 1, "low": 1]
Map medium-high and medium-low also for 4, 3 and 2 speed fans as HomeKit (or the HE-HK integration mapping) sends these "speed" names at certain settings of the fan slider, I guess it isnt aware of max_speeds. Without this, I was getting executeAction(...SetSpeed, null) and the resultant bad argument 400 error.
Hope these edits help someone out and might be considered for inclusion in a future update. (is it even still being maintained?)
Or is a git pull request the preferred method of submitting issues like this?