@homebridge-plugins/homebridge-homepod-radio 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/.idea/codeStyles/Project.xml +87 -0
  2. package/.idea/codeStyles/codeStyleConfig.xml +5 -0
  3. package/.idea/copilot.data.migration.ask2agent.xml +6 -0
  4. package/.idea/dictionaries/benpotter.xml +3 -0
  5. package/.idea/homebridge-homepod-radio.iml +8 -0
  6. package/.idea/inspectionProfiles/Project_Default.xml +6 -0
  7. package/.idea/modules.xml +8 -0
  8. package/.idea/vcs.xml +6 -0
  9. package/.prettierrc +9 -0
  10. package/Dockerfile +4 -0
  11. package/LICENSE +21 -0
  12. package/README.md +312 -0
  13. package/bin/dummy.mp3 +0 -0
  14. package/bin/sample-3s.mp3 +0 -0
  15. package/bin/sample-9s.mp3 +0 -0
  16. package/bin/samples.m3u +7 -0
  17. package/bin/stream.py +610 -0
  18. package/bin/test_stream_m3u.sh +3 -0
  19. package/bin/test_stream_mp3.sh +3 -0
  20. package/config.schema.json +157 -0
  21. package/dist/dummy.mp3 +0 -0
  22. package/dist/e2e/test_e2e.d.ts +1 -0
  23. package/dist/e2e/test_e2e.js +38 -0
  24. package/dist/e2e/test_e2e.js.map +1 -0
  25. package/dist/index.d.ts +3 -0
  26. package/dist/index.js +9 -0
  27. package/dist/index.js.map +1 -0
  28. package/dist/lib/airplayDevice.d.ts +36 -0
  29. package/dist/lib/airplayDevice.js +227 -0
  30. package/dist/lib/airplayDevice.js.map +1 -0
  31. package/dist/lib/homebridgeCallbacks.d.ts +1 -0
  32. package/dist/lib/homebridgeCallbacks.js +20 -0
  33. package/dist/lib/homebridgeCallbacks.js.map +1 -0
  34. package/dist/lib/httpService.d.ts +15 -0
  35. package/dist/lib/httpService.js +31 -0
  36. package/dist/lib/httpService.js.map +1 -0
  37. package/dist/lib/playbackController.d.ts +19 -0
  38. package/dist/lib/playbackController.js +32 -0
  39. package/dist/lib/playbackController.js.map +1 -0
  40. package/dist/lib/promises.d.ts +2 -0
  41. package/dist/lib/promises.js +13 -0
  42. package/dist/lib/promises.js.map +1 -0
  43. package/dist/lib/storage.d.ts +6 -0
  44. package/dist/lib/storage.js +20 -0
  45. package/dist/lib/storage.js.map +1 -0
  46. package/dist/platform.d.ts +27 -0
  47. package/dist/platform.js +109 -0
  48. package/dist/platform.js.map +1 -0
  49. package/dist/platformAudioSwitchAccessory.d.ts +23 -0
  50. package/dist/platformAudioSwitchAccessory.js +91 -0
  51. package/dist/platformAudioSwitchAccessory.js.map +1 -0
  52. package/dist/platformConfig.d.ts +34 -0
  53. package/dist/platformConfig.js +67 -0
  54. package/dist/platformConfig.js.map +1 -0
  55. package/dist/platformConstants.d.ts +4 -0
  56. package/dist/platformConstants.js +5 -0
  57. package/dist/platformConstants.js.map +1 -0
  58. package/dist/platformHomepodVolumeAccessory.d.ts +37 -0
  59. package/dist/platformHomepodVolumeAccessory.js +108 -0
  60. package/dist/platformHomepodVolumeAccessory.js.map +1 -0
  61. package/dist/platformRadioAccessory.d.ts +40 -0
  62. package/dist/platformRadioAccessory.js +150 -0
  63. package/dist/platformRadioAccessory.js.map +1 -0
  64. package/dist/platformRadioSwitchAccessory.d.ts +12 -0
  65. package/dist/platformRadioSwitchAccessory.js +55 -0
  66. package/dist/platformRadioSwitchAccessory.js.map +1 -0
  67. package/dist/platformWebActions.d.ts +30 -0
  68. package/dist/platformWebActions.js +123 -0
  69. package/dist/platformWebActions.js.map +1 -0
  70. package/dist/sample-3s.mp3 +0 -0
  71. package/dist/sample-9s.mp3 +0 -0
  72. package/dist/samples.m3u +7 -0
  73. package/dist/stream.py +610 -0
  74. package/dist/test_stream_m3u.sh +3 -0
  75. package/dist/test_stream_mp3.sh +3 -0
  76. package/eslint.config.js +35 -0
  77. package/example.config.json +26 -0
  78. package/homepod-radio.png +0 -0
  79. package/images/bbc-radio-shortcut.png +0 -0
  80. package/images/play-file-shortcut.jpeg +0 -0
  81. package/package.json +59 -0
@@ -0,0 +1,87 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <code_scheme name="Project" version="173">
3
+ <option name="OTHER_INDENT_OPTIONS">
4
+ <value>
5
+ <option name="INDENT_SIZE" value="2" />
6
+ <option name="TAB_SIZE" value="2" />
7
+ </value>
8
+ </option>
9
+ <HTMLCodeStyleSettings>
10
+ <option name="HTML_SPACE_INSIDE_EMPTY_TAG" value="true" />
11
+ </HTMLCodeStyleSettings>
12
+ <JSCodeStyleSettings version="0">
13
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
14
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
15
+ <option name="USE_DOUBLE_QUOTES" value="false" />
16
+ <option name="FORCE_QUOTE_STYlE" value="true" />
17
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
18
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
19
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
20
+ </JSCodeStyleSettings>
21
+ <TypeScriptCodeStyleSettings version="0">
22
+ <option name="FORCE_SEMICOLON_STYLE" value="true" />
23
+ <option name="SPACE_BEFORE_FUNCTION_LEFT_PARENTH" value="false" />
24
+ <option name="USE_DOUBLE_QUOTES" value="false" />
25
+ <option name="FORCE_QUOTE_STYlE" value="true" />
26
+ <option name="ENFORCE_TRAILING_COMMA" value="WhenMultiline" />
27
+ <option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" />
28
+ <option name="SPACES_WITHIN_IMPORTS" value="true" />
29
+ </TypeScriptCodeStyleSettings>
30
+ <VueCodeStyleSettings>
31
+ <option name="INTERPOLATION_NEW_LINE_AFTER_START_DELIMITER" value="false" />
32
+ <option name="INTERPOLATION_NEW_LINE_BEFORE_END_DELIMITER" value="false" />
33
+ </VueCodeStyleSettings>
34
+ <editorconfig>
35
+ <option name="ENABLED" value="false" />
36
+ </editorconfig>
37
+ <codeStyleSettings language="HTML">
38
+ <option name="SOFT_MARGINS" value="120" />
39
+ <indentOptions>
40
+ <option name="INDENT_SIZE" value="6" />
41
+ <option name="CONTINUATION_INDENT_SIZE" value="6" />
42
+ <option name="TAB_SIZE" value="6" />
43
+ </indentOptions>
44
+ </codeStyleSettings>
45
+ <codeStyleSettings language="JSON">
46
+ <indentOptions>
47
+ <option name="TAB_SIZE" value="2" />
48
+ </indentOptions>
49
+ </codeStyleSettings>
50
+ <codeStyleSettings language="JavaScript">
51
+ <option name="SOFT_MARGINS" value="120" />
52
+ <indentOptions>
53
+ <option name="INDENT_SIZE" value="6" />
54
+ <option name="CONTINUATION_INDENT_SIZE" value="6" />
55
+ <option name="TAB_SIZE" value="6" />
56
+ </indentOptions>
57
+ </codeStyleSettings>
58
+ <codeStyleSettings language="Markdown">
59
+ <indentOptions>
60
+ <option name="INDENT_SIZE" value="2" />
61
+ <option name="TAB_SIZE" value="2" />
62
+ </indentOptions>
63
+ </codeStyleSettings>
64
+ <codeStyleSettings language="TypeScript">
65
+ <option name="SOFT_MARGINS" value="120" />
66
+ <indentOptions>
67
+ <option name="INDENT_SIZE" value="6" />
68
+ <option name="CONTINUATION_INDENT_SIZE" value="6" />
69
+ <option name="TAB_SIZE" value="6" />
70
+ </indentOptions>
71
+ </codeStyleSettings>
72
+ <codeStyleSettings language="Vue">
73
+ <option name="SOFT_MARGINS" value="120" />
74
+ <indentOptions>
75
+ <option name="INDENT_SIZE" value="6" />
76
+ <option name="CONTINUATION_INDENT_SIZE" value="6" />
77
+ <option name="TAB_SIZE" value="6" />
78
+ </indentOptions>
79
+ </codeStyleSettings>
80
+ <codeStyleSettings language="XML">
81
+ <indentOptions>
82
+ <option name="INDENT_SIZE" value="2" />
83
+ <option name="TAB_SIZE" value="2" />
84
+ </indentOptions>
85
+ </codeStyleSettings>
86
+ </code_scheme>
87
+ </component>
@@ -0,0 +1,5 @@
1
+ <component name="ProjectCodeStyleConfiguration">
2
+ <state>
3
+ <option name="USE_PER_PROJECT_SETTINGS" value="true" />
4
+ </state>
5
+ </component>
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="Ask2AgentMigrationStateService">
4
+ <option name="migrationStatus" value="COMPLETED" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,3 @@
1
+ <component name="ProjectDictionaryState">
2
+ <dictionary name="benpotter" />
3
+ </component>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="WEB_MODULE" version="4">
3
+ <component name="NewModuleRootManager">
4
+ <content url="file://$MODULE_DIR$" />
5
+ <orderEntry type="inheritedJdk" />
6
+ <orderEntry type="sourceFolder" forTests="false" />
7
+ </component>
8
+ </module>
@@ -0,0 +1,6 @@
1
+ <component name="InspectionProjectProfileManager">
2
+ <profile version="1.0">
3
+ <option name="myName" value="Project Default" />
4
+ <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
5
+ </profile>
6
+ </component>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/homebridge-homepod-radio.iml" filepath="$PROJECT_DIR$/.idea/homebridge-homepod-radio.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/.prettierrc ADDED
@@ -0,0 +1,9 @@
1
+ {
2
+ "bracketSpacing": true,
3
+ "printWidth": 120,
4
+ "semi": true,
5
+ "singleQuote": true,
6
+ "tabWidth": 6,
7
+ "useTabs": false,
8
+ "trailingComma": "all"
9
+ }
package/Dockerfile ADDED
@@ -0,0 +1,4 @@
1
+ FROM oznu/homebridge:ubuntu
2
+ RUN apt update
3
+ RUN apt-get install python3
4
+ RUN pip3 install pyatv
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Alexandru Dragoescu
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,312 @@
1
+ <div>
2
+ <a href="https://www.npmjs.com/package/@homebridge-plugins/homebridge-homepod-radio"><img src="https://img.shields.io/github/package-json/v/homebridge-plugins/homebridge-homepod-radio?color=F99211" /></a>
3
+ <a href="https://www.npmjs.com/package/@homebridge-plugins/homebridge-homepod-radio"><img src="https://img.shields.io/github/v/release/homebridge-plugins/homebridge-homepod-radio?color=FFd461" /></a>
4
+ <a href="https://github.com/homebridge/homebridge/wiki/Verified-Plugins"><img src="https://img.shields.io/badge/homebridge-verified-blueviolet?color=%23491F59&style=flat" /></a>
5
+ <a href="https://github.com/homebridge-plugins/homebridge-homepod-radio"><img src="https://img.shields.io/badge/_homebridge_v2.0_-_ready_-4CAF50" /></a>
6
+ <a href="https://discord.gg/Z8jmyvb"><img src="https://img.shields.io/badge/discord-%23homepod--radio-737CF8" /></a>
7
+ </div>
8
+
9
+ <br/><br/>
10
+ <p align="center" vertical-align="middle">
11
+ <a href="https://github.com/homebridge-plugins/homebridge-homepod-radio"><img src="homepod-radio.png" height="140"></a>
12
+ <a href="https://github.com/homebridge/homebridge"><img src="https://raw.githubusercontent.com/homebridge/branding/master/logos/homebridge-wordmark-logo-vertical.png" height="140"></a>
13
+ </p>
14
+
15
+ <span align="center">
16
+
17
+ # HomePod Radio
18
+
19
+ </span>
20
+
21
+ ### HomePod Radio is a Homebridge plugin for streaming radio urls and audio files to a Homepod (Mini or OG) or an Apple TV.
22
+
23
+ ## <!-- Thin separator line -->
24
+
25
+ ## Streaming radio to HomePod
26
+
27
+ The main idea is to stream audio to the HomePod or Apple TV using the `pyatv` AirPlay library.
28
+
29
+ - Automatically stops streaming when HomePod is used by another app
30
+ - Sometimes audio streaming stops, so plugin automatically restarts it
31
+
32
+ > [!NOTE]
33
+ > As the plugin is streaming via AirPlay, it should work with any AirPlay enabled speakers. YMMV.
34
+
35
+ ## Requirements
36
+ - NodeJS (>=8.9.3) with NPM (>=6.4.1)
37
+ - pyatv (>=0.13) which require python (>= 3.8)
38
+
39
+ For the HomePod you can specify device MAC address or device name.
40
+
41
+ ## Usage Example:
42
+
43
+ ### Multiple radio accessories support
44
+
45
+ > [!IMPORTANT]
46
+ > Each radio speaker must be added to Home app separately with Homebridge pin pairing
47
+
48
+ Config example:
49
+
50
+ ```
51
+ {
52
+ "platform": "HomepodRadioPlatform",
53
+ "serialNumber": "20020105:00",
54
+ "homepodId": "<homepod id or name>",
55
+ "httpPort": 7654,
56
+ "mediaPath": "/media/homepod",
57
+ "enableVolumeControl": true,
58
+ "radios": [
59
+ {
60
+ "name": "BBC - Radio 1",
61
+ "radioUrl": "http://stream.live.vc.bbcmedia.co.uk/bbc_radio_one",
62
+ "artworkUrl": "https://ichef.bbci.co.uk/images/ic/1920x1080/p05d68tx.jpg",
63
+ "autoResume": true,
64
+ "onSwitch": true
65
+ }
66
+ ],
67
+ "audioFiles": [
68
+ {
69
+ "name": "Alert",
70
+ "fileName": "police.mp3",
71
+ "volume": 85
72
+ }
73
+ ]
74
+ }
75
+ ```
76
+
77
+ ### Radio metadata support
78
+
79
+ Some radios provide metadata about currently played tracks. The plugin supports an optional `metadataUrl` parameter and tries to fetch JSON in the following format (example: https://o.tavrmedia.ua/rokscla):
80
+ ```
81
+ [
82
+ {
83
+ "stime": "15:29:21",
84
+ "time": "15:29",
85
+ "singer": "Billy Joel",
86
+ "song": "Honesty",
87
+ "cover": "https://www.radioroks.ua/static/img/content/cover/0/38/500x500.jpg"
88
+ },
89
+ {
90
+ "stime": "15:25:38",
91
+ "time": "15:25",
92
+ "singer": "Fleetwood Mac",
93
+ "song": "Everywhere",
94
+ "cover": ""
95
+ },
96
+ ...
97
+ ]
98
+ ```
99
+
100
+ The plugin then
101
+ - Enriches the radio stream with `singer` and `song` values from the retrieved metadata
102
+ - Enriches the radio artwork with the image downloaded using the `cover` metadata URL
103
+
104
+ > [!NOTE]
105
+ > Due to some bugs/limitations in tvOS 16/17, HomePods are not showing this info.
106
+
107
+ ## Audio file playback
108
+
109
+ The plugin allows to start file playback either through a add switch accessory (see below) or it can be triggered from a webhook.
110
+
111
+ Make sure your audio files are available to the Homebridge server, for example by downloading them to the server:
112
+ ```
113
+ $ mkdir -r /home/pi/media
114
+ $ <downlaod files to /home/pi/media>
115
+ $ ls /home/pi/media
116
+ -rw-r--r-- 1 pi pi 94622 Jan 10 16:46 hello.wav
117
+ ```
118
+ Configure the plugin to play files from `/home/pi/media` by setting the `mediaPath` property:
119
+ ```
120
+ "mediaPath": "/home/pi/media",
121
+ ```
122
+
123
+ ### Switch accessory for audio file playback
124
+
125
+ This feature adds a switch accessory in the `audioFiles` section for each audio file you want to stream
126
+ ```
127
+ "audioFiles": [
128
+ {
129
+ "name": "Alert",
130
+ "fileName": "police.mp3",
131
+ "volume": 85
132
+ }
133
+ ]
134
+ ```
135
+ Supported audio file formats are `mp3`, `wav`, `flac`, and `ogg`.
136
+
137
+ You can also specify an `.m3u` playlist file to stream multiple files:
138
+ ```
139
+ "audioFiles": [
140
+ {
141
+ "name": "Relaxing Mood",
142
+ "fileName": "death_metal.m3u",
143
+ "volume": 85
144
+ }
145
+ ]
146
+ ```
147
+
148
+ The `.m3u` file format is just a list of audio files:
149
+ ```
150
+ # My playlist
151
+
152
+ # Metallica, 1991
153
+ Nothing Else Matters.mp3
154
+
155
+ # Master Of Puppets, 1986
156
+ Master Of Puppets.mp3
157
+
158
+ # Ride The Lightning, 1984
159
+ For Whom The Bell Tolls.mp3
160
+ ```
161
+ > [!NOTE]
162
+ > Comments starting with `#` and empty lines are ignored.
163
+
164
+ ### Webhook for audio file playback
165
+
166
+ You should use the Homebridge server name (default for Homebridge server is homebridge.local) or IP to invoke playback via URL
167
+
168
+ Example:
169
+ - Homebridge is running on host "homebridge.local"
170
+ - `hello.mp3` file is on the same server on `/var/www/media`
171
+ - Plugin's "httpPort" is set to `4567`
172
+ - Plugin's "mediaPath" is set to `/var/www/media`
173
+
174
+ Then you can trigger playback of `hello.mp3` even from browser by navigating to: `http://homebridge.local:4567/play/hello.mp3`
175
+
176
+ You can specify the playback volume level, by adding it to the end of the playback URL: `http://homebridge.local:4567/play/hello.mp3/75`
177
+
178
+ ### Audio file playback automation example
179
+
180
+ - Configure automation to play file
181
+ - Select/Create automation in Home app
182
+ - Tap "Select Accessories and Scenes..."
183
+ - At the botton tap "Convert to Shortcut"
184
+ - Create shortcut:
185
+ ![Screenshot](images/play-file-shortcut.jpeg)
186
+ - Test shortcut
187
+
188
+ ## HomePod access setup
189
+
190
+ In the Home app settings:
191
+
192
+ - Tap the Homes and Home Settings button.
193
+ - Tap Home Settings > Allow Speaker & TV Access, then choose "allow everyone"
194
+ - *Important!* Reboot the HomePod
195
+
196
+ ## Siri support (works on iPhone/iPad)
197
+
198
+ - Create shortcut with name (for example) "Start Radio"
199
+ - Select "Control Home" action, check corresponding speaker and in "Media" section select "Resume Audio")
200
+ ![Screenshot](images/bbc-radio-shortcut.png)
201
+ - Say "Hey Siri, start radio" on iPhone/iPad (on HomePod Mini Siri does not run it properly)
202
+
203
+ ## Dependencies
204
+
205
+ ### PyATV lib
206
+
207
+ For streaming to the HomePod the plugin uses pyatv (https://pyatv.dev).
208
+ Follow these setup instructions for RaspberryPi/Linux. If installing on a different platform, adjust as needed.
209
+
210
+ Install python3:
211
+ ```
212
+ sudo apt-get install python3
213
+ ```
214
+ Install pip3:
215
+ ```
216
+ sudo apt-get install python3-pip
217
+ ```
218
+ Install pyatv:
219
+ ```
220
+ pip3 install pyatv
221
+ ```
222
+ If the installation fails with this error:
223
+ ```
224
+ error: externally-managed-environment
225
+
226
+ × This environment is externally managed
227
+ ```
228
+ Then install pyatv with the `break-system-packages` option:
229
+ ```
230
+ pip3 install --break-system-packages
231
+ ```
232
+ Make atvremote available for homebridge:
233
+ ```
234
+ sudo ln -s /home/pi/.local/bin/atvremote /usr/local/bin/atvremote
235
+ ```
236
+
237
+ ### Installing the PyATV lib in the Homebridge Docker container
238
+
239
+ The Homebridge Docker image comes with the latest version of `python` pre-installed. At the time of writing, the image is based on `Ubuntu 22.04`, with `Python 3.10.12` included.
240
+
241
+ To avoid having to reinstall `pyatv` every time the container is recreated (for example when updating the Homebridge image), Homebridge provides the `startup.sh` script, which is executed after the Docker container is finished starting up. Add the following line to the end of `startup.sh`:
242
+ ```
243
+ pip3 install --break-system-packages
244
+ ```
245
+ You can do this from the command line (using your favorite editor) and finding the script in the Homebridge `config` folder. Alternatively you can edit it from the Homebridge UI, by going to `Settings`, `Startup & Environment`, `Startup Script`. If you edit the script from the UI or after the container has started, you will need to restart the container.
246
+
247
+ ## Setup steps
248
+
249
+ Starting with various OS versions, Apple devices have started generating, by default, a new random MAC address for each wireless network they connect to. The HomePod Identifiers are based on the MAC address and while it will not change every time the HomePod reconnects to your home wifi, resetting a HomePod will indeed generate a new randomized MAC address and therefore new HomePod Identifiers. If this happens, you will have to update the plugin configuration.
250
+
251
+ Due to Apple's use of MAC address randomization and simply to make it easier to setup and read the plugin configuration, you can use the HomePod name (as displayed in the Home app) in the `HomePod Id` field, as well as any of the HomePod Identifiers. If you use the HomePod name, you will have to update the plugin configuration if you change it in the Home app.
252
+
253
+ ### Find HomePod Identifiers:
254
+
255
+ Scan for devices:
256
+ ```
257
+ atvremote scan
258
+ ```
259
+ Select one of `Identifiers` values from the chosen device (or the `Name` value):
260
+ ```
261
+ Name: HomePod
262
+ Model/SW: HomePod Mini, tvOS 15.2
263
+ Address: 192.168.1.7
264
+ MAC: F4:22:F0:10:33:71
265
+ Deep Sleep: False
266
+ Identifiers:
267
+ - F4:22:F0:10:33:71
268
+ - F422F0103371
269
+ ```
270
+
271
+ ### Stream URL format
272
+
273
+ The easieast path would be to get the streaming url from your favorite radio playlist (usually .m3u file).
274
+ Example for BBC Radio: https://gist.github.com/bpsib/67089b959e4fa898af69fea59ad74bc3
275
+
276
+ ## Known issues
277
+
278
+ ### 1. Pairing setting for the HomePod (fixed by *[HomePod access setup](#homepod-access-setup)* step):
279
+
280
+ Make sure your HomePod has ```Pairing: NotNeeded``` set for RAOP protocol.
281
+
282
+ Scan for devices:
283
+ ```
284
+ atvremote scan
285
+ ```
286
+ Select for your device:
287
+ ```
288
+ Services:
289
+ - Protocol: Companion, Port: 49152, Credentials: None, Requires Password: False, Password: None, Pairing: Unsupported
290
+ - Protocol: AirPlay, Port: 7000, Credentials: None, Requires Password: False, Password: None, Pairing: NotNeeded
291
+ - Protocol: RAOP, Port: 7000, Credentials: None, Requires Password: False, Password: None, Pairing: NotNeeded
292
+ ```
293
+
294
+ > [!IMPORTANT]
295
+ > Streaming will not work if you get `Pairing: Disabled` or `Pairing: Unsupported`
296
+
297
+ ### 2. HomePod playback errors
298
+
299
+ Sometimes (quite rarely) playback fails and in the logs there are errors like:
300
+ ```
301
+ pyatv.exceptions.HttpError: RTSP/1.0 method SETUP failed with code 500: Internal Server Error
302
+ ```
303
+
304
+ Typically this error disappears after HomePod restart.
305
+
306
+ ### 3. Streaming to stereo pair
307
+
308
+ Looks like this is not supported at the moment by pyatv
309
+
310
+ ### 4. Speaker accessory controls
311
+
312
+ With iOS 15 Homekit does not support `volume control` and `start/stop` for speaker accessory (at least for speakers exposed by Homebridge). So I'd suggest to enable switch accessory for each radio.
package/bin/dummy.mp3 ADDED
Binary file
Binary file
Binary file
@@ -0,0 +1,7 @@
1
+ # My playlist
2
+
3
+ # 3 second sample - filename with leading space
4
+ sample-3s.mp3
5
+
6
+ # 9 second sample
7
+ sample-9s.mp3