Apple Home
Turn the bridge on or off
PATCH
/api/homekitAdmin. Needs an unlock token (
x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.Turns the HomeKit bridge on or off.
Request body application/json
enabledbooleanResponses
200OKapplication/json
enabledbooleanstatestringOne of
"off" "starting" "ready" "error"errorstring | nullmdnsErrorstring | nullportinteger | nullnamestringdeviceIdstringpairedbooleansetupCodestringsetupUristringX-HM://…, for the QR code.
pairingsobject[]accessoriesinteger403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X PATCH 'http://localhost:8080/api/homekit' \
-H 'content-type: application/json' \
-d '{
"enabled": true
}'const res = await fetch("http://localhost:8080/api/homekit", {
method: "PATCH",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"enabled": true
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.patch(
"http://localhost:8080/api/homekit",
json={
"enabled": True
},
)
print(res.json())Response
{
"enabled": true,
"state": "ready",
"error": null,
"mdnsError": null,
"port": 51826,
"name": "Tempolight 3F2A",
"deviceId": "3F:2A:10:C4:9B:E1",
"paired": false,
"setupCode": "123-45-678",
"setupUri": "X-HM://0023ISYWY3F2A",
"pairings": [],
"accessories": 7
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}