npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

homebridge-tuya-door-cloud

v1.1.0

Published

This plugin uses the Tuya Cloud API to fetch the state of door sensors

Downloads

5

Readme

Homebridge Tuya Door Sensor Plugin

This plugin allows you to use a Tuya compatible door sensor such as this one and shows it in the Home App through Homebridge. It uses the Tuya Cloud API to get the device state and update it in Homebridge.

You can support me buy sending some bucks my way on paypal: right here

How to install

You can install this plugin like you'd install any other plugin via: npm i homebridge-tuya-door-cloud -g

Disclaimer

What does this plugin NOT do ?

It's not a replacement for a proper security system (even though that's how I use it myself).
It doesn't allow you to open/close a door, even though that's how Homekit want's a door to operate.
It doesn't send your secret key over to Internet, it only uses it to sign the requests to the Tuya Cloud API. It doesn't watch your sensor in realtime.

What does this plugin do ?

It calls the Tuya Cloud API to update the door state and push it directly to Homebridge.
It checks for the current door state in the background once every 500ms. Per my personal testing, this was as fast as the Tuya App notifications and works fine. The requests are very small in size so it shouldn't use your internet too much. Still, I'd recommend to have a no data cap connection.

How to use it

You need create an account on iot.tuya.com. Then, create a new Cloud project, with the industry type set to "Smart Home". Go to "API" inside your project, add the "Authorization" and "Smart Home Devices Management" (don't worry, they are free).

Then you need to add your devices. For that, install the Tuya Smart app on your smartphone, make an account and then, go to "Link Devices" in your Cloud project.
Select the "Link devices by App Account" and add your newly created account.

Go to device list and note the device IDs of your door sensors, you'll need them to setup.

Finally, go to the homebridge config ux and follow the instructions there.

Manual configuration

If for some reason the Homebridge UI doesn't work (it's the case for me), here's a JSON Config example for you :

{
    "bridge": {
        "name": "Homebridge XXXX",
        "username": "XX:XX:XX:XX:XX:XX",
        "port": XXXX,
        "pin": "XXX-XX-XXX"
    },
    "accessories": [],
    "platforms": [
        {
            "name": "Config",
            "port": 8581,
            "platform": "config"
        },
        {
            "name": "TuyaDoorCloud",
            "options": {
                "access_id": "YOUR ACCESS ID",
                "secret_id": "YOUR SECRET KEY",
                "cloudCode": "YOUR REGION"
            },
            "defaults": [
                {
                    "display_name": "SENSOR 1",
                    "device_id": "DEVICE ID 1"
                },
                {
                    "display_name": "SENSOR 2",
                    "device_id": "DEVICE ID 2"
                }
            ],
            "platform": "TuyaDoorCloud"
        }
    ],
    "disabledPlugins": []
}

Build it yourself

To build this project, first run npm install Then npm run build And finally npm link To attach this plugin to homebridge