In case anyone wants to add a SL3P to Homebridge and thus HomeKit via IP (MQTT) instead of BLE, here is a ready made config that works for me:
- Connect the Smart Lock to your MQTT Server (seep API instructions)
- Go to Homebridge Admin > Plugins, search for and install the Homebridge Mqttthing plugin
- Go to Homebridge Admin > Configuration and add the Smart Lock as new accessory:
This configuration is for a Smart Lock with handle on the outside and a door sensor:
"accessories": [
{
"accessory": "mqttthing",
"type": "custom",
"name": "Eingang",
"url": "mqtt://YOUR_MQTT_SERVER",
"username": "nuki",
"password": "YOUR_MQTT_PASSWORD",
"mqttOptions": {
"keepalive": 60
},
"mqttPubOptions": {
"qos": 2
},
"services": [
{
"type": "lockMechanism",
"name": "Nuki Smart Lock",
"topics": {
"getOnline": "nuki/YOUR_NUKI_ID/connected",
"setLockTargetState": {
"topic": "nuki/YOUR_NUKI_ID/lockAction",
"apply": "if (message == 'S') { return 2 } else { return 1 }"
},
"getLockTargetState": {
"topic": "nuki/YOUR_NUKI_ID/state",
"apply": "if (message == 1 || message == 4) { return 'S'} else if (message == 0 || message == 255) { return '?'} else if (message == 254) { return 'J' } else { return 'U' }"
},
"getLockCurrentState": {
"topic": "nuki/YOUR_NUKI_ID/state",
"apply": "if (message == 1 || message == 2) { return 'S'} else if (message == 0 || message == 255) { return '?'} else if (message == 254) { return 'J' } else { return 'U' }"
},
"getBatteryLevel": "nuki/NUKI_ID/batteryChargeState",
"getChargingState": {
"topic": "nuki/YOUR_NUKI_ID/batteryCharging",
"apply": "if (message == 'true') { return 'CHARGING' } else { return 'NOT_CHARGING' }"
},
"getStatusLowBattery": "nuki/YOUR_NUKI_ID/batteryCritical"
}
},
{
"type": "contactSensor",
"name": "Nuki Doorsensor",
"topics": {
"getContactSensorState": {
"topic": "nuki/YOUR_NUKI_ID/doorsensorState",
"apply": "if (message == 3) { return true } else { return false }"
},
"getStatusActive": {
"topic": "nuki/YOUR_NUKI_ID/doorsensorState",
"apply": "if (message < 16) { return true } else { return false }"
},
"getStatusTampered": {
"topic": "nuki/YOUR_NUKI_ID/doorsensorState",
"apply": "if (message == 240) { return true } else { return false }"
},
"getStatusLowBattery": "nuki/YOUR_NUKI_ID/doorsensorBatteryCritical"
}
}
]
}
],
If you have a knob at the outside it should be sufficient to change this:
"setLockTargetState": {
"topic": "nuki/YOUR_NUKI_ID/lockAction",
"apply": "if (message == 'S') { return 2 } else { return 1 }"
},
to this:
"setLockTargetState": {
"topic": "nuki/YOUR_NUKI_ID/lockAction",
"apply": "if (message == 'S') { return 2 } else { return 3 }"
},
The configs work, but are not fully tested.