名称: dyson-cli
描述: 通过本地 MQTT 控制戴森空气净化器、风扇和加热器。当需要控制戴森设备、调节风速、设定温度/加热、启用摆头或查看室内温湿度时使用。要求设备与戴森在同一 WiFi 网络下。
~/dyson-cli 目录,并使用虚拟环境快速检查:
cd ~/dyson-cli && source .venv/bin/activate && dyson list --check
dyson on # 开启设备
dyson off # 关闭设备
dyson fan speed 5 # 风速设为 1-10 级
dyson fan speed auto # 自动模式
dyson fan oscillate on # 启用摆头
dyson fan oscillate on -a 90 # 设置 90° 摆头角度(可选 45/90/180/350)
dyson fan oscillate off # 关闭摆头
dyson heat on # 开启加热
dyson heat off # 关闭加热
dyson heat target 22 # 设置目标温度(单位:°C)
dyson night on # 开启夜间模式
dyson night off # 关闭夜间模式
dyson status # 显示当前状态
dyson status --json # 以 JSON 格式输出状态
使用 -d <设备名称> 指定目标设备:
dyson on -d "卧室"
dyson fan speed auto -d "办公室"
# “打开戴森并设为自动模式”
dyson on && dyson fan speed auto
# “加热到 23 度”
dyson heat on && dyson heat target 23
# “开启设备,设为 3 级风速并启用 45° 轻柔摆头”
dyson on && dyson fan speed 3 && dyson fan oscillate on -a 45
# “当前温度是多少?”
dyson status --json | python3 -c "import sys,json; d=json.load(sys.stdin); print(f\"温度: {d['temperature']-273:.1f}°C, 湿度: {d['humidity']}%\")"
若命令执行失败:
1. 检查设备是否在线:dyson list --check
2. 确保与戴森设备在同一 WiFi 网络下
3. 若凭据过期,重新运行设置:dyson setup
有关安装、设备配置及完整文档,请参阅 README.md。