Install
openclaw skills install broadlinkacControl air conditioners via Broadlink RM devices — multi-brand IR control, weather monitoring, typhoon alerts, scheduled automation. Clone, pip install, import — zero-config Agent API.
openclaw skills install broadlinkacCross-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.
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)
| 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. |
| 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) |
| 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 |
| Function | Description |
|---|---|
fetch_typhoons() | Active NW Pacific typhoons from China NMC |
fetch_typhoon_detail(typhoon_id) | Detailed track + forecast |
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.
import broadlinkac_core has zero side effects — no network I/O, no filesystem reads, no threads startedinit() is idempotent — safe to call multiple times~/.ac_controller/config.jsonfrom broadlinkac_core import init, send_ac
init()
send_ac("on", "cool", 26, "auto")
from broadlinkac_core import init, fetch_weather
init()
w = fetch_weather()
# Returns {"temp": "31", "text": "晴", "feelsLike": "33", "humidity": "65", ...}
from broadlinkac_core import init, fetch_weather_alerts
init()
alerts = fetch_weather_alerts()
for a in alerts:
print(f"[{a['severity']}] {a['headline']}")
# 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)