mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-18 23:06:58 +00:00
add automation code. (#2015)
the example makes it seem like the magic happens without an automation
This commit is contained in:
parent
5653c3081b
commit
e4fff883f9
@ -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.
|
||||
|
||||
```yaml
|
||||
|
||||
# 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:
|
||||
ac_temperature:
|
||||
name: A/C Setting
|
||||
@ -41,8 +50,9 @@ input_slider:
|
||||
min: 18
|
||||
max: 32
|
||||
step: 1
|
||||
|
||||
{% raw %}
|
||||
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'
|
||||
{% endraw %}
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user