From e4fff883f9c3176152714e6c6c24c9eeaceee3b4 Mon Sep 17 00:00:00 2001 From: bbrendon Date: Sun, 12 Feb 2017 05:14:09 -0800 Subject: [PATCH] add automation code. (#2015) the example makes it seem like the magic happens without an automation --- source/_components/shell_command.markdown | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/_components/shell_command.markdown b/source/_components/shell_command.markdown index dc6f83b304e..babb6d11a27 100644 --- a/source/_components/shell_command.markdown +++ b/source/_components/shell_command.markdown @@ -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 %} ```