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 🙏

© 2026 – Pkg Stats / Ryan Hefner

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

Readme

Homebridge Tuya IR Remote

npm npm GitHub

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)

  1. Search for "Tuya IR Remote" in the Plugins tab
  2. Click Install

Manual Installation

npm install -g homebridge-tuya-ir-remote

Setup Guide

Step 1: Create Tuya IoT Platform Project

  1. Go to iot.tuya.com and sign in
  2. Navigate to CloudDevelopment
  3. Click Create Cloud Project
  4. Select your data center region (must match your Tuya app region)
  5. After creation, note your Access ID and Access Secret

Step 2: Link Your Tuya App Account

  1. In your project, go to DevicesLink Tuya App Account
  2. Click Add App Account
  3. Scan the QR code with your Tuya/Smart Life app
  4. Your devices will now appear in the platform

Step 3: Get IR Blaster Device ID

  1. Go to DevicesAll Devices
  2. Find your IR Blaster device
  3. 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:

  1. Go to CloudAPI Explorer
  2. Search for "Get remote list" or use endpoint:
    GET /v2.0/infrareds/{ir_device_id}/remotes
  3. For each remote, note:
    • remote_id
    • category_id (2=TV, 3=Set-top Box, 5=AC)
    • remote_index

Configuration

Using Homebridge Config UI X

  1. Go to the Plugins tab
  2. Find "Homebridge Tuya IR Remote"
  3. Click Settings
  4. 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 AccessoryMore Options.

Troubleshooting

Device not responding

  1. Verify your Access ID and Access Secret are correct
  2. Check that the region matches your Tuya account
  3. Ensure your IR blaster is online (check in Tuya app)
  4. Check Homebridge logs for error messages

TV not showing in Home app

  1. Open the Home app
  2. Tap +Add Accessory
  3. Select More options...
  4. Your TV should appear in the list

Remote commands not working

  1. Verify the remoteId, categoryId, and remoteIndex are correct
  2. Test the remote in the Tuya/Smart Life app first
  3. 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}/remotes

This 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 watch

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

Apache License 2.0 - see LICENSE for details.

Support