/install broadlinkac
BroadlinkAC — AI Agent Smart AC Controller
Cross-platform AC control library for Broadlink RM series IR blasters. Zero GUI dependency — designed for AI agents to clone, install, and control air conditioners programmatically.
Quick Start (Agent)
git clone https://github.com/oywq00008-cell/BroadlinkAC-For-AI-Agent.git
cd BroadlinkAC-For-AI-Agent
pip install -r requirements-core.txt
from broadlinkac_core import init, send_ac, fetch_weather, fetch_weather_alerts
# One-time setup — all config persisted to ~/.ac_controller/config.json
init(
api_key="your_qweather_key",
qw_host="https://xxx.re.qweatherapi.com",
location={"lat": 22.54, "lon": 114.05, "name": "Shenzhen"},
brand="Gree"
)
# Control AC
send_ac("on", "cool", 26, "auto") # Turn on, cool 26°C, auto fan
send_ac("off", "cool", 26, "auto") # Turn off
# Get weather
weather = fetch_weather() # Real-time temp, humidity, feels-like
alerts = fetch_weather_alerts() # Local disaster warnings (heat/rain/typhoon)
API Reference
Setup
| Function | Description |
|---|---|
init(api_key=None, qw_host=None, location=None, brand=None) |
Initialize config + start background scheduler. All params optional — subsequent calls read from persistent config. |
AC Control
| Function | Description |
|---|---|
send_ac(power, mode, temp, fan) |
Send IR command. power: "on"/"off". mode: "cool"/"heat"/"dry"/"fan"/"auto". temp: 16-30. fan: "auto"/"1"/"2"/"3" |
decide_ac(outdoor_temp) |
Run temperature rules → returns (target_temp, mode) |
Weather & Alerts
| Function | Description |
|---|---|
fetch_weather() |
Current weather (temp, humidity, feels-like, wind) via QWeather API |
fetch_weather_alerts() |
Local weather warnings — returns list of {headline, severity, description, senderName, effectiveTime, expireTime} |
city_lookup(query) |
OpenStreetMap city search → coordinates |
Typhoon
| Function | Description |
|---|---|
fetch_typhoons() |
Active NW Pacific typhoons from China NMC |
fetch_typhoon_detail(typhoon_id) |
Detailed track + forecast |
Supported AC Brands
hvac_ir (5 brands): Gree, Midea, Hisense, Daikin, Mitsubishi
Custom protocols (3 brands): Haier, AUX, Panasonic (ported from IRremoteESP8266 C++)
Select in Settings or pass brand= to init(). Device auto-discovered on LAN via Broadlink UDP.
Key Design
import broadlinkac_corehas zero side effects — no network I/O, no filesystem reads, no threads startedinit()is idempotent — safe to call multiple times- Config auto-persisted to
~/.ac_controller/config.json - Runs on any device with Python 3.9+ (macOS/Windows/Linux/Raspberry Pi/NAS)
Common Agent Tasks
"Turn on the AC to 26°C cooling"
from broadlinkac_core import init, send_ac
init()
send_ac("on", "cool", 26, "auto")
"What's the temperature outside?"
from broadlinkac_core import init, fetch_weather
init()
w = fetch_weather()
# Returns {"temp": "31", "text": "晴", "feelsLike": "33", "humidity": "65", ...}
"Are there any weather warnings?"
from broadlinkac_core import init, fetch_weather_alerts
init()
alerts = fetch_weather_alerts()
for a in alerts:
print(f"[{a['severity']}] {a['headline']}")
"Turn off the AC at 10pm"
# Set off_time in config, then the built-in scheduler handles it
import broadlinkac_core.config as _cfg
from broadlinkac_core import init
init()
_cfg.config["off_time"] = "22:00"
_cfg.config["off_enabled"] = True
_cfg.save_config(_cfg.config)
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install broadlinkac - 安装完成后,直接呼叫该 Skill 的名称或使用
/broadlinkac触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Broadlinkac 是什么?
Control air conditioners via Broadlink RM devices — multi-brand IR control, weather monitoring, typhoon alerts, scheduled automation. Clone, pip install, imp... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 50 次。
如何安装 Broadlinkac?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install broadlinkac」即可一键安装,无需额外配置。
Broadlinkac 是免费的吗?
是的,Broadlinkac 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Broadlinkac 支持哪些平台?
Broadlinkac 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Broadlinkac?
由 KevinChan(@oywq00008-cell)开发并维护,当前版本 v3.0.0。