homebridge-tuya-ir-remote
v1.0.1
Published
Homebridge plugin for Tuya IR blasters - Control AC, TV, and Apple TV via IR commands through Tuya Cloud API
Downloads
41
Maintainers
Readme
Homebridge Tuya IR Remote
Control your IR devices (Air Conditioners, TVs, Apple TVs) through Tuya IR blasters using HomeKit.
Features
- Air Conditioner Control: Power, temperature (16-30°C), mode (cool/heat/auto), and fan speed
- TV Control: Power, navigation, volume, and iOS Control Center remote support
- Apple TV Control: Power, navigation, play/pause with iOS Control Center remote
- Multi-Room Support: Configure multiple IR blasters for different rooms
- Homebridge Config UI X: Full GUI configuration support
Requirements
- Homebridge v1.6.0 or later
- Node.js v18 or later
- Tuya IoT Platform account (iot.tuya.com)
- Tuya IR Blaster device(s)
Installation
Using Homebridge Config UI X (Recommended)
- Search for "Tuya IR Remote" in the Plugins tab
- Click Install
Manual Installation
npm install -g homebridge-tuya-ir-remoteSetup Guide
Step 1: Create Tuya IoT Platform Project
- Go to iot.tuya.com and sign in
- Navigate to Cloud → Development
- Click Create Cloud Project
- Select your data center region (must match your Tuya app region)
- After creation, note your Access ID and Access Secret
Step 2: Link Your Tuya App Account
- In your project, go to Devices → Link Tuya App Account
- Click Add App Account
- Scan the QR code with your Tuya/Smart Life app
- Your devices will now appear in the platform
Step 3: Get IR Blaster Device ID
- Go to Devices → All Devices
- Find your IR Blaster device
- Copy the Device ID
Step 4: Get Remote IDs
You need to get the remote IDs for each device paired with your IR blaster. Use the Tuya API Explorer:
- Go to Cloud → API Explorer
- Search for "Get remote list" or use endpoint:
GET /v2.0/infrareds/{ir_device_id}/remotes - For each remote, note:
remote_idcategory_id(2=TV, 3=Set-top Box, 5=AC)remote_index
Configuration
Using Homebridge Config UI X
- Go to the Plugins tab
- Find "Homebridge Tuya IR Remote"
- Click Settings
- Fill in your credentials and device configurations
Manual Configuration
Add this to your Homebridge config.json:
{
"platforms": [
{
"platform": "TuyaIRRemote",
"name": "Tuya IR Remote",
"region": "eu",
"accessId": "YOUR_ACCESS_ID",
"accessSecret": "YOUR_ACCESS_SECRET",
"irBlasters": {
"bedroom": {
"irId": "YOUR_IR_BLASTER_DEVICE_ID",
"remotes": {
"tv": {
"remoteId": "YOUR_TV_REMOTE_ID",
"categoryId": 2,
"remoteIndex": "692"
},
"appletv": {
"remoteId": "YOUR_APPLETV_REMOTE_ID",
"categoryId": 3,
"remoteIndex": "4990"
},
"ac": {
"remoteId": "YOUR_AC_REMOTE_ID",
"categoryId": 5,
"remoteIndex": "11272"
}
}
},
"living": {
"irId": "YOUR_LIVING_IR_BLASTER_ID",
"remotes": {
"tv": {
"remoteId": "YOUR_LIVING_TV_REMOTE_ID",
"categoryId": 2,
"remoteIndex": "692"
},
"ac": {
"remoteId": "YOUR_LIVING_AC_REMOTE_ID",
"categoryId": 5,
"remoteIndex": "11272"
}
}
}
},
"acDevices": [
{
"name": "Bedroom AC",
"room": "bedroom"
},
{
"name": "Living Room AC",
"room": "living"
}
],
"tvDevices": [
{
"name": "Bedroom TV",
"type": "tv",
"room": "bedroom"
},
{
"name": "Apple TV",
"type": "appletv",
"room": "bedroom"
},
{
"name": "Living Room TV",
"type": "tv",
"room": "living"
}
]
}
]
}Configuration Reference
| Parameter | Required | Description |
|-----------|----------|-------------|
| platform | Yes | Must be TuyaIRRemote |
| name | Yes | Display name for the platform |
| region | Yes | Tuya API region: eu, us, us-e, cn, in |
| accessId | Yes | Tuya Access ID (from iot.tuya.com) |
| accessSecret | Yes | Tuya Access Secret (from iot.tuya.com) |
| irBlasters | Yes | IR blaster configurations organized by room name |
| acDevices | No | Air conditioner devices to expose in HomeKit |
| tvDevices | No | TV/Apple TV devices to expose in HomeKit |
API Regions
| Region | Code | Data Center |
|--------|------|-------------|
| Europe | eu | Central Europe |
| US West | us | Western America |
| US East | us-e | Eastern America |
| China | cn | China |
| India | in | India |
HomeKit Features
Air Conditioner
The AC appears as a HeaterCooler with a linked Fan accessory:
- Power: On/Off control
- Mode: Cool, Heat, Auto
- Temperature: 16-30°C (adjustable)
- Fan Speed: Auto (0%), Low (25%), Medium (50%), High (75-100%)
TV / Apple TV
TVs appear as Television accessories with full iOS Control Center remote support:
- Power: On/Off toggle
- Navigation: Up, Down, Left, Right, OK/Select
- Menu: Back/Menu button
- Play/Pause: Media control
- Volume: Up/Down (TV only)
- Mute: Toggle mute (TV only)
Note: TV accessories are published as "External Accessories". You may need to add them manually in the Home app via Add Accessory → More Options.
Troubleshooting
Device not responding
- Verify your Access ID and Access Secret are correct
- Check that the region matches your Tuya account
- Ensure your IR blaster is online (check in Tuya app)
- Check Homebridge logs for error messages
TV not showing in Home app
- Open the Home app
- Tap + → Add Accessory
- Select More options...
- Your TV should appear in the list
Remote commands not working
- Verify the
remoteId,categoryId, andremoteIndexare correct - Test the remote in the Tuya/Smart Life app first
- Ensure the IR blaster has clear line-of-sight to the device
Getting Remote IDs
Use the Tuya API Explorer at iot.tuya.com:
GET /v2.0/infrareds/{your_ir_blaster_device_id}/remotesThis returns all remotes paired with your IR blaster, including their IDs.
Development
# Clone the repository
git clone https://github.com/egphp/homebridge-tuya-ir-remote.git
cd homebridge-tuya-ir-remote
# Install dependencies
npm install
# Build
npm run build
# Link for local testing
npm link
# Watch mode for development
npm run watchContributing
Contributions are welcome! Please:
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
Apache License 2.0 - see LICENSE for details.
Support
- Issues: GitHub Issues
- Discussions: GitHub Discussions
