返回顶部
r

roon-controller

Control Roon music player through Roon API with automatic Core discovery and zone filtering. Supports play/pause, next/previous track, and current track query. Automatically finds Muspi zones. Supports Chinese commands.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.3
安全检测
已通过
2,179
下载量
3
收藏
概述
安装方式
版本历史

roon-controller

# Roon Control Skill Control the Roon music player with Chinese command support. ## Quick Start ### Install Dependencies ```bash pip install roonapi ``` ### Usage Examples ```python from roon_controller import RoonController # Create controller (token will be saved automatically) controller = RoonController(verbose=True) # Play/Pause result = controller.play_pause() # Next track result = controller.next() # Get current track track_info = controller.get_current_track() print(f"Now playing: {track_info['track']}") ``` ## Core Features ### 1. Automatic Discovery and Connection - Automatic Roon Core discovery - Token automatically saved to `~/clawd/roon_config.json` - Auto-reconnect after restart, no re-authorization needed ### 2. Zone Selection and Switching - Supports switching between any available zone - Selected zone is saved in config and persists across restarts - If no zone is selected, defaults to zones ending with "[roon]" - Use `set_zone()` to switch zones programmatically **Switch Zone** ```python result = controller.set_zone("Living Room") # {"success": True, "message": "Switched to zone: Living Room", "zone": "Living Room"} ``` **Get Current Zone** ```python zone = controller.get_current_zone() # Returns zone info dict with zone_id and zone_data ``` ### 3. Playback Control **Play** ```python result = controller.play() # {"success": True, "message": "Playback started", "zone": "Living Room Muspi"} ``` **Pause** ```python result = controller.pause() # {"success": True, "message": "Paused", "zone": "Living Room Muspi"} ``` **Play/Pause Toggle** ```python result = controller.play_pause() ``` **Previous Track** ```python result = controller.previous() ``` **Next Track** ```python result = controller.next() ``` ### 4. Get Current Track ```python track_info = controller.get_current_track() # Returns: # { # "success": True, # "is_playing": True, # "zone": "Living Room Muspi", # "track": "Bohemian Rhapsody", # "artist": "Queen", # "album": "A Night at the Opera", # "seek_position": 12345, # milliseconds # "length": 354000 # milliseconds # } ``` ### 5. List All Zones ```python zones = controller.list_zones() # ["Living Room Muspi", "Kitchen", "Bedroom"] ``` ## Command Line Tool The script can be used as a command line tool: ```bash # Play python roon_controller.py play # Pause python roon_controller.py pause # Previous track python roon_controller.py prev # Next track python roon_controller.py next # View current track python roon_controller.py status # List all zones python roon_controller.py zones -v # switch zone python roon_controller.py switch zonename ``` ## Chinese Command Support The skill supports the following Chinese trigger words: | Command | Meaning | Example | |---------|---------|---------| | 音乐播放 / 播放音乐 | Start playback | "音乐播放" | | 暂停 / 暂停播放 | Pause playback | "暂停一下" | | 下一曲 / 切歌 | Next track | "下一曲" | | 上一曲 | Previous track | "上一曲" | | 当前曲目 / 正在放什么 | View current track | "当前曲目" | ## Error Handling All methods return a unified dictionary structure: ```python { "success": True/False, "message": "Operation result description", "zone": "Zone name (optional)" } ``` ### Common Errors - **Muspi zone not found**: Check if the Roon zone name ends with "muspi" - **Failed to connect to Roon**: Ensure Roon Core is running and network-accessible - **Token load failed**: First run requires authorization, ensure authorization completes successfully ## Notes 1. **First Run**: Extension authorization required in Roon, check for the extension authorization prompt in Roon interface 2. **Zone Naming**: Muspi zone names must end with "muspi" (case-insensitive) 3. **Token Storage**: Token is saved in `~/clawd/roon_config.json`, ensure secure file permissions 4. **Network Requirements**: The device running the script must be on the same network as Roon Core ## Technical Details ### Dependencies - `roonapi>=0.1.6`: Official Roon API Python library ### Token Management - Token storage path: `~/clawd/roon_config.json` - Auto-load: Automatically loaded on each startup - Auto-save: Automatically saved on first authorization or update ### Zone Finding Algorithm ```python # Find all zones zones = roon.zones # Filter zones with muspi suffix muspi_zones = [ (zone_id, zone_data) for zone_id, zone_data in zones.items() if zone_data['display_name'].lower().endswith('muspi') ] # Use the first matching zone zone_id, zone_data = muspi_zones[0] ```

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 roon-controller-1776379141 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 roon-controller-1776379141 技能

通过命令行安装

skillhub install roon-controller-1776379141

下载 Zip 包

⬇ 下载 roon-controller v1.0.3

文件大小: 7.44 KB | 发布时间: 2026-4-17 16:18

v1.0.3 最新 2026-4-17 16:18
- Initial release of roon-controller skill, enabling control of the Roon music player via Roon API.
- Supports automatic discovery of Roon Core with persistent token management (no reauthorization required after first use).
- Zone management includes auto-selection of Muspi zones, zone listing, and persistent zone switching.
- Playback controls: play, pause, play/pause toggle, next/previous track, and current track details.
- Command line interface for basic operations and zone management.
- Supports Chinese voice commands for playback control.
- Standardized error handling and clear troubleshooting guidance.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部