HomeKit Accessory Protocol (HAP) over CoAP/UDP (was: Nanoleaf Essentials bulb via Thread/CoAP)

@Jc2k I don’t know if this helps, but I did download the diagnostics when it was on ble. I’ll Re-pair it via ble tomorrow and grab the logs.

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.12.6",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.10.7",
    "docker": true,
    "arch": "aarch64",
    "timezone": "America/Los_Angeles",
    "os_name": "Linux",
    "os_version": "5.15.76-v8",
    "supervisor": "2022.11.2",
    "host_os": "Home Assistant OS 9.4",
    "docker_version": "20.10.19",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {
    "hacs": {
      "version": "1.28.4",
      "requirements": [
        "aiogithubapi>=22.2.4"
      ]
    },
    "homekit_controller": {
      "version": "10.0.0",
      "requirements": [
        "aiohomekit==2.4.1"
      ]
    }
  },
  "integration_manifest": {
    "domain": "homekit_controller",
    "name": "HomeKit Controller Mod",
    "config_flow": true,
    "documentation": "https://www.home-assistant.io/integrations/homekit_controller",
    "requirements": [
      "aiohomekit==2.4.1"
    ],
    "zeroconf": [
      "_hap._tcp.local.",
      "_hap._udp.local."
    ],
    "bluetooth": [
      {
        "manufacturer_id": 76,
        "manufacturer_data_start": [
          6
        ]
      }
    ],
    "dependencies": [
      "bluetooth",
      "zeroconf"
    ],
    "codeowners": [
      "@Jc2k",
      "@bdraco"
    ],
    "iot_class": "local_push",
    "loggers": [
      "aiohomekit",
      "commentjson"
    ],
    "version": "10.0.0",
    "is_built_in": false
  },
  "data": {
    "config-entry": {
      "title": "Airversa AP2 1306",
      "version": 1,
      "data": {
        "AccessoryPairingID": "93:44:E2:00:03:42",
        "AccessoryLTPK": "59beab0fa8df55a6a2b88f87ae3570adc4f5ebcb2aec4e5e7fb3319f954a05bc",
        "iOSPairingId": "af47acbe-8506-401e-a8ce-ed04f490ea6a",
        "iOSDeviceLTSK": "**REDACTED**",
        "iOSDeviceLTPK": "43410f3163532d9bb04e21705367c07638f398276177ceacdef7240473fd9728",
        "AccessoryAddress": "F2:A8:AC:68:42:3F",
        "Connection": "BLE"
      }
    },
    "entity-map": [
      {
        "aid": 1,
        "services": [
          {
            "iid": 32896,
            "type": "000000BA-0000-1000-8000-0026BB765291",
            "characteristics": [
              {
                "type": "000000AB-0000-1000-8000-0026BB765291",
                "iid": 32900,
                "perms": [
                  "pr",
                  "ev"
                ],
                "format": "float",
                "value": 100.0,
                "description": "Filter Life Level",
                "minValue": 0.0,
                "maxValue": 100.0,
                "minStep": 1.0,
                "handle": 167,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "000000AC-0000-1000-8000-0026BB765291",
                "iid": 32899,
                "perms": [
                  "pr",
                  "ev"
                ],
                "format": "uint8",
                "value": 0,
                "description": "Filter Change Indication",
                "minValue": 0,
                "maxValue": 1,
                "handle": 163,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "000000A5-0000-1000-8000-0026BB765291",
                "iid": 32897,
                "perms": [
                  "pr"
                ],
                "format": "data",
                "value": null,
                "handle": 157
              },
              {
                "type": "00000023-0000-1000-8000-0026BB765291",
                "iid": 32898,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "Filter Maintenance",
                "description": "Name",
                "maxLen": 64,
                "handle": 160
              }
            ]
          },
          {
            "iid": 1,
            "type": "0000003E-0000-1000-8000-0026BB765291",
            "characteristics": [
              {
                "type": "00000023-0000-1000-8000-0026BB765291",
                "iid": 5,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "Airversa AP2 1306",
                "description": "Name",
                "maxLen": 64,
                "handle": 28
              },
              {
                "type": "00000030-0000-1000-8000-0026BB765291",
                "iid": 6,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "**REDACTED**",
                "description": "Serial Number",
                "maxLen": 64,
                "handle": 31
              },
              {
                "type": "00000021-0000-1000-8000-0026BB765291",
                "iid": 4,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "AP2",
                "description": "Model",
                "maxLen": 64,
                "handle": 25
              },
              {
                "type": "34AB8811-AC7F-4340-BAC3-FD6A85F9943B",
                "iid": 9,
                "perms": [
                  "pr",
                  "hd"
                ],
                "format": "string",
                "value": "\"6.1\";72ca72be",
                "maxLen": 64,
                "handle": 40
              },
              {
                "type": "00000220-0000-1000-8000-0026BB765291",
                "iid": 10,
                "perms": [
                  "pr"
                ],
                "format": "data",
                "value": "2646e00091f99a29",
                "handle": 43
              },
              {
                "type": "00000014-0000-1000-8000-0026BB765291",
                "iid": 2,
                "perms": [
                  "pw"
                ],
                "format": "bool",
                "description": "Identify",
                "handle": 19
              },
              {
                "type": "00000052-0000-1000-8000-0026BB765291",
                "iid": 7,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "0.8.48",
                "description": "Firmware Revision",
                "maxLen": 64,
                "handle": 34
              },
              {
                "type": "00000053-0000-1000-8000-0026BB765291",
                "iid": 8,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "0.1",
                "description": "Hardware Revision",
                "maxLen": 64,
                "handle": 37
              },
              {
                "type": "00000020-0000-1000-8000-0026BB765291",
                "iid": 3,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "Sleekpoint Innovations",
                "description": "Manufacturer",
                "maxLen": 64,
                "handle": 22
              }
            ]
          },
          {
            "iid": 112,
            "type": "00000701-0000-1000-8000-0026BB765291",
            "characteristics": [
              {
                "type": "00000704-0000-1000-8000-0026BB765291",
                "iid": 119,
                "perms": [
                  "pr",
                  "pw"
                ],
                "format": "data",
                "value": "",
                "handle": 190
              },
              {
                "type": "00000702-0000-1000-8000-0026BB765291",
                "iid": 115,
                "perms": [
                  "pr"
                ],
                "format": "uint16",
                "value": 12,
                "description": "Thread Node Capabilities",
                "minValue": 0,
                "maxValue": 31,
                "handle": 180
              },
              {
                "type": "0000022B-0000-1000-8000-0026BB765291",
                "iid": 118,
                "perms": [
                  "pr"
                ],
                "format": "bool",
                "value": false,
                "handle": 187
              },
              {
                "type": "00000703-0000-1000-8000-0026BB765291",
                "iid": 117,
                "perms": [
                  "pr",
                  "ev"
                ],
                "format": "uint16",
                "value": 32,
                "description": "Thread Status",
                "minValue": 0,
                "maxValue": 127,
                "handle": 183,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "000000A5-0000-1000-8000-0026BB765291",
                "iid": 113,
                "perms": [
                  "pr"
                ],
                "format": "data",
                "value": null,
                "handle": 174
              },
              {
                "type": "00000706-0000-1000-8000-0026BB765291",
                "iid": 116,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "OPENTHREAD/thread-reference-20200818-ncs1-rc3-560-g02e61a2ed; Zephyr; Feb 11 2022 08:26:44",
                "maxLen": 64,
                "handle": 177
              }
            ]
          },
          {
            "iid": 32,
            "type": "00000055-0000-1000-8000-0026BB765291",
            "characteristics": [
              {
                "type": "0000004E-0000-1000-8000-0026BB765291",
                "iid": 35,
                "perms": [],
                "format": "data",
                "description": "Pair Verify",
                "handle": 61
              },
              {
                "type": "00000050-0000-1000-8000-0026BB765291",
                "iid": 37,
                "perms": [
                  "pr",
                  "pw"
                ],
                "format": "data",
                "value": null,
                "description": "Pairing Pairings",
                "handle": 67
              },
              {
                "type": "0000004F-0000-1000-8000-0026BB765291",
                "iid": 36,
                "perms": [],
                "format": "uint8",
                "description": "Pairing Features",
                "handle": 64
              },
              {
                "type": "0000004C-0000-1000-8000-0026BB765291",
                "iid": 34,
                "perms": [],
                "format": "data",
                "description": "Pair Setup",
                "handle": 58
              }
            ]
          },
          {
            "iid": 16,
            "type": "000000A2-0000-1000-8000-0026BB765291",
            "characteristics": [
              {
                "type": "000000A5-0000-1000-8000-0026BB765291",
                "iid": 17,
                "perms": [
                  "pr"
                ],
                "format": "data",
                "value": null,
                "handle": 49
              },
              {
                "type": "00000037-0000-1000-8000-0026BB765291",
                "iid": 18,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "2.2.0",
                "description": "Version",
                "maxLen": 64,
                "handle": 52
              }
            ]
          },
          {
            "iid": 2576,
            "type": "0000008D-0000-1000-8000-0026BB765291",
            "characteristics": [
              {
                "type": "000000C6-0000-1000-8000-0026BB765291",
                "iid": 2580,
                "perms": [
                  "pr",
                  "ev"
                ],
                "format": "float",
                "value": 1.0,
                "description": "PM2.5 Density",
                "minValue": 0.0,
                "maxValue": 1000.0,
                "minStep": 1.0,
                "handle": 142,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "00000095-0000-1000-8000-0026BB765291",
                "iid": 2579,
                "perms": [
                  "pr",
                  "ev"
                ],
                "format": "uint8",
                "value": 1,
                "description": "Air Quality",
                "minValue": 0,
                "maxValue": 5,
                "handle": 138,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "000000A5-0000-1000-8000-0026BB765291",
                "iid": 2577,
                "perms": [
                  "pr"
                ],
                "format": "data",
                "value": null,
                "handle": 132
              },
              {
                "type": "00000023-0000-1000-8000-0026BB765291",
                "iid": 2578,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "Air Quality Sensor",
                "description": "Name",
                "maxLen": 64,
                "handle": 135
              },
              {
                "type": "00000602-5E50-11EC-B400-0A80FF2603DE",
                "iid": 2582,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "uint8",
                "value": 0,
                "minValue": 0,
                "maxValue": 1,
                "handle": 150,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "00000601-5E50-11EC-B400-0A80FF2603DE",
                "iid": 2581,
                "perms": [
                  "pr",
                  "ev"
                ],
                "format": "data",
                "value": "000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
                "handle": 146,
                "disconnected_events": true,
                "broadcast_events": true
              }
            ]
          },
          {
            "iid": 32960,
            "type": "00000100-5E50-11EC-B400-0A80FF2603DE",
            "characteristics": [
              {
                "type": "00000101-5E50-11EC-B400-0A80FF2603DE",
                "iid": 32963,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "int",
                "value": 0,
                "minValue": -1200,
                "maxValue": 1400,
                "handle": 218,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "00000023-0000-1000-8000-0026BB765291",
                "iid": 32962,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "Date Time",
                "description": "Name",
                "maxLen": 64,
                "handle": 215
              },
              {
                "type": "00000102-5E50-11EC-B400-0A80FF2603DE",
                "iid": 32964,
                "perms": [
                  "pr",
                  "pw"
                ],
                "format": "uint32",
                "value": 0,
                "handle": 222
              },
              {
                "type": "000000A5-0000-1000-8000-0026BB765291",
                "iid": 32961,
                "perms": [
                  "pr"
                ],
                "format": "data",
                "value": null,
                "handle": 212
              }
            ]
          },
          {
            "iid": 32832,
            "type": "000000BB-0000-1000-8000-0026BB765291",
            "characteristics": [
              {
                "type": "000000B0-0000-1000-8000-0026BB765291",
                "iid": 32835,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "uint8",
                "value": 1,
                "description": "Active",
                "minValue": 0,
                "maxValue": 1,
                "handle": 79,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "00000023-0000-1000-8000-0026BB765291",
                "iid": 32834,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "AirPurifier",
                "description": "Name",
                "maxLen": 64,
                "handle": 76
              },
              {
                "type": "00000401-5E50-11EC-B400-0A80FF2603DE",
                "iid": 32844,
                "perms": [
                  "pr",
                  "pw",
                  "ev",
                  "hd"
                ],
                "format": "uint8",
                "value": 0,
                "minValue": 0,
                "maxValue": 2,
                "handle": 115,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "000000A7-0000-1000-8000-0026BB765291",
                "iid": 32839,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "uint8",
                "value": 0,
                "description": "Lock Physical Controls",
                "minValue": 0,
                "maxValue": 1,
                "handle": 95,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "000000A9-0000-1000-8000-0026BB765291",
                "iid": 32836,
                "perms": [
                  "pr",
                  "ev"
                ],
                "format": "uint8",
                "value": 2,
                "description": "Current Air Purifier State",
                "minValue": 0,
                "maxValue": 2,
                "handle": 83,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "00000005-5E50-11EC-B400-0A80FF2603DE",
                "iid": 32841,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "uint8",
                "value": 255,
                "minValue": 1,
                "maxValue": 255,
                "handle": 103,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "00000004-5E50-11EC-B400-0A80FF2603DE",
                "iid": 32840,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "uint8",
                "value": 255,
                "minValue": 1,
                "maxValue": 255,
                "handle": 99,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "00000501-5E50-11EC-B400-0A80FF2603DE",
                "iid": 32845,
                "perms": [
                  "pr",
                  "pw"
                ],
                "format": "data",
                "value": "0000000000000000000000000000000000000000",
                "handle": 119
              },
              {
                "type": "00000029-0000-1000-8000-0026BB765291",
                "iid": 32838,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "float",
                "value": 20.0,
                "description": "Rotation Speed",
                "unit": "percentage",
                "minValue": 0.0,
                "maxValue": 100.0,
                "minStep": 20.0,
                "handle": 91,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "00000006-5E50-11EC-B400-0A80FF2603DE",
                "iid": 32842,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "uint8",
                "value": 1,
                "minValue": 0,
                "maxValue": 1,
                "handle": 107,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "00000402-5E50-11EC-B400-0A80FF2603DE",
                "iid": 32847,
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "Airversa AP2 1306",
                "maxLen": 64,
                "handle": 126
              },
              {
                "type": "00000502-5E50-11EC-B400-0A80FF2603DE",
                "iid": 32846,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "data",
                "value": "0000000000000000",
                "handle": 122,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "0000011A-0000-1000-8000-0026BB765291",
                "iid": 32843,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "bool",
                "value": true,
                "description": "Mute",
                "handle": 111,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "000000A5-0000-1000-8000-0026BB765291",
                "iid": 32833,
                "perms": [
                  "pr"
                ],
                "format": "data",
                "value": null,
                "handle": 73
              },
              {
                "type": "000000A8-0000-1000-8000-0026BB765291",
                "iid": 32837,
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "uint8",
                "value": 0,
                "description": "Target Air Purifier State",
                "minValue": 0,
                "maxValue": 1,
                "handle": 87,
                "disconnected_events": true,
                "broadcast_events": true
              }
            ]
          },
          {
            "iid": 2560,
            "type": "00000239-0000-1000-8000-0026BB765291",
            "characteristics": [
              {
                "type": "000000A5-0000-1000-8000-0026BB765291",
                "iid": 2564,
                "perms": [
                  "pr"
                ],
                "format": "data",
                "value": null,
                "handle": 196
              },
              {
                "type": "0000024A-0000-1000-8000-0026BB765291",
                "iid": 2565,
                "perms": [
                  "pr",
                  "ev"
                ],
                "format": "uint32",
                "value": 1,
                "handle": 205,
                "disconnected_events": true,
                "broadcast_events": true
              },
              {
                "type": "0000023C-0000-1000-8000-0026BB765291",
                "iid": 2562,
                "perms": [
                  "pr"
                ],
                "format": "data",
                "value": "",
                "handle": 202
              },
              {
                "type": "0000023A-0000-1000-8000-0026BB765291",
                "iid": 2561,
                "perms": [
                  "pr"
                ],
                "format": "uint32",
                "value": 0,
                "minValue": 0,
                "maxValue": 67108863,
                "handle": 199
              }
            ]
          }
        ]
      }
    ],
  }
}

And the rest

 "config-num": 1,
    "device": {
      "name": "Airversa AP2 1306",
      "model": "AP2",
      "manfacturer": "Sleekpoint Innovations",
      "sw_version": "0.8.48",
      "hw_version": "0.1",
      "entities": [
        {
          "original_name": "Airversa AP2 1306 Air Quality",
          "original_device_class": "aqi",
          "entity_category": null,
          "original_icon": null,
          "icon": null,
          "unit_of_measurement": null,
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "sensor.airversa_ap2_1306_air_quality",
            "state": "1",
            "attributes": {
              "state_class": "measurement",
              "device_class": "aqi",
              "friendly_name": "Airversa AP2 1306 Air Quality"
            },
            "last_changed": "2022-12-15T13:09:01.840522+00:00",
            "last_updated": "2022-12-15T13:09:01.840522+00:00"
          }
        },
        {
          "original_name": "Airversa AP2 1306 AirPurifier",
          "original_device_class": null,
          "entity_category": null,
          "original_icon": null,
          "icon": null,
          "unit_of_measurement": null,
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "fan.airversa_ap2_1306_airpurifier",
            "state": "on",
            "attributes": {
              "preset_modes": null,
              "percentage": 20,
              "percentage_step": 20.0,
              "preset_mode": null,
              "friendly_name": "Airversa AP2 1306 AirPurifier",
              "supported_features": 1
            },
            "last_changed": "2022-12-15T12:24:16.507007+00:00",
            "last_updated": "2022-12-15T12:24:16.507007+00:00"
          }
        },
        {
          "original_name": "Airversa AP2 1306 Automatic Fan Speed",
          "original_device_class": null,
          "entity_category": "config",
          "original_icon": "mdi:lock-open",
          "icon": null,
          "unit_of_measurement": null,
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "switch.airversa_ap2_1306_automatic_fan_speed",
            "state": "off",
            "attributes": {
              "icon": "mdi:lock-open",
              "friendly_name": "Airversa AP2 1306 Automatic Fan Speed"
            },
            "last_changed": "2022-12-15T12:25:07.298317+00:00",
            "last_updated": "2022-12-15T12:25:07.298317+00:00"
          }
        },
        {
          "original_name": "Airversa AP2 1306 Identify",
          "original_device_class": null,
          "entity_category": "diagnostic",
          "original_icon": null,
          "icon": null,
          "unit_of_measurement": null,
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "button.airversa_ap2_1306_identify",
            "state": "unknown",
            "attributes": {
              "friendly_name": "Airversa AP2 1306 Identify"
            },
            "last_changed": "2022-12-15T12:24:16.507645+00:00",
            "last_updated": "2022-12-15T12:24:16.507645+00:00"
          }
        },
        {
          "original_name": "Airversa AP2 1306 Lock Physical Controls",
          "original_device_class": null,
          "entity_category": "config",
          "original_icon": "mdi:lock-open",
          "icon": null,
          "unit_of_measurement": null,
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "switch.airversa_ap2_1306_lock_physical_controls",
            "state": "off",
            "attributes": {
              "icon": "mdi:lock-open",
              "friendly_name": "Airversa AP2 1306 Lock Physical Controls"
            },
            "last_changed": "2022-12-15T12:24:16.508718+00:00",
            "last_updated": "2022-12-15T12:24:16.508718+00:00"
          }
        },
        {
          "original_name": "Airversa AP2 1306 Mute",
          "original_device_class": null,
          "entity_category": "config",
          "original_icon": "mdi:lock-open",
          "icon": null,
          "unit_of_measurement": null,
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "switch.airversa_ap2_1306_mute",
            "state": "on",
            "attributes": {
              "icon": "mdi:lock-open",
              "friendly_name": "Airversa AP2 1306 Mute"
            },
            "last_changed": "2022-12-15T19:15:27.768920+00:00",
            "last_updated": "2022-12-15T19:15:27.768920+00:00"
          }
        },
        {
          "original_name": "Airversa AP2 1306 PM2.5 Density",
          "original_device_class": "pm25",
          "entity_category": null,
          "original_icon": null,
          "icon": null,
          "unit_of_measurement": "\u00b5g/m\u00b3",
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "sensor.airversa_ap2_1306_pm2_5_density",
            "state": "1.0",
            "attributes": {
              "state_class": "measurement",
              "unit_of_measurement": "\u00b5g/m\u00b3",
              "device_class": "pm25",
              "friendly_name": "Airversa AP2 1306 PM2.5 Density"
            },
            "last_changed": "2022-12-15T20:24:22.359717+00:00",
            "last_updated": "2022-12-15T20:24:22.359717+00:00"
          }
        },
        {
          "original_name": "Airversa AP2 1306 Sleep Mode",
          "original_device_class": null,
          "entity_category": "config",
          "original_icon": "mdi:lock-open",
          "icon": null,
          "unit_of_measurement": null,
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "switch.airversa_ap2_1306_sleep_mode",
            "state": "on",
            "attributes": {
              "icon": "mdi:lock-open",
              "friendly_name": "Airversa AP2 1306 Sleep Mode"
            },
            "last_changed": "2022-12-15T12:25:06.993842+00:00",
            "last_updated": "2022-12-15T12:25:06.993842+00:00"
          }
        },
        {
          "original_name": "Airversa AP2 1306 Thread Capabilities",
          "original_device_class": "homekit_controller__thread_node_capabilities",
          "entity_category": "diagnostic",
          "original_icon": null,
          "icon": null,
          "unit_of_measurement": null,
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "sensor.airversa_ap2_1306_thread_capabilities",
            "state": "router_eligible",
            "attributes": {
              "device_class": "homekit_controller__thread_node_capabilities",
              "friendly_name": "Airversa AP2 1306 Thread Capabilities"
            },
            "last_changed": "2022-12-15T12:24:16.503274+00:00",
            "last_updated": "2022-12-15T12:24:16.503274+00:00"
          }
        },
        {
          "original_name": "Airversa AP2 1306 Thread Status",
          "original_device_class": "homekit_controller__thread_status",
          "entity_category": "diagnostic",
          "original_icon": null,
          "icon": null,
          "unit_of_measurement": null,
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "sensor.airversa_ap2_1306_thread_status",
            "state": "leader",
            "attributes": {
              "device_class": "homekit_controller__thread_status",
              "friendly_name": "Airversa AP2 1306 Thread Status"
            },
            "last_changed": "2022-12-15T12:24:16.504256+00:00",
            "last_updated": "2022-12-15T12:24:16.504256+00:00"
          }
        },
        {
          "original_name": "Airversa AP2 1306 thread button",
          "original_device_class": null,
          "entity_category": null,
          "original_icon": null,
          "icon": null,
          "unit_of_measurement": null,
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "button.airversa_ap2_1306_thread_button",
            "state": "2022-12-15T12:03:54.348144+00:00",
            "attributes": {
              "friendly_name": "Airversa AP2 1306 thread button"
            },
            "last_changed": "2022-12-15T12:24:16.508208+00:00",
            "last_updated": "2022-12-15T12:24:16.508208+00:00"
          }
        },
        {
          "original_name": "Signal strength",
          "original_device_class": "signal_strength",
          "entity_category": "diagnostic",
          "original_icon": null,
          "icon": null,
          "unit_of_measurement": "dBm",
          "device_class": null,
          "disabled": false,
          "disabled_by": null,
          "state": {
            "entity_id": "sensor.airversa_ap2_1306_signal_strength",
            "state": "-86",
            "attributes": {
              "unit_of_measurement": "dBm",
              "device_class": "signal_strength",
              "friendly_name": "Airversa AP2 1306 Signal strength"
            },
            "last_changed": "2022-12-15T20:23:10.060928+00:00",
            "last_updated": "2022-12-15T20:23:10.060928+00:00"
          }
        }
      ]
    }

Looks like its leading 0’s
char: 00000004-5e50-11ec-b400-0a80ff2603de
45E5011ECB4000A80FF2603DE

2022-12-16 23:26:27.629 DEBUG (MainThread) [aiohomekit.pdu] Got PDU 2: TID 3f (Expected: 3f), Status:0, Len:57 - bytearray(b"\x02?\x009\x00\x04\x10\xde\x03&\xff\x80\n\x00\xb4\xec\x11P^\x04\x00\x00\x00\x07\x02@\x80\x06\x10\x91Rv\xbb&\x00\x00\x80\x00\x10\x00\x00\xbb\x00\x00\x00\n\x02\xb0\x03\x0c\x07\x04\x00\x00\'\x01\x00\x00\r\x02\x01\xff")
2022-12-16 23:26:27.630 DEBUG (MainThread) [aiohomekit.controller.ble.pairing] Airversa AP2 1306 [F2:A8:AC:68:42:3F] (id=3A:E1:41:0A:7C:CB): char: 00000004-5e50-11ec-b400-0a80ff2603de (Handle: 99): Unknown decoded: {'type': '45E5011ECB4000A80FF2603DE', 'iid': None, 'perms': ['pr', 'pw', 'ev'], 'broadcast_events': True, 'disconnected_events': True, 'format': 'uint8', 'minValue': 1, 'maxValue': 255}

Is there a way to override aiohomekit in home assistant? I want to poke around with the uuid script. It looks like HA “requirements” does a pip install. Is there a way I can upload a modded version of aiohomekit or will have had to mess with sys paths in homekit controller?

NVM I just ripped the relevant functions from aiohomekit and stuck them into connection.py in homekit controller. I set up some code to prepend 0’s if the length was too short and everything works happily! Thread is so fast! I love it! Thanks for the help @lambdafunction & @Jc2k !

Hi guys, slightly off-topic issue, but it seems to be a direct consequence of the current onboarding process - a firmware update is identified in Nanoleaf app but fails to update.

I have 3 Nanoleaf A19 and 4 lightstrips, added through HomeKit controller and 4 HomePod minis. Everything works great, I removed the lights from Nanoleaf app, added them to HomeKit controller and then exposed them via HomeKit to the Home app.

They have been relatively stable for a couple of months, with the minor exception each time I update the HomePod OS, and need to restart (in this sequence) all the HomePods, followed by the Raspberry Pi (host restart).

The lights show up in Nanoleaf app, the app tells me there’s a firmware update, from 1.6.35 to 1.6.41, but when I tap Update, it fails…

I hope there’s a way to update them that doesn’t involve removing the lights from HA and re-adding them.

@DesertNomadBear just to confirm: you are running the Nanoleaf app on an iPhone?

Hmm. I’ve been keeping mine up to date using an Android phone. I’ve done a bit of exploring around how the firmware update process works but it has stalled out recently (read: HA won’t support this natively soon). Do you re-expose your HK accessories to your Home via the HA HomeKit component? There’s a chance that could work…

Also, good news. I’ve found the source of (my?) CoAP POST returned unexpected code [...] ACK 4.04 Not Found errors. I’ve been doing a packet dump of the Thread network and saw that I get a 404 when HA switches the IPv6 address it is using to talk to the bulbs. It appears transient as when I added code to drop that exchange & keep the session alive, at the next 60 second poll HA had reverted to using the prior IPv6 address and comms continued. The real fix here is to lock comms to one local IPv6 address. TBD.

@lambdafunction Great news! I get a ton of those errors, so I am excited to see if your fix solves mine as well. Any idea when to expect it in a release? Thanks!

I wanted to thank you for pointing out those patches/PRs. I’ve got my Nanoleaf bulbs joined to my own OTBR now too!

1 Like

Everything seems very reliable now! Just added a wemo smart plug to the thread network. I’ll have a lot more devices soon to do more testing!

@popnfresh the PR is up for review now: fix: bind to a specific local IPv6 address during pair verify by roysjosh · Pull Request #272 · Jc2k/aiohomekit · GitHub & I’m running it locally to test. Given how close we are to various holidays, I’d be surprised if it makes a 2022.12 point release. So I’d say expect 2023.01 and we’ll all be pleasantly surprised if it sneaks into .9 or something :slight_smile:

Fantastic, thank you again and happy holidays!

I don’t think there is a way to update them via homekit in ha. I’m starting to read through the homekit code to see how it all works to see if I can find a way to do updates. I also tried to use a19 scenes from the nanoleaf app and they don’t work via the homkit componenet in ha.

Yes, I’m using the Nanoleaf app on an iPhone.

Basically what I did was to follow the steps in this post, add the lights to Home app, delete them from Home app once they joined thread (which gets them removed from Nanoleaf app too ! ), add them to HA via HomeKit Controller, expose them back to Home app via HA HomeKit (once added, they are present again in the Nanoleaf app).

It seems Nanoleaf recognizes them and the firmware update after the re-add, but something doesn’t allow the firmware to install.

2 Likes

@DesertNomadBear hmm interesting, thanks for the details. From what I remember about the firmware update process, there was a vendor-specific characteristic value that the NL app read from that was used in the update process. I don’t think HA passes through unknown characteristics…? I’ll add that the update itself is over BLE (even if it is initiated over Thread) so make sure you are close to the bulb. But this may take some work to do.

@JuliusBlueTek I don’t think there is a HAP standard way to do firmware updates, unfortunately. That is something Zigbee got right. Also, see HomeKit Accessory Protocol (HAP) over CoAP/UDP (was: Nanoleaf Essentials bulb via Thread/CoAP) - #68 by lambdafunction for some of my RE on scenes. I think the same comment will apply to you: HA doesn’t re-expose every service/characteristic of the underlying accessory, just the ones it knows how to handle.

hello all, I am a novice on HA so I might have some things confused, so please excuse me in advance.

I have some 3xNanoleaf bulbs and 3xEVE smart energy plugs. If I set them up via the Home, or the Nanoleaf and EVE apps, everything works inside the EVE, Nanoleaf and Home apps over thread (I have a homepod mini)

I managed to bring all these devices into HA by following the steps I read above. I removed all these devices from home (which removed from everywhere), added them to HA via Homekit controller and then exposed them back to the Home app via HA homekit. After that the devices were present in all apps (HA, home, nanolead, eve).

Some observations of what happened next:
-The nanoleaf app would not update the nanoleaf bulbs to the latest firmware (even if I hold the phone very close by)
-The eve app could see the eve smartplug devices, but energy readings were no longer present in the app. Energy data is available on HA though.
-The devices (nanoleaf and eve) became unavailable within 24 hours in all apps (in HA still working though)

I have repeated the above process 2-3 times already and the above keep on happening.

I am wondering, why is it not possible to set everything up on the Home App (for such devices at least that use thread and are made for Homekit) and then expose them from there to HA?
Why is it necessary to remove them, re-expose them back to homekit, etc. in which case the devices appear to have almost full functionality in HA, but limited functionality in the original apps or homekit.
Perhaps I got something wrong in the whole process, but the above question really puzzles me.

@sp8 The HomeKit protocol (HAP) is a local only cloud-free protocol that uses very strong encryption. It only allows one “admin” controller. When a device is paired, it is paired, and you cannot pair it with another device. This means that if you have a device in the “Home” app and you want it to be in Home Assistant, you need to remove it from the Home app first. This is a design decision made by Apple, and not something we can control.

You have to remember that unlike Matter, the HomeKit API was never really meant to have multiple controllers. The only “client” was going to be your iOS devices, there was never a spec or plan for third part clients like homekit_controller.

There is no API in HomeKit that lets you “share” from the Home app to Home Assistant. What you describe is something that Matter can do, but it’s not something HomeKit can do.

(You can “hack” your iCloud Keychain and dump the encryption keys, and then import them into HA but this is very advanced and requires a macOS device running specific versions of macOS and Xcode that has had several low level security features disabled).

Eventually you will be able to pair HomeKit Thread devices directly with Home Assistant without an iPhone at all, but we are still getting the code to do that reliable as possible (and that means renovating some of our pre-thread code).

1 Like

Many thanks for the thorough explanation. It makes much more sense now.
I am looking forward for Matter, that that will hopefully solve a lot of these problems

@JuliusBlueTek have put up a PR that should fix your device, so hopefully in 2023.1.0 you’ll be able to use upstream code without having to patch it locally. (Pad short uuid with 0's by Jc2k · Pull Request #274 · Jc2k/aiohomekit · GitHub).

1 Like

@lambdafunction Just wanted to give you a quick update that the “CoAP POST returned unexpected code […] ACK 4.04 Not Found errors” are completely gone now with the 2023.1 update. Thanks again!

Also, my thread network in general has been working much better overall the past month or so. I still have the occasional nanoleaf bulb the fails to turn off/on due to a failed service call but hopefully the other work that is being done here helps with that eventually.

I’m also looking forward to one day being able to use my SkyConnect as a thread border router and let HA completely manage my thread network. Thanks to everyone working on all of this stuff!

That’s good news, we’ve actually only merged half the fix so far as well!

1 Like