Skip to content

nomativ/HomeKit-connector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

homebridge-feit-electric

A Homebridge plugin that lets you control Feit Electric and TP-Link Kasa smart devices through Apple HomeKit.

All communication is local over your LAN — no cloud dependency at runtime.

Supported Devices

Feit Electric (Tuya-based)

Device Type HomeKit Service Features
White Bulb Lightbulb On/Off, Brightness, Color Temperature
Color (RGBW) Bulb Lightbulb On/Off, Brightness, Color Temp, Hue, Saturation
Smart Plug / Outlet Outlet On/Off
Smart Switch Switch On/Off
Dimmer Lightbulb On/Off, Brightness

TP-Link Kasa

Device Type HomeKit Service Features
Smart Switch (HS200, HS210, etc.) Switch On/Off
Smart Plug (HS100, HS103, HS105, HS110, etc.) Outlet On/Off
Dimmer Switch (HS220, etc.) Lightbulb On/Off, Brightness

Prerequisites

  • Homebridge v1.6.0 or later
  • Node.js 18 or later
  • Feit devices: Each device's Device ID and Local Key (see below)
  • Kasa devices: Each device's IP address on your local network

Installation

npm install -g homebridge-feit-electric

Or search for homebridge-feit-electric in the Homebridge UI plugins tab.

Getting Feit Device IDs and Local Keys

Feit devices are Tuya-based, so you extract credentials through the Tuya IoT Platform:

Step 1 — Link your Feit app to Tuya

  1. Go to Tuya IoT Platform and create a free account.
  2. Create a Cloud Project (select "Smart Home" as the industry, your region as the data center).
  3. Under your project, go to DevicesLink Tuya App Account.
  4. Download the Tuya Smart app (not the Feit app) on your phone.
  5. Add your Feit devices to the Tuya Smart app — they will appear because they use the Tuya platform.
  6. Link the Tuya Smart app to your Cloud Project using the QR code.

Step 2 — Get the Device ID and Local Key

  1. In the Tuya IoT Platform, go to DevicesAll Devices.
  2. Each device will show its Device ID.
  3. Click on a device to see its Local Key under the device details (you may need to use the API Explorer: call GET /v1.0/devices/{device_id} to retrieve the local_key).

Alternative: tinytuya wizard

If you have Python installed, you can use tinytuya:

pip install tinytuya
python -m tinytuya wizard

This walks you through linking your Tuya account and dumps all device IDs, keys, and IPs.

Getting Kasa Device IP Addresses

Kasa devices just need their IP address — no keys or cloud accounts required.

  1. Open the Kasa app on your phone.
  2. Tap on a device → Settings (gear icon) → Device Info.
  3. The IP address is shown under device information.

Alternatively, check your router's DHCP client list for devices named HS200, HS220, etc. Assigning a static IP (DHCP reservation) for each Kasa device is recommended so the address doesn't change.

Configuration

Add the platform to your Homebridge config.json:

{
  "platforms": [
    {
      "platform": "FeitElectric",
      "name": "Feit Electric",
      "devices": [
        {
          "name": "Living Room Light",
          "id": "your_device_id_here",
          "key": "your_local_key_here",
          "type": "color_bulb",
          "version": "3.3"
        },
        {
          "name": "Bedroom Lamp",
          "id": "another_device_id",
          "key": "another_local_key",
          "type": "lightbulb"
        },
        {
          "name": "Coffee Maker Plug",
          "id": "plug_device_id",
          "key": "plug_local_key",
          "type": "outlet"
        }
      ],
      "kasaDevices": [
        {
          "name": "Kitchen Switch",
          "host": "192.168.1.50",
          "type": "kasa_switch"
        },
        {
          "name": "Desk Lamp Plug",
          "host": "192.168.1.51",
          "type": "kasa_plug"
        },
        {
          "name": "Dining Room Dimmer",
          "host": "192.168.1.52",
          "type": "kasa_dimmer"
        }
      ]
    }
  ]
}

Feit Device Configuration

Option Required Default Description
name Yes Friendly name shown in HomeKit
id Yes Tuya Device ID
key Yes Device Local Key
type Yes lightbulb One of: lightbulb, color_bulb, outlet, switch, dimmer
ip No auto-discover Fixed IP address (skips UDP discovery)
version No 3.3 Tuya protocol version: 3.1, 3.3, or 3.4
dpsVersion No v2 DPS mapping: v1 for old 3.1 devices, v2 for 3.3+

Kasa Device Configuration

Option Required Default Description
name Yes Friendly name shown in HomeKit
host Yes IP address of the Kasa device
type Yes kasa_switch One of: kasa_switch, kasa_plug, kasa_dimmer

How It Works

┌──────────────┐       HomeKit (HAP)       ┌─────────────┐
│  Apple Home   │ ◄──────────────────────► │  Homebridge  │
│  / Siri       │                          │              │
└──────────────┘                           └──────┬───────┘
                                                  │
                                           homebridge-feit-electric
                                           ┌──────┴──────┐
                                           │             │
                                    Tuya (TCP)    Kasa (TCP/UDP)
                                           │             │
                    ┌──────────────────────┐    ┌────────────────────────┐
                    │                      │    │                        │
             ┌──────┴──────┐  ┌────────────┴┐  ┌┴───────────┐  ┌────────┴─────┐
             │ Feit Bulb    │  │ Feit Plug   │  │ Kasa Switch │  │ Kasa Plug    │
             │ 192.168.1.x  │  │ 192.168.1.y │  │ 192.168.1.a │  │ 192.168.1.b  │
             └─────────────┘  └─────────────┘  └────────────┘  └──────────────┘
  • Feit devices: Discovered via UDP broadcast (or fixed IP), connected over TCP port 6668, AES-encrypted with the device's local key.
  • Kasa devices: Connected by IP address over TCP, using the TP-Link Smarthome protocol. State is polled every 10 seconds.

Troubleshooting

Feit: Device not connecting

  • Make sure the Feit/Tuya app is closed on your phone. Tuya devices only allow one TCP connection at a time.
  • Verify the device is on the same LAN/subnet as your Homebridge server.
  • Check that UDP ports 6666–6667 and TCP port 6668 are not blocked by your firewall.

Feit: Decryption errors

  • The local key changes every time you remove and re-add a device in the Feit/Tuya app. Re-extract the key.
  • Make sure the protocol version matches your device firmware.

Kasa: Device not connecting

  • Verify the IP address is correct and the device is reachable (ping 192.168.1.x).
  • Use a static IP / DHCP reservation so the address doesn't change.
  • Make sure the device is on the same LAN/subnet as your Homebridge server.
  • Note: Newer TP-Link devices branded as Tapo use a different protocol and are not supported.

Device shows as "Not Responding"

  • The device may be offline or unreachable. Check its Wi-Fi connection.
  • The plugin will automatically attempt to reconnect with backoff.

Development

git clone <this-repo>
cd HomeKit-connector
npm install
npm run build
npm link
# Then restart Homebridge

License

ISC

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors