OpenHue CLI
使用 openhue 通过 Hue Bridge 控制 Philips Hue 灯和场景。
使用时机
在以下情况使用:
- “开/关灯”
- “调暗客厅灯光”
- “设置场景”或“电影模式”
- 控制特定的 Hue 房间或区域
- 调节亮度、颜色或色温
不应使用的情况
在以下情况不使用:
- 非 Hue 智能设备(其他品牌)→ 不支持
- HomeKit 场景或快捷指令 → 使用 Apple 家庭应用或快捷指令
- 电视或娱乐系统控制
- 恒温器或 HVAC
- 智能插座(除非是 Hue 智能插座)
常用命令
列出资源
openhue get light # 列出所有灯
openhue get room # 列出所有房间
openhue get scene # 列出所有场景
控制灯
# 开/关
openhue set light "Bedroom Lamp" --on
openhue set light "Bedroom Lamp" --off
# 亮度(0-100)
openhue set light "Bedroom Lamp" --on --brightness 50
# 色温(暖到冷:153-500 米雷克)
openhue set light "Bedroom Lamp" --on --temperature 300
# 颜色(按名称或十六进制)
openhue set light "Bedroom Lamp" --on --color red
openhue set light "Bedroom Lamp" --on --rgb "#FF5500"
控制房间
# 关闭整个房间
openhue set room "Bedroom" --off
# 设置房间亮度
openhue set room "Bedroom" --on --brightness 30
场景
# 激活场景
openhue set scene "Relax" --room "Bedroom"
openhue set scene "Concentrate" --room "Office"
快速预设
# 就寝模式(暖色低亮度)
openhue set room "Bedroom" --on --brightness 20 --temperature 450
# 工作模式(冷色高亮)
openhue set room "Office" --on --brightness 100 --temperature 250
# 电影模式(低亮度)
openhue set room "Living Room" --on --brightness 10
注意事项
- Bridge 必须在本地网络中
- 首次运行需要按下 Hue Bridge 上的配对按钮
- 颜色功能仅用于支持彩色灯泡(非白色灯泡)