Skip to content

Seifon/smartir_learn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

44 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

HomeAssistant SmartIR Configuration Generator

中文 | English

A plugin to simplify SmartIR configuration file generation, automating IR code learning through Broadlink devices.

image image

Features

  • 🎯 Device Support: Climate, TV, Fan and other device types
  • 📁 Template System: Pre-built templates & custom template support
  • 🌡️ Climate Control: Customizable temperature range (16-32℃)
  • 📶 IR Learning: Direct IR code acquisition via Broadlink devices
  • 🧪 Command Validation: Post-learning command verification
  • 🚀 Auto-generation: SmartIR-compatible JSON configuration output

Installation

Method 1: Via HACS (Recommended)

  1. Install HACS
    Follow official guide if not installed

  2. Add Custom Repository

    • Open HACS ➡️ Integrations
    • Click ➡️ Custom repositories
    • Add repository URL: https://github.com/Seifon/smartir_learn
    • Category: Integration
  3. Install Plugin

    • Search "SmartIR Learn" in HACS Integrations
    • Click Download
    • Restart HomeAssistant after installation

Method 2: Manual Installation

  1. Copy smartir_learn folder to custom_components directory
  2. Restart HomeAssistant

Initial Setup

  1. Navigate to Configuration ➡️ Devices & Services ➡️ Integrations
  2. Click + Add Integration
  3. Search and select "SmartIR Learn"

Setup Process

Configuration Guide

Step 1: Device Connection

Device Scanning
  • Connection methods:
    • Auto Scan: Discover Broadlink devices in local network
    • Manual Input: Direct IP entry

Step 2: Device Configuration

Device Selection
Sample Configuration:
device_type: climate
manufacturer: Midea
supported_models: MS-05A1
temperature_range: 16-30℃

Step 3: IR Learning

Command Learning
  1. Select commands from template
  2. Follow on-screen instructions to send IR signals
  3. Automatically save learned codes

Step 4: Generate Configuration

Example output path:

/config/custom_components/smartir/codes/climate/202503091445.json

Usage

  1. Place generated JSON in SmartIR codes directory:
    cp 202503091445.json /config/custom_components/smartir/codes/climate/
  2. Configure SmartIR entity:
    climate:
      - platform: smartir
        name: Living Room AC
        unique_id: living_ac
        device_code: 202503091445
        controller_data: broadlink_remote_entity_id

Important Notes

⚠️ Prerequisites:

  • Broadlink device must be in same network as HA
  • Disable 'Device Lock' in Broadlink APP
  • SmartIR plugin must be pre-installed

🔧 Troubleshooting:

Common solutions:
1. Connection timeoutVerify device IP and network
2. Learning failureEnsure remote is <5cm from device
3. File save errorCheck directory permissions

🔄 Template Development: Sample template structure:

{
  "manufacturer": "Manufacturer Name",
  "supportedModels": ["Model A", "Model B"],
  "commands": {
    "power": "JgASKE5MTk..."
  }
}

Support

When reporting issues, please include:

  1. HomeAssistant version
  2. Broadlink device model
  3. Error logs snippet
  4. Relevant config files (sanitized)

✅ Tested Version: HomeAssistant 2025.2.0
📜 License: MIT License

About

SmartIR学码

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages