Teckin Smart Plug / Socket with HomeKit using homebridge

Context

I wanted to automate my outdoor lights to enable timers and motion detectors to trigger them to make the house a little safer and easier to navigate at night. I have not decided on an activation method yet, but the first step, will be to just get them on HomeKit. I considered smart bulbs, but that would mean i’d need to change the existing PIR fixtures and I do not need to dim them or anything, so this seemed overkill. I can disable the PIR on them all and set them to always on, so a smart socket will do the job great!

I started looking for HomeKit smart sockets in the UK and the choice is very limited and often pricey.  I decided to just try a Teckin £10 socket from Amazon, which was not HomeKit compatible, but I was certain I could work something out with homebridge.

Configuration

The Teckin Smart Plug is just a Tuya device and uses a cloud API for actuations, not controlled locally on your network like all other HomeKit devices. This may have some security implications, but all comunications seems to be encrypted and secure, so I am happy to use this for now.

The homebridge plugin that I ended up using to control the socket is homebridge-tuya. I struggled to get the tuya-cli link-wizard to work to identify the id and key of the device. The connection initial process seems very flaky. I do not know if it is due to my mesh network or what, but i spent hours on this bit. In the end I resorted to identifying the id and key for my switch using Charles on macOS and this method from an older version of the Tuya node API.

Result

It works great in HomeKit!

Now, to find a good way to trigger it from motion outside. 🤔

5 thoughts on “Teckin Smart Plug / Socket with HomeKit using homebridge

  1. LordMa says

    Hey, thank u for the write up. I’m following, but when I’m running Charles, with the root CA certificate installed, still somehow, I am unable to view encrypted req:res content for the deviceID. Is there a step I’ve missed? Do u proxy into Charles when setting up the plug for the first time or after it’s already registered in the cloud?

    Reply
    1. Daniel Breslan says

      Hi, unfortunately, I cannot help. At this stage to view the messages you can find help from Charles experts maybe stack overflow etc? Just try and get it to see and phone traffic, facebook, twitter, etc. Once you have done thatm then you can try it with the plug.

      Reply
  2. Glyn Williams says

    Hi, Just bought four of these.

    Managed to get them to divulge their IDs and key values, without much problem.

    Homebridge seems to add them properly, and Homekit, sort-of shows their on/off state.
    But control is not working. Turning a light on/off just gets a grinding gear.

    Putting Homebridge into debug mode, shows it repeatedly sending a control string. Which is followed by “Accessory [Homebridge] Error setting Characteristic “On” to value 1: Timeout .”

    Just wondered if there is anything clever happening with your config.json. Are you specifying anything in addition to name,id and key?

    Thanks..

    Reply
    1. Daniel Breslan says

      Nope, it is just a platform like this:
      ,
      {
      “platform”: “TuyaPlatform”,
      “name”: “TuyaPlatform”,
      “devices”: [
      {
      “name”: “Tuya Device 1”,
      “id”: “xxxxxx”,
      “key”: “xxxxxx”
      }
      ]
      }

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *