Skip to content

Commit 6a1c90b

Browse files
janLoMartinHjelmare
authored andcommitted
input_select: documentation for services and scene (home-assistant#1546)
This adds documentation on how to use the input_select component services and how to use it in a scene. This is related to bug home-assistant/core#4673 Signed-off-by: Jan Losinski <losinski@wh2.tu-dresden.de>
1 parent c7abf99 commit 6a1c90b

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

source/_components/input_select.markdown

+36
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,39 @@ Configuration variables:
4343
4444
Pick an icon that you can find on [materialdesignicons.com](https://materialdesignicons.com/) to use for your input and prefix the name with `mdi:`. For example `mdi:car`, `mdi:ambulance`, or `mdi:motorbike`.
4545

46+
### {% linkable_title Services %}
47+
48+
This components provide three services to modify the state of the `input_select`:
49+
50+
- `input_select.select_option`: This can be used to select a specific option. The option is passed as `option` attribute in the service data.
51+
- `input_select.select_previous`: Select the previous option.
52+
- `input_select.select_next`: Select the next option.
53+
54+
The following example shows the usage of the `input_select.select_option` service in an automation:
55+
56+
```yaml
57+
# Example configuration.yaml entry
58+
automation:
59+
- alias: example automation
60+
trigger:
61+
platform: event
62+
event_type: MY_CUSTOM_EVENT
63+
action:
64+
- service: input_select.select_option
65+
data:
66+
entity_id: input_select.who_cooks
67+
option: Paulus
68+
```
69+
70+
### {% linkable_title Scenes %}
71+
72+
To specify a target option in a [Scene](/components/scene/) you have to specify the target as `option` attribute:
73+
74+
```yaml
75+
# Example configuration.yaml entry
76+
scene:
77+
- name: Example1
78+
entities:
79+
input_select.who_cooks:
80+
option: Paulus
81+
```

0 commit comments

Comments
 (0)