Skip to content

Commit ec52061

Browse files
authored
Merge pull request #44 from svrooij/feat/sample-value
Sample values
2 parents 5ed07a1 + d0f1479 commit ec52061

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+147
-710
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
11
blank_issues_enabled: false
2+
contact_links:
3+
- name: Questions
4+
url: https://github.com/svrooij/sonos-api-docs/discussions/categories/q-a
5+
about: Please ask and answer questions here.
6+
- name: All discussions
7+
url: https://github.com/svrooij/sonos-api-docs/discussions
8+
about: General discussions about the Sonos API.

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Unofficial Sonos docs
22

3-
[![Sonos api documentation][badge_sonos-docs]][link_sonos-docs]
3+
[![Sonos API documentation][badge_sonos-docs]][link_sonos-docs]
44
[![Github Issues][badge_issues]][link_issues]
55
[![Sonos2mqtt][badge_sonos-mqtt]][link_sonos-mqtt]
66
[![Sonos cli][badge_sonos-cli]][link_sonos-cli]
@@ -9,21 +9,21 @@
99
[![Support me on Github][badge_sponsor]][link_sponsor]
1010
[![Follow on Twitter][badge_twitter]][link_twitter]
1111

12-
Sonos api documentation for the local UPNP api and a [generator](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs) to generate clients and documentation based on service discovery
12+
Sonos API documentation for the local UPNP API and a [generator](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs) to generate clients and documentation based on service discovery
1313

14-
This library is in no way connected to [Sonos](//en.wikipedia.org/wiki/Sonos). It's just a set of text files to document a hidden and **unsupported** api.
14+
This library is in no way connected to [Sonos](//en.wikipedia.org/wiki/Sonos). It's just a set of text files to document a hidden and **unsupported** API.
1515

1616
## Documentation
1717

1818
Check-out the (generated) documentation about all the SONOS UPNP services [svrooij.io/sonos-api-docs/services/](https://sonos.svrooij.io/services/)
1919

20-
[![Sonos api documentation][badge_sonos-docs]][link_sonos-docs]
20+
[![Sonos API documentation][badge_sonos-docs]][link_sonos-docs]
2121

2222
[Read documentation](https://sonos.svrooij.io/)
2323

2424
### Manually documented
2525

26-
The [sonos services](https://svrooij.io/sonos-api-docs/services/) have no documentation, that is why we manually created a [documentation.json](http://svrooij.io/sonos-api-docs/documentation.json) file. To easily add documentation to all services (that are generated with the generator). And it's json so you can easily use it yourself.
26+
The [sonos services](https://sonos.svrooij.io/services/) have no documentation, that is why we manually created a [documentation.json](https://github.com/svrooij/sonos-api-docs/blob/main/docs/documentation.json) file. To easily add documentation to all services (that are generated with the generator). And it's json so you can easily use it yourself.
2727

2828
### Device discovery files
2929

@@ -45,6 +45,10 @@ You can use the generator to generate your own discovery files, but we also have
4545

4646
These files together with the documentation file, are combined to a extensive JSON file, that is used as an input for the generator.
4747

48+
## Community
49+
50+
If you have any [questions](https://github.com/svrooij/sonos-api-docs/discussions/categories/q-a) or you want to [show](https://github.com/svrooij/sonos-api-docs/discussions/categories/show-and-tell) your Sonos integration. Please join us in the [discussions](https://github.com/svrooij/sonos-api-docs/discussions) tab on this repository.
51+
4852
## Contributors ✨
4953

5054
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
@@ -81,7 +85,6 @@ specification. Contributions of any kind welcome!
8185
[badge_sponsor]: https://img.shields.io/github/sponsors/svrooij?logo=github&style=for-the-badge
8286
[badge_twitter]: https://img.shields.io/twitter/follow/svrooij?logo=twitter&style=for-the-badge
8387

84-
8588
[link_sponsor]: https://github.com/sponsors/svrooij
8689
[link_issues]: https://github.com/svrooij/sonos-api-docs/issues
8790
[link_sonos-cli]: https://github.com/svrooij/sonos-cli

docs/developers.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ For example [this part](https://github.com/svrooij/sonos-api-docs/blob/25aad3a3a
5555

5656
We build a custom [generator](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs) to do several things.
5757

58-
### Discover services from sonos speaker
58+
### Discover services from Sonos speaker
5959

6060
You can use the generator to generate [device discovery files]({{ '/#device-discovery-files' | relative_url }}). For each model we generated a discovery json, as available on main page. We generate this file by parsing the device discovery document available at `http://{sonos_ip}:1400/xml/device_description.xml`. Not every model has the same services, but it seems that if a service is available it's the same as all other models that have that service.
6161

@@ -74,9 +74,11 @@ npm install
7474
./bin/run services {sonos-ip}
7575
```
7676

77+
Please help us out occasionally by running this command on your own Sonos speaker and send us the resulting file. This way we can keep the discovery files up to date. This command will automatically update the discovery files in the `data` folder. These files are used as an input for the generator. Having up to date discovery files will help us to keep the documentation up to date. All personal identifiable information is removed from the discovery files.
78+
7779
### Combine discovery files and documentation
7880

79-
If you changed the [documentation.json](#documentation.json) file or if you added/updated discovery files, you need to combine the two into one file, the **.cache/combined.json** file.
81+
If you changed the [documentation.json](./documentation.json) file or if you added/updated discovery files, you need to combine the two into one file, the **.cache/combined.json** file.
8082

8183
This file is the result of the the manual documentation and the device discovery files. This file is almost 8000 lines of json at the moment, which is why it is ignored in git.
8284
Being able to inspect this json file should really help in debugging the generator.
@@ -101,7 +103,7 @@ npx @svrooij/sonos-docs combine --docsFile=./docs/documentation.json --folder=./
101103

102104
### Regenerate documentation
103105

104-
Once you generated the **combined.json** file, you can use the generator to (re)generate the [service documentation]({{ '/services' | relative_url }}). This step is mandatory if you changed either the **documentation.json** or if you added/updated one of the discovery files.
106+
Once you generated the **combined.json** file, you can use the generator to (re)generate the [service documentation]({{ '/services' | relative_url }}). This step is mandatory if you changed either the **documentation.json** or if you added/updated one of the discovery files.
105107

106108
The resulting files, are **not to be changed manually**, since changes will get lost upon the next generation.
107109

@@ -135,7 +137,7 @@ The template.json file gives some basic information about the template, the auth
135137
1. File usage `index`, will use the data from intermediate.json as input to produce **one file**.
136138
2. File usage `service`, will use the data from each service to produce **one file per service**, be sure to use `{snService}` or `{service}` in the **outputFile**.
137139

138-
Be sure to check out the [docs template](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs/templates/docs) to get started. Or the [ts template](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs/templates/ts), which is used to generate [sonos-ts](https://svrooij.io/node-sonos-ts/).
140+
Be sure to check out the [docs template](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs/templates/docs) to get started. Or the [ts template](https://github.com/svrooij/node-sonos-ts/tree/master/.generator/ts), which is used to generate [Sonos typescript](https://sonos-ts.svrooij.io/).
139141

140142

141143
```bash

docs/documentation.json

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,19 @@
2020
"Volume": "Volume between 0 and 100",
2121
"IncludeLinkedZones": "Should grouped players also play the alarm?",
2222
"AssignedID": "The ID of the new alarm"
23+
},
24+
"sample": {
25+
"StartLocalTime": "07:00:00",
26+
"Duration": "00:30:00",
27+
"Recurrence": "DAILY",
28+
"Enabled": "1",
29+
"RoomUUID": "RINCON_000E58FE3AEA01400",
30+
"ProgramURI": "x-rincon-buzzer:0",
31+
"ProgramMetaData": "",
32+
"PlayMode": "NORMAL",
33+
"Volume": "20",
34+
"IncludeLinkedZones": "1",
35+
"AssignedID": "1"
2336
}
2437
},
2538
"DestroyAlarm": {
@@ -59,7 +72,7 @@
5972
"description": "Control line in"
6073
},
6174
"AVTransportService": {
62-
"description": "Service that controls stuff related to transport (play/pause/next/special urls)",
75+
"description": "Service that controls stuff related to transport (play/pause/next/special URLs)",
6376
"actions": {
6477
"AddURIToQueue": {
6578
"description": "Adds songs to the SONOS queue",

docs/index.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ This file has a [documentation json schema](https://sonos.svrooij.io/schema/docu
3838

3939
### Update documentation
4040

41-
If you change the [documentation](#manual-documentation-file) file or if you did service discovery for a new device. You can update the documentation files with the following commands:
41+
If you change the [documentation](#manually-documented) file or if you did service discovery for a new device. You can update the documentation files with the following commands:
4242

4343
```shell
4444
# Go to generation folder
@@ -55,7 +55,7 @@ npm run docs
5555

5656
## Generator
5757

58-
You can find the generator [here](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs) and use it to generate your own sonos client in your preferred language.
58+
You can find the generator [here](https://github.com/svrooij/sonos-api-docs/tree/main/generator/sonos-docs) and use it to generate your own Sonos client in your preferred language.
5959

6060
### Device discovery files
6161

@@ -84,9 +84,7 @@ The template.json also has a [json schema](https://svrooij.io/sonos-api-docs/sch
8484

8585
## Community
8686

87-
[![Join us on Discord][badge_discord]][link_discord]
88-
89-
If you need help building an app that talks to your sonos speakers, or you want to share some of your findings. [Join us on Discord][link_discord].
87+
If you have any [questions](https://github.com/svrooij/sonos-api-docs/discussions/categories/q-a) or you want to [show](https://github.com/svrooij/sonos-api-docs/discussions/categories/show-and-tell) your Sonos integration. Please join us in the [discussions](https://github.com/svrooij/sonos-api-docs/discussions) tab on this repository.
9088

9189
## Contributors ✨
9290

docs/music-services.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ You should get a response that looks like this (Spofity result):
245245

246246
This results in:
247247

248-
- `regUrl` this is the url you should visit in the browser, it will ask you to login.
248+
- `regUrl` this is the URL you should visit in the browser, it will ask you to login.
249249
- `linkCode` this is sometimes needed to fill in on the page. And you'll need it for the next step.
250250

251251
#### AppLink - Step 2
@@ -338,7 +338,7 @@ With the following body:
338338

339339
This will results in a response with at least the following data:
340340

341-
- `regUrl` this is the url you should visit in the browser, it will ask you to login.
341+
- `regUrl` this is the URL you should visit in the browser, it will ask you to login.
342342
- `linkCode` this is sometimes needed to fill in on the page. And you'll need it for the next step.
343343

344344
Continue with [applink - step 2](#applink---step-2) after visiting the **regUrl** in the browser.

docs/schema/documentation.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,16 @@
5151
},
5252
"type": "object"
5353
},
54+
"sample": {
55+
"title": "Sample values",
56+
"description": "Sample values for the parameters",
57+
"additionalProperties": {
58+
"title": "Value",
59+
"description": "Working value, by it name as key",
60+
"type": "string"
61+
},
62+
"type": "object"
63+
},
5464
"remarks": {
5565
"title": "Action remarks",
5666
"description": "Remarks about this action",

docs/services/alarm-clock.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,16 @@ Action body:
5555

5656
```xml
5757
<u:CreateAlarm xmlns:u="urn:schemas-upnp-org:service:AlarmClock:1">
58-
<StartLocalTime>string</StartLocalTime>
59-
<Duration>string</Duration>
60-
<Recurrence>string</Recurrence>
61-
<Enabled>boolean</Enabled>
62-
<RoomUUID>string</RoomUUID>
63-
<ProgramURI>string</ProgramURI>
58+
<StartLocalTime>07:00:00</StartLocalTime>
59+
<Duration>00:30:00</Duration>
60+
<Recurrence>DAILY</Recurrence>
61+
<Enabled>1</Enabled>
62+
<RoomUUID>RINCON_000E58FE3AEA01400</RoomUUID>
63+
<ProgramURI>x-rincon-buzzer:0</ProgramURI>
6464
<ProgramMetaData>string</ProgramMetaData>
65-
<PlayMode>string</PlayMode>
66-
<Volume>ui2</Volume>
67-
<IncludeLinkedZones>boolean</IncludeLinkedZones>
65+
<PlayMode>NORMAL</PlayMode>
66+
<Volume>20</Volume>
67+
<IncludeLinkedZones>1</IncludeLinkedZones>
6868
</u:CreateAlarm>
6969
```
7070

@@ -450,15 +450,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c
450450

451451
| Device | Software generation | Software version | Discovery date |
452452
|:-------|:--------------------|:-----------------|:---------------|
453-
| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z |
453+
| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z |
454454
| `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z |
455455
| `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z |
456-
| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z |
456+
| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z |
457457
| `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z |
458458
| `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z |
459459
| `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z |
460-
| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z |
460+
| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z |
461461
| `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z |
462462
| `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z |
463-
| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z |
463+
| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z |
464464
| `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z |

docs/services/av-transport.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ parent: Sonos Services
66
# AVTransport service
77
{: .no_toc }
88

9-
Service that controls stuff related to transport (play/pause/next/special urls)
9+
Service that controls stuff related to transport (play/pause/next/special URLs)
1010

1111
The AVTransport service is available on these models: `Sonos Play:1 (S1) S2` / `Sonos One (S13) S2` / `Sonos Beam (S14) S2` / `Sonos One (S18) S2` / `SYMFONISK Bookshelf (S21) S2` / `Sonos Roam (S27) S2` / `Sonos Play:3 (S3) S2` / `SYMFONISK Bookshelf (S33) S2` / `Sonos One SL (S38) S2` / `Sonos Play:5 (S6) S2` / `Sonos Playbar (S9) S2` / `Sonos Sub (Sub) S2`.
1212

@@ -1224,15 +1224,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c
12241224

12251225
| Device | Software generation | Software version | Discovery date |
12261226
|:-------|:--------------------|:-----------------|:---------------|
1227-
| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z |
1227+
| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z |
12281228
| `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z |
12291229
| `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z |
1230-
| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z |
1230+
| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z |
12311231
| `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z |
12321232
| `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z |
12331233
| `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z |
1234-
| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z |
1234+
| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z |
12351235
| `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z |
12361236
| `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z |
1237-
| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z |
1237+
| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z |
12381238
| `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z |

docs/services/connection-manager.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ This file is automatically generated with [@svrooij/sonos-docs](https://github.c
140140

141141
| Device | Software generation | Software version | Discovery date |
142142
|:-------|:--------------------|:-----------------|:---------------|
143-
| `Sonos Play:1 (S1)` | S2 | 72.2-40060 | 2023-05-22T16:39:21.190Z |
143+
| `Sonos Play:1 (S1)` | S2 | 77.4-49290 | 2024-02-13T15:56:06.184Z |
144144
| `Sonos One (S13)` | S2 | 63.2-90210 | 2021-07-21T23:31:19.273Z |
145145
| `Sonos Beam (S14)` | S2 | 64.3-19080 | 2021-08-18T06:04:08.308Z |
146-
| `Sonos One (S18)` | S2 | 72.2-40060 | 2023-05-22T16:38:38.243Z |
146+
| `Sonos One (S18)` | S2 | 77.4-49290 | 2024-02-13T15:55:36.464Z |
147147
| `SYMFONISK Bookshelf (S21)` | S2 | 66.4-23300 | 2022-01-01T11:41:01.361Z |
148148
| `Sonos Roam (S27)` | S2 | 63.2-90210 | 2021-07-21T23:31:31.207Z |
149149
| `Sonos Play:3 (S3)` | S2 | 64.3-19080 | 2021-08-18T06:09:36.692Z |
150-
| `SYMFONISK Bookshelf (S33)` | S2 | 72.2-40060 | 2023-05-22T16:39:16.679Z |
150+
| `SYMFONISK Bookshelf (S33)` | S2 | 77.4-49290 | 2024-02-13T15:55:24.423Z |
151151
| `Sonos One SL (S38)` | S2 | 72.2-40060 | 2023-05-22T16:39:25.503Z |
152152
| `Sonos Play:5 (S6)` | S2 | 64.3-19080 | 2021-08-18T06:06:35.970Z |
153-
| `Sonos Playbar (S9)` | S2 | 72.2-40060 | 2023-05-22T16:38:57.120Z |
153+
| `Sonos Playbar (S9)` | S2 | 77.4-49290 | 2024-02-13T15:55:46.307Z |
154154
| `Sonos Sub (Sub)` | S2 | 63.2-90210 | 2021-07-21T23:31:40.304Z |

0 commit comments

Comments
 (0)