{"id":13580569,"url":"https://github.com/mlang/ronor","last_synced_at":"2025-05-07T13:03:17.133Z","repository":{"id":73029073,"uuid":"209001631","full_name":"mlang/ronor","owner":"mlang","description":"Sonos smart speaker controller API and command-line tools","archived":false,"fork":false,"pushed_at":"2023-06-03T15:44:55.000Z","size":226,"stargazers_count":222,"open_issues_count":0,"forks_count":7,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-07T13:03:09.659Z","etag":null,"topics":["command-line","sonos","text-to-speech"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mlang.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-09-17T08:37:21.000Z","updated_at":"2024-11-28T16:34:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"8f9356a9-b638-4548-84be-16252c12e1c9","html_url":"https://github.com/mlang/ronor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlang%2Fronor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlang%2Fronor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlang%2Fronor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mlang%2Fronor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mlang","download_url":"https://codeload.github.com/mlang/ronor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252883227,"owners_count":21819158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line","sonos","text-to-speech"],"created_at":"2024-08-01T15:01:53.163Z","updated_at":"2025-05-07T13:03:17.057Z","avatar_url":"https://github.com/mlang.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# Sonos smart speaker controller API and CLI\n\nLinux: [![Build Status](https://travis-ci.org/mlang/ronor.svg?branch=master)](https://travis-ci.org/mlang/ronor)\n\nThis project implements (most of) the [Sonos control API] in a rust crate. It also provides a simple command-line tool which can be used in scripts.\n\n## Building\n\nYou likely need a recent rust compiler.  If you don't have `rustup` installed yet, I recommend you do so:\n\n```console\n$ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nNow you are ready to build/install `ronor`:\n\n```console\n$ cargo install --git https://github.com/mlang/ronor\n```\n\nThis will copy the binary to `~/.cargo/bin/ronor` which should be in your `PATH` if you are using `rustup`.\n\n## Configuration\n\nYou have to register a developer account on integration.sonos.com and create your own integration point. You also need to create your own redirection endpoint on the web. A minimalistic example script is provided in [`static/sonos.php`].  Copy that file to a web space you control, and use it as the redirection URL required when you create the integration.\n\nWith your integration information ready, run `ronor init` and your client id, secret, and redirection url will be saved to `~/.config/ronor/`.\n\nNow you can authorize ronor to access households belonging to your Sonos user account by running `ronor login`.\n\n## How to use\n\nSee `ronor help` for a list of available commands.\n\n### Favorites and Playlists\n\nSonos has two mechanisms for managing content you often play.  Favorites can be thought of as pointers to specific streaming service content.  For instance, a radio station, podcast, or a specific artist or album on a registered streaming service.  A playlist is a list of several tracks, possibly on different streaming services.  There is currently no API to create these, you have to use a Sonos controller like the iOS App to create favorites and playlists.\n\nHowever, you can query and play favorites and playlists:\n\n```console\n$ ronor get-favorites\nDas Soundportal Radio\nFreies Radio Salzkammergut\nÖsterreich 1\nRadio FM4\nRadio Helsinki\nRadio Swiss Classic\nradiOzora Chill channel\nSRF 2 Kultur\n$ ronor load-favorite --play 'Österreich 1' Schlafzimmer\n$ ronor get-playlists\nAcid\nPsybient\nPsyDub\n$ ronor load-playlist --shuffle --crossfade --play PsyDub Wohnzimmer\n```\n\n### Managing groups\n\nUse the [`modify-group`] subcommand to manage grouping of logical players.\n\nFor example, imagine the following household of three players and no grouping.\n\n```console\n$ ronor inventory\nBad = Bad\nWohnzimmer = Wohnzimmer\nSchlafzimmer = Schlafzimmer\n```\n\nThat means, each player is the sole member of a group with the same name.\n\nNow lets make a group of `Schlafzimmer` (bedroom) and `Bad` (Bathroom).\n\n```console\n$ ronor modify-group Schlafzimmer --add Bad\nSchlafzimmer -\u003e Schlafzimmer + 1\n$ ronor inventory\nSchlafzimmer + 1 = Schlafzimmer + Bad\nWohnzimmer = Wohnzimmer\n```\n\nTo undo this group, we simply remove `Bad` from `Schlafzimmer + 1` again:\n\n```console\n$ ronor modify-group 'Schlafzimmer + 1' --remove Bad\nSchlafzimmer + 1 -\u003e Schlafzimmer\n$ ronor inventory\nBad = Bad\nWohnzimmer = Wohnzimmer\nSchlafzimmer = Schlafzimmer\n```\n\nNotice that you never have to name groups.  Sonos will automatically choose a name for a newly created group based on the coordinating player and the number of other members.\n\n### Text to speech\n\nFor the text-to-speech functionality (`ronor speak`) you need `espeak` and `ffmpeg` installed. Simply pipe text to `STDIN` and it should be spoken by the desired player.\n\n```console\n$ echo \"Hallo Wohnzimmer\"|ronor speak --language de Wohnzimmer\n```\n\nAlternatively, `ronor speak` can scrape predefined web resources and speak the extracted text.  The following command will speak the current weather forecast for Styria in Austria:\n\n```console\n$ ronor speak --scrape wetter.orf.at/steiermark Wohnzimmer\n```\n\nThe following scraping sources are predefined:\n\n* Weather in Austria\n  * ORF\n    * [wetter.orf.at/burgenland]\n    * [wetter.orf.at/kaernten]\n    * [wetter.orf.at/niederoesterreich]\n    * [wetter.orf.at/oberoesterreich]\n    * [wetter.orf.at/salzburg]\n    * [wetter.orf.at/steiermark]\n    * [wetter.orf.at/tirol]\n    * [wetter.orf.at/vorarlberg]\n    * [wetter.orf.at/wien]\n  * ZAMG\n    * [zamg.ac.at/cms/de/wetter/wetter-oesterreich/burgenland]\n    * [zamg.ac.at/cms/de/wetter/wetter-oesterreich/kaernten]\n    * [zamg.ac.at/cms/de/wetter/wetter-oesterreich/niederoesterreich]\n    * [zamg.ac.at/cms/de/wetter/wetter-oesterreich/oberoesterreich]\n    * [zamg.ac.at/cms/de/wetter/wetter-oesterreich/salzburg]\n    * [zamg.ac.at/cms/de/wetter/wetter-oesterreich/steiermark]\n    * [zamg.ac.at/cms/de/wetter/wetter-oesterreich/tirol]\n    * [zamg.ac.at/cms/de/wetter/wetter-oesterreich/vorarlberg]\n    * [zamg.ac.at/cms/de/wetter/wetter-oesterreich/wien]\n\n`ronor speak` makes use of [transfer.sh] for temporary storage and the `loadAudioClip` API.  If you'd like to play already prepared audio clips, use `ronor load-audio-clip`.\n\n[Sonos control API]: https://developer.sonos.com/reference/control-api/\n[transfer.sh]: https://transfer.sh/\n[`static/sonos.php`]: https://github.com/mlang/ronor/blob/master/static/sonos.php\n[`modify-group`]: https://github.com/mlang/ronor/blob/master/src/subcmds/modify_group.rs\n[wetter.orf.at/burgenland]: https://wetter.orf.at/burgenland/prognose\n[wetter.orf.at/kaernten]: https://wetter.orf.at/kaernten/prognose\n[wetter.orf.at/niederoesterreich]: https://wetter.orf.at/niederoesterreich/prognose\n[wetter.orf.at/oberoesterreich]: https://wetter.orf.at/oberoesterreich/prognose\n[wetter.orf.at/salzburg]: https://wetter.orf.at/salzburg/prognose\n[wetter.orf.at/steiermark]: https://wetter.orf.at/steiermark/prognose\n[wetter.orf.at/tirol]: https://wetter.orf.at/tirol/prognose\n[wetter.orf.at/vorarlberg]: https://wetter.orf.at/vorarlberg/prognose\n[wetter.orf.at/wien]: https://wetter.orf.at/wien/prognose\n[zamg.ac.at/cms/de/wetter/wetter-oesterreich/burgenland]: https://www.zamg.ac.at/cms/de/wetter/wetter-oesterreich/burgenland/\n[zamg.ac.at/cms/de/wetter/wetter-oesterreich/kaernten]: https://www.zamg.ac.at/cms/de/wetter/wetter-oesterreich/kaernten/\n[zamg.ac.at/cms/de/wetter/wetter-oesterreich/niederoesterreich]: https://www.zamg.ac.at/cms/de/wetter/wetter-oesterreich/niederoesterreich/\n[zamg.ac.at/cms/de/wetter/wetter-oesterreich/oberoesterreich]: https://www.zamg.ac.at/cms/de/wetter/wetter-oesterreich/oberoesterreich/\n[zamg.ac.at/cms/de/wetter/wetter-oesterreich/salzburg]: https://www.zamg.ac.at/cms/de/wetter/wetter-oesterreich/salzburg/\n[zamg.ac.at/cms/de/wetter/wetter-oesterreich/steiermark]: https://www.zamg.ac.at/cms/de/wetter/wetter-oesterreich/steiermark/\n[zamg.ac.at/cms/de/wetter/wetter-oesterreich/tirol]: https://www.zamg.ac.at/cms/de/wetter/wetter-oesterreich/tirol/\n[zamg.ac.at/cms/de/wetter/wetter-oesterreich/vorarlberg]: https://www.zamg.ac.at/cms/de/wetter/wetter-oesterreich/vorarlberg/\n[zamg.ac.at/cms/de/wetter/wetter-oesterreich/wien]: https://www.zamg.ac.at/cms/de/wetter/wetter-oesterreich/wien/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlang%2Fronor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmlang%2Fronor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmlang%2Fronor/lists"}