Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

cyrus-remote

Python tools for controlling the Cyrus ONE integrated amplifier over Bluetooth Low Energy, replacing the official Android/iOS app.


This is not Cyrus.

Quick start

On the machine with the bar:

git clone https://github.com/slatkin/cyrus-remote
cd cyrus-remote
./install.sh

On the machine next to the amplifier:

git clone https://github.com/slatkin/cyrus-remote
cd cyrus-remote
sudo ./install.sh --server

The client installer checks the prerequisites, installs the helper binaries, registers the plugin with Noctalia, enables it, and prints the bar widget configuration to add. The server installer installs cyrus-daemon and its systemd unit, and starts the service.

Architecture

BLE only allows one connection at a time. The recommended setup is a server/client model: a small headless machine (Pi, NUC, Proxmox host, etc.) near the amp holds the single BLE connection, and every desktop/laptop connects to it as a client.

[ Cyrus ONE amp ]
       │ BLE
[ server running cyrus-daemon --no-ipc ]
       │ TCP :9876
  ┌────┴────┐
  │         │
[ desktop ] [ laptop ]
cyrus-proxy  cyrus-proxy
  │               │
Noctalia       Noctalia
bar widget     bar widget

Each client machine runs cyrus-proxy, which:

  • Receives live state pushes from the daemon (volume, mute, input) and feeds them to the local Noctalia bar widget via IPC
  • Forwards commands from the local bar widget (vol+/-, mute, input switch) back to the daemon over TCP

Components

File Purpose
cyrus_daemon.py BLE daemon — connects to amp, serves Unix socket + TCP
cyrus_proxy.py Client proxy — relays state and commands between daemon and local Noctalia
cyrus_cmd.py One-shot command sender (used by the bar widget)
cyrus.py Interactive REPL (optional, for direct local use)
cyrus/ Noctalia v5 plugin: manifest, bar widgets, translations
catalog.toml Plugin catalog so Noctalia can list the plugin from this repository
install.sh One-shot installer for a new machine

Install

Client (the machine with the bar)

git clone https://github.com/slatkin/cyrus-remote
cd cyrus-remote
./install.sh

The installer checks for Python and bleak, copies cyrus-daemon, cyrus-proxy, cyrus-cmd and the REPL into ~/.local/bin, registers this repository as a Noctalia plugin source, enables the plugin, and prints the bar widget configuration to add.

--add-widgets appends the two widget entries to ~/.local/state/noctalia/settings.toml for you.

Server (the machine next to the amplifier)

git clone https://github.com/slatkin/cyrus-remote
cd cyrus-remote
sudo ./install.sh --server

This installs cyrus-daemon to /usr/local/bin, installs the systemd unit, and starts the service. The daemon listens on TCP 9876.

Ways to ship the plugin

Noctalia takes plugins from a source. Which source you use decides who owns the files and how updates arrive:

Source Command Serves the plugin from Update path
Path (default) ./install.sh this working copy git pull — the widget scripts hot-reload on every change
Git ./install.sh --source git+https://github.com/slatkin/cyrus-remote the shell's own clone of the repository noctalia msg plugins update cyrus, or the shell's own six-hourly source update
Hand-placed make install ~/.local/share/noctalia/plugins/cyrus re-run make install

make source registers the checkout as the plugin source, which is the path source without the rest of the installer. The hand-placed copy is the built-in local source and overrides every configured source, so remove it when you switch to one of the others.

The repository is private, so a git source needs credentials: an SSH key for an git@ URL, or a credential helper for an HTTPS one. The path source needs no credentials at all, which is why it is the default.

The plugin id has to be enabled after its source is added. Adding a source on its own leaves the enabled list empty, nothing is cloned, and the plugin does not show up:

noctalia msg plugins source add cyrus git https://github.com/slatkin/cyrus-remote
noctalia msg plugins enable slatkin/cyrus

Requirements

  • Python 3.10+ and bleak (pip install bleak), on both machines
  • BlueZ on the server, next to the amplifier
  • Noctalia v5.3.0 or newer on the client — the wheel gesture needs the onScroll callback that v5.3.0 introduced

Uninstall

make uninstall

Removes the helper binaries, the hand-placed plugin copy, and the plugin source.

Plugin layout

Noctalia v5 plugins are distributed from source repositories: one repository holds many plugins, each in its own subdirectory named after the part of the plugin id after the /. This repository is one plugin source:

cyrus-remote/
  catalog.toml        # [[plugin]] row for slatkin/cyrus
  cyrus/              # the plugin: plugin.toml, cyrus_volume.luau, cyrus_input.luau, translations/
  cyrus_daemon.py     # the helpers, installed separately

catalog.toml lets Noctalia list and compat-check the plugin without cloning the repository; the plugin.toml inside cyrus/ stays authoritative. The helpers are not part of the plugin, so they are installed into ~/.local/bin rather than exported with it.

Server setup

Verify

sudo systemctl status cyrus-daemon
sudo journalctl -u cyrus-daemon -f

You should see Scanning for … then Connected to ONE-xxx once the amp is on.

Client setup (desktop / laptop)

Configure

Set CYRUS_PROXY_HOST to the server's IP or hostname. In fish:

set -Ux CYRUS_PROXY_HOST 192.168.1.x

In bash/zsh (add to your profile):

export CYRUS_PROXY_HOST=192.168.1.x

The plugin detects CYRUS_PROXY_HOST and auto-starts cyrus-proxy instead of a local daemon.

The bar widgets are added in Noctalia: Settings → Bar → add widget → Cyrus Remote, or by putting the entries in ~/.local/state/noctalia/settings.toml:

[widget.cyrus-volume]
type = "slatkin/cyrus:volume"

[widget.cyrus-input]
type = "slatkin/cyrus:input"

Firewall

Open port 9876/TCP on the server if needed:

# ufw
ufw allow 9876/tcp

Single-machine setup

If the amp is always near your desktop and you don't need the server model, skip cyrus-proxy and run the daemon locally without --no-ipc:

cyrus-daemon &

Leave CYRUS_PROXY_HOST unset. The plugin auto-starts the daemon and pushes state via local Noctalia IPC.

Bar widgets

The Noctalia bar widgets show volume % and the input source. Updates arrive as live BLE notifications — no polling.

Volume widget:

  • Left click — volume down
  • Right click — volume up
  • Middle click — toggle mute
  • Scroll wheel — volume up/down, one detent = 3 amplifier steps (change it in the widget settings)

Input widget:

  • Left click — previous input
  • Right click — next input
  • Scroll wheel — sweep through the inputs

Wheel handling needs Noctalia 5.3.0 or newer (the onScroll callback). On older shells every other gesture still works, the wheel is simply inert.

REPL (optional)

For direct interactive control without the widget:

cyrus-remote          # or: cr
Connected to ONE-888. Type 'help' for commands, 'quit' to exit.

> help
  commands: mute  unmute  volume <0-90>  input <bt|usb|optical|spdif|phono|aux5|aux6>  status  quit
>
 vol: 80%  |  input: optical  |  mute: off

The status bar updates live from BLE notifications. Command history persists in $XDG_STATE_HOME/cyrus-remote/history.

Commands

Command Aliases Description
mute m Mute
unmute um Unmute
volume <0-90> vol, v Set volume step
input <name> i Switch input source
status s Refresh all state from device
quit q, exit Disconnect and exit

Graceful shutdown

The daemon handles SIGTERM cleanly — it disconnects BLE before exiting, so you don't need to restart Bluetooth:

pkill cyrus-daemon

Do not use kill -9 (SIGKILL cannot be caught and will leave the BLE connection open).

Finding your device address

python3 - <<'EOF'
import asyncio
from bleak import BleakScanner

SERVICE_UUID = "bc2f4cc6-aaef-4351-9034-d66268e328f0"

async def main():
    devices = await BleakScanner.discover(timeout=15.0, return_adv=True)
    for d, adv in devices.values():
        if SERVICE_UUID.lower() in [str(u).lower() for u in adv.service_uuids]:
            print(f"{d.address}  {d.name}")

asyncio.run(main())
EOF

The amp advertises as ONE-888 or similar. Pass a custom address with -a AA:BB:CC:DD:EE:FF.

How it works

The Cyrus ONE uses a MelodySmart BLE-to-UART bridge (Blue Creation / Dialog Semiconductor). All communication goes through a single GATT characteristic:

Role UUID
Service bc2f4cc6-aaef-4351-9034-d66268e328f0
Data characteristic 06d1e5e7-79ad-4a71-8faa-373789f7d93c

Wire format

@+  <CMD>  <subtype>  <data...>  %
Action Bytes
Mute on @+M11%
Mute off @+M10%
Set volume (step 0–90) @+V2<NN>%
Switch input (1–8) @+I1<N>%
Fetch volume / mute / input @+F1V% / @+F1M% / @+F1I%

The amp echoes commands back as notifications and sends unsolicited updates when physical controls are used. Volume steps 0–90 map linearly to 0–100%.

Reverse engineering

Protocol recovered by decompiling Cyrus ONE Remote_1.4_APKPure.apk with androguard, tracing fill-array-data-payload literals in MainControlActivity and CyrusONEModel, and decoding the DEX static-values section of the Const class.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages