add automation code. (#2015)

the example makes it seem like the magic happens without an automation
This commit is contained in:
bbrendon 2017-02-12 05:14:09 -08:00 committed by Fabian Affolter
parent 5653c3081b
commit e4fff883f9

View File

@ -33,7 +33,16 @@ The commands can be dynamic, using templates to insert values of other entities.
Any service data passed into the service call to activate the shell command will be available as a variable within the template. Any service data passed into the service call to activate the shell command will be available as a variable within the template.
```yaml ```yaml
# Apply value of a GUI slider to the shell_command # Apply value of a GUI slider to the shell_command
automation:
- alias: run_set_ac
trigger:
platform: state
entity_id: input_slider.ac_temperature
action:
service: shell_command.set_ac_to_slider
input_slider: input_slider:
ac_temperature: ac_temperature:
name: A/C Setting name: A/C Setting
@ -41,6 +50,7 @@ input_slider:
min: 18 min: 18
max: 32 max: 32
step: 1 step: 1
{% raw %} {% raw %}
shell_command: shell_command:
set_ac_to_slider: 'irsend SEND_ONCE DELONGHI AC_{{ states.input_slider.ac_temperature.state }}_AUTO' set_ac_to_slider: 'irsend SEND_ONCE DELONGHI AC_{{ states.input_slider.ac_temperature.state }}_AUTO'