home-assistant.io/source/_components/shell_command.markdown
Paulus Schoutsen 1f40fdb09d 0.22 (#570)
* Initial snmp sensor docs (#538)

* Fixed markdown and added logo (#551)

* Added documentation for router operating mode for asuswrt (#545)

* local_file camera component documenatation (#554)

* Documenation for local_file camera component

* Update camera.local_file.markdown

* Added information about voltage sensor

* Instructions for Pandora media player (#552)

* Add release

* Add pub_key

* Add BT Home Hub docs

* Markdown tweaks (#553)

* Add docs about MySensors IR switch (#556)

* Update sensor.mysensors docs, about moving V_IR_SEND type to switch
  platform.
* Update switch.mysensors docs. Add section about the new service and
  additional example sketch for the IR switch device.

* Update index.html

* plex sensor (#526)

* Add var descriptions

* Adds documentation for the Local File Camera (#482)

* Revert "Adds documentation for the Local File Camera" (#563)

* Minor changes

* Add Wink Rollershutter (#559)

* Added example of using template in shell_command. (#547)

* Add Documentation for Netatmo Welcome (#542)

* Reorganize  documentation for Netatmo

As Netatmo is now a Hub component, documentations has been splitted in several
parts betweent the hub, the sensors and the camera

Signed-off-by: Hugo D. (jabesq) <jabesq@gmail.com>

* Add configuration variables for Netatmo Welcome cameras

* Add ha_release information on new documentation pages

* Netatmo Weather Station is a weather sensor

* Add blog post 0.22
2016-06-18 13:24:52 -07:00

1.3 KiB

layout, title, description, date, sidebar, comments, sharing, footer, ha_category
layout title description date sidebar comments sharing footer ha_category
page Shell command Instructions how to integrate Shell commands into Home Assistant. 2015-10-13 19:10 true false true true Automation

This component can expose regular shell commands as services. Services can be called from a script or in automation.

# Example configuration.yaml entry
# Exposes service shell_command.restart_pow
shell_command:
  restart_pow: touch ~/.pow/restart.txt

Configuration variables:

  • Alias for the command
  • Command itself.

The commands can be dynamic, using templates to insert values of other entities. When using templates you are limited to only template the arguments. You are also no longer allowed to use pipe symbols when using templates.

Any service data passed into the service call to activate the shell command will be available as a variable within the template.

# Apply value of a GUI slider to the shell_command
input_slider:
  ac_temperature:
    name: A/C Setting
    initial: 24
    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'
{% endraw %}