Skip to content

Not able to add accessory to HomeKit #45

@nickwilkie

Description

@nickwilkie

I've got HAP-ESPHome installed and running with a single lock entity. Everything is connected, and it's recognized when I look for accessories to add. When I try to add it, my phone says "Unable to Add Accessory, This acessory cannot be used with HomeKit". I've tried playing around with the homekit_base parameters, but not able to get connected. I'm on the same wifi network, no client isolation.

In the ESPHome logs, I get:

[13:28:43][D][LockEntity:074][httpd]: hap_event_handler > Found allocated controller - Hash: 
[13:28:43][D][LockEntity:079][httpd]: hap_event_handler > Issuer  already added, skipping

My config is:

substitutions:
  name: box-s3
  friendly_name: BOX-S3

esphome:
  name: ${name}
  friendly_name: ${friendly_name}
  min_version: 2025.5.0
  name_add_mac_suffix: false

esp32:
  board: esp32s3box
  flash_size: 16MB
  cpu_frequency: 240MHz
  framework:
    type: esp-idf
    sdkconfig_options:
      CONFIG_ESP32S3_DEFAULT_CPU_FREQ_240: "y"
      CONFIG_ESP32S3_DATA_CACHE_64KB: "y"
      CONFIG_ESP32S3_DATA_CACHE_LINE_64B: "y"

      CONFIG_COMPILER_OPTIMIZATION_SIZE: y
      CONFIG_LWIP_MAX_SOCKETS: "16"
      CONFIG_MBEDTLS_HKDF_C: y

external_components:
  source: github://rednblkx/HAP-ESPHome@main
  refresh: 0s

lock:
  - platform: template
    id: "s3_lock"
    name: "S3 Box Lock"
    optimistic: True
    on_lock:
    - logger.log: "Door Locked!"
    on_unlock:
    - logger.log: "Door Unlocked!"

homekit:
  lock:
    - id: s3_lock
      nfc_id: nfc_spi_module
      on_hk_success:
        lambda: |-
          ESP_LOGI("HEREHERE", "IssuerID: %s", x.c_str());
          ESP_LOGI("HEREHERE", "EndpointID: %s", y.c_str());
      on_hk_fail:
        lambda: |-
          ESP_LOGI("GSDGSGS", "IT FAILED :(");
      hk_hw_finish: "SILVER"

homekit_base:
  meta:
    name: "PRIMO"
    manufacturer: "AMICI&CO"
    model: "IMPERIUM"
    serial_number: "16161616"
    fw_rev: "0.16.2"
  setup_code: '159-35-728'
  setup_id: "ES32"

button:
- platform: homekit_base
  factory_reset:
    name: "Reset HomeKit pairings"

spi:
  clk_pin: 38
  miso_pin: 39
  mosi_pin: 40

pn532_spi:
  id: nfc_spi_module
  cs_pin: 41
  update_interval: 100ms

logger:
  level: DEBUG
  hardware_uart: USB_SERIAL_JTAG

api:
  encryption:
    key: "**********"

ota:
  - platform: esphome
    id: ota_esphome
    password: "*****************"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  ap:
    ssid: "Box-S3 Fallback Hotspot"
    password: "*******"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions