Skip to content

HKSV doorbell (category_id: doorbell) rejected by Home app: "Accessory out of compliance" #2560

Open

Description

@StaunchLemur29

Summary

An HKSV accessory with category_id: doorbell cannot be added in the Apple Home app. Pairing itself succeeds, the Home app reads /accessories, then closes the connection and shows "Unable to Add Accessory: Accessory out of compliance". The same stream pairs and records fine as a plain HKSV camera.

Environment

  • go2rtc 1.9.14+dev.6361dcb (Home Assistant add-on "go2rtc (dev)")
  • Apple Home app on iPhone (iOS version: FILL IN), Apple TV 4K as home hub
  • Source: 2N IP Solo intercom

Config

homekit:
  front_gate:
    name: Front Gate
    category_id: doorbell
    hksv: true
    motion: api
    speaker: true
    device_id: frontgate2

Also tried with motion: continuous and motion: detect, and without device_id. Same result each time.

What happens (trace log)

[homekit] new server: {"name":"Front Gate","port":1984,"info":{"c#":"1","ci":"18","ff":"0","id":"2D:8F:71:D2:74:65","md":"go2rtc/1.9.14+dev.6361dcb","pv":"1.1","s#":"1","sf":"1","sh":"JBNJ2w=="}}
15:20:14.740 [api] POST /pair-setup 192.168.1.5:51067
15:20:23.765 [hksv] add pair id=... perm=1 stream=front_gate
15:20:23.818 [api] POST /pair-verify 192.168.1.5:51068
15:20:23.822 [hksv] new conn stream=front_gate
15:20:23.828 [hksv] GET /accessories stream=front_gate
15:20:23.845 [hksv] connection closed stream=front_gate

The Home app drops the connection 17 ms after receiving the accessory JSON, so it is rejecting the accessory description, not the pairing.

What looks wrong in the accessory JSON

The Doorbell service is returned as:

{"type":"121","iid":286396416,"characteristics":[
  {"iid":286396531,"type":"73","format":"uint8","perms":["ev","pr"]}
]}

Two things stand out when compared with the camera accessory on the same server, which pairs fine:

  1. Programmable Switch Event (73) has no value key. It is the only characteristic with pr permission in the whole accessory that has no value. Other implementations return "value": null for it, which is what the HAP spec asks for on read.
  2. No service is marked primary. Other implementations mark the Doorbell service as the primary service for a video doorbell.

Everything else in the accessory is identical to the working camera, apart from the added Speaker (113) service, and that paired fine on this stream when it was a camera.

I have not confirmed which of the two the Home app objects to. There are no duplicate iids.

Suggested fix

  • Serialize characteristic 73 with an explicit "value": null.
  • Mark the Doorbell service as "primary": true.

Note

After the failed attempt go2rtc keeps the pairing it saved (pairings: is written to the config), so the accessory stops advertising as unpaired and has to be cleared by hand before trying again.

Activity

  1. added
    kind/support
    area/homekit
    ai
    on Oct 11, 2026
  2. self-assigned this
    on Oct 11, 2026
  3. emmanuel-blin commented on Oct 25, 2026

    @emmanuel-blin

    I hit the same "Accessory out of compliance" error with hksv: true on a doorbell, and a two-line change fixed it for me.

    Setup

    Cause
    In ServiceDoorbell() (pkg/hap/camera/services_hksv.go), characteristic 73 (Programmable Switch Event) has Value: nil. hap.Character.Value is json:"value,omitempty", so the characteristic goes out with no value key at all. For this characteristic HAP expects the key to be present, with null on reads. Also, none of the HKSV doorbell's services is marked primary. HAP-NodeJS-based doorbells make the Doorbell service primary.

    Change

    func ServiceDoorbell() *hap.Service {
    	return &hap.Service{
    		Type:    "121",
    		Primary: true, // added
    		Characters: []*hap.Character{
    			{
    				Type:   "73",
    				Format: hap.FormatUInt8,
    				Value:  json.RawMessage("null"), // was nil
    				Perms:  hap.EVPR,
    

    Result

    • The doorbell pairs in the Home app as an HKSV doorbell.
    • POST /api/homekit/doorbell?id=<stream> shows the native doorbell notification with the live view.
    • A real button press (Reolink → Home Assistant → the same API call) rings in Home.
    • Talk-back (Add native Opus conversion and AAC-LC/ELD decoding #2534) and live view keep working.
    • Existing tests pass, including TestTriggerDoorbell. TestAqaraG3, TestHomebridge, TestScrypted and one tlv8 test fail, but they fail the same way on the unpatched commit.

    Caveats

    • I made both changes at once, so I don't know if iOS needs both or only the null value.
    • After TriggerDoorbell() sets Value = 0, later reads return 0 instead of null. iOS didn't object in my testing. Resetting it to null after the notification makes TestTriggerDoorbell fail, so I left it alone.
  4. frankea commented on Nov 9, 2026

    @frankea

    Same error here, with one more data point: making the Doorbell service primary is not enough by itself.

    Setup

    • go2rtc 1.9.15+dev.38e3009 (HA OS, the "go2rtc (dev)" image with a locally patched binary)
    • Source: Aqara G4 video doorbell, via go2rtc's own homekit:// client → Frigate restream → go2rtc HKSV server
    • Config: category_id: doorbell, hksv: true, motion: api

    What I tried, in order (each time with a fresh device_id and the stale pairings: entry removed)

    # Change Result
    1 unpatched, speaker not set out of compliance
    2 unpatched, speaker: true out of compliance
    3 Doorbell service Primary: true + an extra Stateless Programmable Switch (89) with char 73; char 73 still serialized without a value key out of compliance
    4 shaped like the certified Aqara G4's own /accessories (below) pairs; HKSV doorbell works

    Together with the patch in the comment above (primary + null works), #3 suggests the missing "value": null on 73 is the necessary part.

    Reference: the certified Aqara G4's Doorbell service (read with a second controller pairing):

    {"iid":25,"type":"121","primary":true,"characteristics":[
      {"type":"23","format":"string","perms":["pr"],"value":"Video Doorbell"},
      {"type":"73","format":"uint8","perms":["pr","ev"],"value":null,"minValue":0,"maxValue":2,"minStep":1,"valid-values":[0]},
      {"type":"11A","format":"bool","perms":["pr","pw","ev"],"value":0},
      {"type":"232","format":"tlv8","perms":["pr","ev"],"value":"AQEA"},
      {"type":"119","format":"uint8","perms":["pr","pw","ev"],"value":50,"minValue":0,"maxValue":100,"minStep":1}]}

    The G4 also has a HAP Protocol Information service (A2, version 1.1.0), and its Camera Event Recording Management service is linked to both Data Stream Management and the Motion Sensor ("linked":[29,33]). It has no Stateless Programmable Switch.

    What #4 changes (I made these together, so I can't say which beyond the null are required):

    • pkg/hap/character.go: uncomment MinValue/MaxValue/MinStep/ValidVal, and add a MarshalJSON that writes "value": null for characteristics with pr permission and a nil value. That serializes 73 like the G4. The camera accessories (no nil pr values) are unchanged.
    • ServiceDoorbell(): 73 gets MinValue: 0, MaxValue: 2, MinStep: 1, ValidVal: []any{0}.
    • NewHKSVDoorbellAccessory(): doorbell.Primary = true, add hap.ServiceHAPProtocolInformation(), and recordingMgmt.Linked = []int{dataStreamMgmt.IID, motionSensor.IID}.
    • TriggerDoorbell(): fire every char 73 (only relevant if a Stateless Programmable Switch is added).

    pkg/hksv tests pass. TestAqaraG3/TestHomebridge/TestScrypted and one tlv8 test fail the same way on the unpatched commit, as noted above.

    Also confirming the note in the issue: each failed attempt leaves a pairings: entry, so the accessory advertises sf=0 and disappears from "More options" until it's removed by hand. #2641 doesn't touch ServiceDoorbell, so this is still open on dev as far as I can tell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

aiarea/homekitkind/support

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions