Site updated at 2016-08-18 05:46:19 UTC

This commit is contained in:
Travis CI 2016-08-18 05:46:19 +00:00
parent 3bbb5789ea
commit 8b6fc06412
22 changed files with 105 additions and 35 deletions

View file

@ -115,6 +115,76 @@
<li><strong>step</strong> (<em>Optional</em>): Step value for the slider.</li>
</ul>
<h1>Automation Examples</h1>
<p>Heres an example of <code>input_slider</code> being used as a trigger in an automation.</p>
<pre><code># Example configuration.yaml entry using 'input_slider' as a trigger in an automation
# Define input_slider
input_slider:
bedroom_brightness:
name: Brightness
initial: 254
min: 0
max: 254
step: 1
# Automation.
automation:
- alias: Bedroom Light - Adjust Brightness
trigger:
platform: state
entity_id: input_slider.bedroom_brightness
action:
- service: light.turn_on
# Note the use of 'data_template:' below rather than the normal 'data:' if you weren't using an input variable
data_template:
entity_id: light.bedroom
brightness: '{{ trigger.to_state.state | int }}'
</code></pre>
<p>Another code example using <code>input_slider</code>, this time being used in an action in an automation.</p>
<pre><code># Example configuration.yaml entry using 'input_slider' in an action in an automation
# Define 'input_select'
input_select:
scene_bedroom:
name: Scene
options:
- Select
- Concentrate
- Energize
- Reading
- Relax
- 'OFF'
initial: 'Select'
# Define input_slider
input_slider:
bedroom_brightness:
name: Brightness
initial: 254
min: 0
max: 254
step: 1
# Automation.
automation:
- alias: Bedroom Light - Custom
trigger:
platform: state
entity_id: input_select.scene_bedroom
to: CUSTOM
action:
- service: light.turn_on
# Again, note the use of 'data_template:' rather than the normal 'data:' if you weren't using an input variable.
data_template:
entity_id: light.bedroom
brightness: '{{ states.input_slider.bedroom_brightness.state | int }}'
</code></pre>
</article>