homebridge-tuya-gate
v1.4.8
Published
Open a Tuya video intercom / gate lock from HomeKit, notify on visitor ring, plus optional At Home / Not at Home / Dormant modes.
Maintainers
Readme
Tuya Gate for Homebridge
Homebridge plugin for a Tuya Gate Camera / video intercom in Apple Home.
- Open the gate — same action as the Tuya app Lock Switch (
accessory_lockvia v2 shadow properties) - Ring notifications — a motion sensor trips when someone rings so Home can notify you
- Ring modes — optional At Home / Not at Home / Dormant (only if a cloud DP exists)
What you get in Home
- Lock (always) — Unlock opens the gate, then returns to Locked
- Ring motion sensor (default on) — trips on visitor ring
- At Home / Not at Home / Dormant — optional (
showModes) - Switch (optional) — momentary open pulse (
showSwitch)
Notify when someone rings
Required once in Tuya IoT (cloud project):
- Open the project → Cloud → Message Service
- Turn Message Service On (Production)
- Optional for debugging: add the gate as a Test Device and set plugin
messageEnvtotest
Without Message Service, rings are push-only events and cloud polling almost always misses them — the motion sensor will stay quiet.
Then in Home:
- Automation → Create New Automation
- A Sensor Detects Something → Open Gate Ring
- Detects Motion → Send Notification
Requirements
- Tuya IoT Cloud project with IoT Core trial active
- Gate Camera linked under Devices
- Access ID, Access Secret, device ID
Install / update
Use the Homebridge Plugins page (search homebridge-tuya-gate → Install / Update). Publish updates to npm; do not install from GitHub on the Pi.
Configuration
{
"platforms": [
{
"platform": "TuyaGate",
"name": "Open Gate",
"accessId": "YOUR_ACCESS_ID",
"accessSecret": "YOUR_ACCESS_SECRET",
"deviceId": "bf3f24408fb356db59qioh",
"region": "eu",
"lockCode": "accessory_lock",
"showRingSensor": true,
"ringCode": "doorbell_active",
"showSwitch": false,
"showModes": false,
"warmupStream": true
}
]
}| Option | Meaning |
|--------|---------|
| showRingSensor | Default true. Motion sensor for visitor rings |
| ringPush | Default true. Subscribe to Tuya Message Service (needed for reliable rings) |
| messageEnv | prod (default) or test |
| ringCode | Default doorbell_active |
| ringPollSeconds | Default 2 (backup poll; push is primary) |
| ringHoldSeconds | Default 20. How long motion stays active after a ring |
| showModes | Default false. Enable only after you find a cloud DP for mode |
| modeCode | Required when showModes is on |
| showSwitch | Extra momentary open switch |
| warmupStream | Allocate RTSP before open (helps some cameras) |
If modes don’t change on the device
Many kits keep At Home / Not at Home / Dormant only on the indoor monitor. If Query properties does not change when you switch mode, leave showModes off.
If ring never trips
- Confirm Message Service is Enabled and logs show
Ring push: Message Service connected - When you ring, logs should show
visitor ringing (…/push) - If push errors about the consumer, close the Tuya Console “Test Channel” page (only one consumer per Access ID)
- Fallback: Query properties while ringing — if
doorbell_picgets a value, ring detection should still fire once push is on
License
Apache-2.0
