You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+51-1Lines changed: 51 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,7 +71,53 @@ media_player:
71
71
72
72
### Services
73
73
74
-
#### Service media\_player.play\_media
74
+
#### Service mopidy.get_search_result
75
+
76
+
*This service was originally developed by [Daniele Ricci](https://github.com/daniele-athome)*
77
+
78
+
Search media based on keywords and return them for use in a script or automation.
79
+
80
+
**Note:** One of the keyword fields **must** be used: `keyword`, `keyword_album`, `keyword_artist`, `keyword_genre` or `keyword_track_name`
81
+
82
+
|Service data attribute|Optional|Description|Example|
83
+
|-|-|-|-|
84
+
|`entity_id`|no|String or list of `entity_id`s to search and return the result to.| |
85
+
|`exact`|yes|String. Should the search be an exact match|false|
86
+
|`keyword`|yes|String. The keywords to search for. Will search all track fields.|Everlong|
87
+
|`keyword_album`|yes|String. The keywords to search for in album titles.|From Mars to Sirius|
88
+
|`keyword_artist`|yes|String. The keywords to search for in artists.|Queens of the Stoneage|
89
+
|`keyword_genre`|yes|String. The keywords to search for in genres.|rock|
90
+
|`keyword_track_name`|yes|String. The keywords to search for in track names.|Lazarus|
91
+
|`source`|yes|String. URI sources to search. `local`, `spotify` and `tunein` are the only supported options. Make sure to have these extensions enabled on your Mopidy Server! Separate multiple sources with a comma (,).|local,spotify|
92
+
93
+
##### Example
94
+
95
+
```yaml
96
+
script:
97
+
search_and_play_music:
98
+
fields:
99
+
[...]
100
+
sequence:
101
+
- service: mopidy.get_search_result
102
+
data:
103
+
keyword_artist: "{{ keyword_artist }}"
104
+
keyword_track_name: "{{ keyword_track_name }}"
105
+
source: local
106
+
target:
107
+
entity_id: "{{ target }}"
108
+
response_variable: music_tracks # service returns something and result will be put into this variable
0 commit comments