Skip to content

Commit f95706a

Browse files
committed
Document active player helper
1 parent 4b59d81 commit f95706a

1 file changed

Lines changed: 81 additions & 0 deletions

File tree

README.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# HOMEii Flow
22

3+
<p align="center">
4+
<img src="https://raw.githubusercontent.com/r11a/homeii-music-flow/main/HOMEii%20Flow%20Main.png" alt="HOMEii Flow main experience" width="100%">
5+
</p>
6+
37
<p align="center">
48
<img src="https://raw.githubusercontent.com/r11a/homeii-music-flow/main/docs/brand/homeii-flow-logo.svg" alt="HOMEii Flow logo" width="280">
59
</p>
@@ -189,6 +193,83 @@ If the card loads but feels incomplete, check these first:
189193
- If no players are shown, check Music Assistant player exposure and remove overly strict pinned-player filters from the card settings.
190194
- Optional automation helper: create an `input_text`, then set `active_player_helper_entity` so automations can read the current HOMEii Flow target.
191195

196+
## Active Player Helper
197+
198+
HOMEii Flow can optionally publish the currently selected/active player to a Home Assistant helper. This is useful when you want automations, scripts, templates, dashboard buttons, or voice flows to know which player HOMEii Flow is currently controlling.
199+
200+
The card does not create a Home Assistant entity by itself. Create an `input_text` helper once, then point HOMEii Flow to it. The card will keep that helper updated with the active player `entity_id`.
201+
202+
### Setup
203+
204+
1. In Home Assistant, open **Settings > Devices & services > Helpers**.
205+
2. Select **Create Helper**.
206+
3. Choose **Text**.
207+
4. Name it, for example: `HOMEii Flow Active Player`.
208+
5. Copy the created entity id, for example:
209+
210+
```yaml
211+
input_text.homeii_flow_active_player
212+
```
213+
214+
6. Add it to the HOMEii Flow card configuration:
215+
216+
```yaml
217+
type: custom:homeii-music-flow
218+
active_player_helper_entity: input_text.homeii_flow_active_player
219+
```
220+
221+
You can also select the helper from the visual card editor in the connection/settings section.
222+
223+
### What The Helper Stores
224+
225+
When HOMEii Flow is controlling the living room player, the helper value becomes:
226+
227+
```text
228+
media_player.living_room
229+
```
230+
231+
When you switch HOMEii Flow to another player, the helper updates automatically:
232+
233+
```text
234+
media_player.kitchen
235+
```
236+
237+
### Example: Play/Pause The Current HOMEii Flow Player
238+
239+
```yaml
240+
alias: HOMEii Flow - Toggle active player
241+
sequence:
242+
- service: media_player.media_play_pause
243+
target:
244+
entity_id: "{{ states('input_text.homeii_flow_active_player') }}"
245+
```
246+
247+
### Example: Set Volume On The Current HOMEii Flow Player
248+
249+
```yaml
250+
alias: HOMEii Flow - Set active player volume
251+
sequence:
252+
- service: media_player.volume_set
253+
target:
254+
entity_id: "{{ states('input_text.homeii_flow_active_player') }}"
255+
data:
256+
volume_level: 0.35
257+
```
258+
259+
### Example: Use It In A Template
260+
261+
```yaml
262+
{{ state_attr(states('input_text.homeii_flow_active_player'), 'friendly_name') }}
263+
```
264+
265+
### Example: Only Run If HOMEii Flow Has A Player
266+
267+
```yaml
268+
condition:
269+
- condition: template
270+
value_template: "{{ states('input_text.homeii_flow_active_player') | regex_match('^media_player\\.') }}"
271+
```
272+
192273
## Sendspin Browser Player
193274

194275
HOMEii Flow includes a local browser player flow powered by Sendspin. In the card this appears as **This device**.

0 commit comments

Comments
 (0)