openhue

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

OpenHue CLI

OpenHue CLI

Control Philips Hue lights and scenes via a Hue Bridge from the terminal.
通过Hue Bridge从终端控制Philips Hue灯光和场景。

Prerequisites

前提条件

bash
undefined
bash
undefined

Linux (pre-built binary)

Linux(预编译二进制文件)

curl -sL https://github.com/openhue/openhue-cli/releases/latest/download/openhue-linux-amd64 -o ~/.local/bin/openhue && chmod +x ~/.local/bin/openhue
curl -sL https://github.com/openhue/openhue-cli/releases/latest/download/openhue-linux-amd64 -o ~/.local/bin/openhue && chmod +x ~/.local/bin/openhue

macOS

macOS

brew install openhue/cli/openhue-cli

First run requires pressing the button on your Hue Bridge to pair. The bridge must be on the same local network.
brew install openhue/cli/openhue-cli

首次运行时需要按下Hue Bridge上的按钮进行配对。网桥必须与设备处于同一局域网。

When to Use

适用场景

  • "Turn on/off the lights"
  • "Dim the living room lights"
  • "Set a scene" or "movie mode"
  • Controlling specific Hue rooms, zones, or individual bulbs
  • Adjusting brightness, color, or color temperature
  • "打开/关闭灯光"
  • "调暗客厅灯光"
  • "设置场景"或"观影模式"
  • 控制特定的Hue房间、区域或单个灯泡
  • 调整亮度、颜色或色温

Common Commands

常用命令

List Resources

列出资源

bash
openhue get light       # List all lights
openhue get room        # List all rooms
openhue get scene       # List all scenes
bash
openhue get light       # 列出所有灯光
openhue get room        # 列出所有房间
openhue get scene       # 列出所有场景

Control Lights

控制灯光

bash
undefined
bash
undefined

Turn on/off

打开/关闭

openhue set light "Bedroom Lamp" --on openhue set light "Bedroom Lamp" --off
openhue set light "Bedroom Lamp" --on openhue set light "Bedroom Lamp" --off

Brightness (0-100)

亮度(0-100)

openhue set light "Bedroom Lamp" --on --brightness 50
openhue set light "Bedroom Lamp" --on --brightness 50

Color temperature (warm to cool: 153-500 mirek)

色温(暖光到冷光:153-500 mirek)

openhue set light "Bedroom Lamp" --on --temperature 300
openhue set light "Bedroom Lamp" --on --temperature 300

Color (by name or hex)

颜色(按名称或十六进制码)

openhue set light "Bedroom Lamp" --on --color red openhue set light "Bedroom Lamp" --on --rgb "#FF5500"
undefined
openhue set light "Bedroom Lamp" --on --color red openhue set light "Bedroom Lamp" --on --rgb "#FF5500"
undefined

Control Rooms

控制房间

bash
undefined
bash
undefined

Turn off entire room

关闭整个房间的灯光

openhue set room "Bedroom" --off
openhue set room "Bedroom" --off

Set room brightness

设置房间灯光亮度

openhue set room "Bedroom" --on --brightness 30
undefined
openhue set room "Bedroom" --on --brightness 30
undefined

Scenes

场景

bash
openhue set scene "Relax" --room "Bedroom"
openhue set scene "Concentrate" --room "Office"
bash
openhue set scene "Relax" --room "Bedroom"
openhue set scene "Concentrate" --room "Office"

Quick Presets

快速预设

bash
undefined
bash
undefined

Bedtime (dim warm)

就寝模式(昏暗暖光)

openhue set room "Bedroom" --on --brightness 20 --temperature 450
openhue set room "Bedroom" --on --brightness 20 --temperature 450

Work mode (bright cool)

工作模式(明亮冷光)

openhue set room "Office" --on --brightness 100 --temperature 250
openhue set room "Office" --on --brightness 100 --temperature 250

Movie mode (dim)

观影模式(昏暗)

openhue set room "Living Room" --on --brightness 10
openhue set room "Living Room" --on --brightness 10

Everything off

关闭所有灯光

openhue set room "Bedroom" --off openhue set room "Office" --off openhue set room "Living Room" --off
undefined
openhue set room "Bedroom" --off openhue set room "Office" --off openhue set room "Living Room" --off
undefined

Notes

注意事项

  • Bridge must be on the same local network as the machine running Hermes
  • First run requires physically pressing the button on the Hue Bridge to authorize
  • Colors only work on color-capable bulbs (not white-only models)
  • Light and room names are case-sensitive — use
    openhue get light
    to check exact names
  • Works great with cron jobs for scheduled lighting (e.g. dim at bedtime, bright at wake)
  • 网桥必须与运行Hermes的设备处于同一局域网
  • 首次运行时需要物理按下Hue Bridge上的按钮进行授权
  • 颜色设置仅适用于支持色彩的灯泡(不适用于仅白光型号)
  • 灯光和房间名称区分大小写——使用
    openhue get light
    查看准确名称
  • 与cron任务配合使用可实现定时灯光控制(例如就寝时调暗,起床时调亮)