diff --git a/atom.xml b/atom.xml index 125b69bf36..c97f99fd05 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/community/atom.xml b/blog/categories/community/atom.xml index 068b8a58ef..8f01e8cb2c 100644 --- a/blog/categories/community/atom.xml +++ b/blog/categories/community/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Community | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/device-tracking/atom.xml b/blog/categories/device-tracking/atom.xml index 1ed2442a43..847e46abf7 100644 --- a/blog/categories/device-tracking/atom.xml +++ b/blog/categories/device-tracking/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Device-Tracking | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/esp8266/atom.xml b/blog/categories/esp8266/atom.xml index 1579eb7b60..5fe29de8e9 100644 --- a/blog/categories/esp8266/atom.xml +++ b/blog/categories/esp8266/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: ESP8266 | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/how-to/atom.xml b/blog/categories/how-to/atom.xml index eea3126e07..3dcd97397c 100644 --- a/blog/categories/how-to/atom.xml +++ b/blog/categories/how-to/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: How-To | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/ibeacons/atom.xml b/blog/categories/ibeacons/atom.xml index c443b1ed60..9965879393 100644 --- a/blog/categories/ibeacons/atom.xml +++ b/blog/categories/ibeacons/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: iBeacons | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/internet-of-things/atom.xml b/blog/categories/internet-of-things/atom.xml index 010fcbc3b6..d279f3540c 100644 --- a/blog/categories/internet-of-things/atom.xml +++ b/blog/categories/internet-of-things/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Internet-of-Things | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/iot-data/atom.xml b/blog/categories/iot-data/atom.xml index ad5923312c..47c7ab1924 100644 --- a/blog/categories/iot-data/atom.xml +++ b/blog/categories/iot-data/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: IoT-Data | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/micropython/atom.xml b/blog/categories/micropython/atom.xml index 1de773da0b..b966ca5e07 100644 --- a/blog/categories/micropython/atom.xml +++ b/blog/categories/micropython/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Micropython | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/mqtt/atom.xml b/blog/categories/mqtt/atom.xml index 48fabf775c..302567a9b1 100644 --- a/blog/categories/mqtt/atom.xml +++ b/blog/categories/mqtt/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: MQTT | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/organisation/atom.xml b/blog/categories/organisation/atom.xml index b1e364f9d5..1ead523712 100644 --- a/blog/categories/organisation/atom.xml +++ b/blog/categories/organisation/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Organisation | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/owntracks/atom.xml b/blog/categories/owntracks/atom.xml index b9c71f9fc6..28d8f6ea42 100644 --- a/blog/categories/owntracks/atom.xml +++ b/blog/categories/owntracks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: OwnTracks | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/presence-detection/atom.xml b/blog/categories/presence-detection/atom.xml index f17516259e..6565d5d964 100644 --- a/blog/categories/presence-detection/atom.xml +++ b/blog/categories/presence-detection/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Presence-Detection | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/public-service-announcement/atom.xml b/blog/categories/public-service-announcement/atom.xml index 8c41cee010..cd1a60f881 100644 --- a/blog/categories/public-service-announcement/atom.xml +++ b/blog/categories/public-service-announcement/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Public-Service-Announcement | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/release-notes/atom.xml b/blog/categories/release-notes/atom.xml index d9007fce89..cc5d9fb52f 100644 --- a/blog/categories/release-notes/atom.xml +++ b/blog/categories/release-notes/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Release-Notes | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/survey/atom.xml b/blog/categories/survey/atom.xml index 36724ef763..070ef9fd64 100644 --- a/blog/categories/survey/atom.xml +++ b/blog/categories/survey/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Survey | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/talks/atom.xml b/blog/categories/talks/atom.xml index 6941561e29..9557114097 100644 --- a/blog/categories/talks/atom.xml +++ b/blog/categories/talks/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Talks | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/technology/atom.xml b/blog/categories/technology/atom.xml index 33cfb5fbb9..2d5c97395b 100644 --- a/blog/categories/technology/atom.xml +++ b/blog/categories/technology/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Technology | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/user-stories/atom.xml b/blog/categories/user-stories/atom.xml index 8be54a88de..3384a6b2d5 100644 --- a/blog/categories/user-stories/atom.xml +++ b/blog/categories/user-stories/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: User-Stories | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/video/atom.xml b/blog/categories/video/atom.xml index db0d78f664..ecf8b5703e 100644 --- a/blog/categories/video/atom.xml +++ b/blog/categories/video/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Video | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/blog/categories/website/atom.xml b/blog/categories/website/atom.xml index 0b0a081b15..bf1d27ebec 100644 --- a/blog/categories/website/atom.xml +++ b/blog/categories/website/atom.xml @@ -4,7 +4,7 @@ <![CDATA[Category: Website | Home Assistant]]> - 2016-10-05T22:10:48+00:00 + 2016-10-06T04:58:12+00:00 https://home-assistant.io/ diff --git a/components/script/index.html b/components/script/index.html index 1f1f03addb..db55e3871e 100644 --- a/components/script/index.html +++ b/components/script/index.html @@ -128,23 +128,60 @@ -

Passing parameters in service calls

+

Passing variables to scripts

-

As part of the service, parameters can be passed in that will be made available to the script as variables within templates.

+

As part of the service, variables can be passed along to a script so they become available within templates in that script.

-

There are two ways to activate scripts. One is using the generic script.turn_on service. To pass variables to the script with this service, call it using the following parameters:

+

There are two ways to achieve this. One way is using the generic script.turn_on service. To pass variables to the script with this service, call it with the desired variables:

-
{
-  "entity_id": "script.wakeup",
-  "variables": {
-    "hello": "world",
-    "name": "Paulus"
-  }
-}
+
# Example configuration.yaml entry
+automation:
+  trigger:
+    platform: state
+    entity_id: light.bedroom
+    from: 'off'
+    to: 'on'
+  action:
+    service: script.turn_on
+    entity_id: script.notify_pushover
+    data:
+      variables:
+        title: 'State change'
+        message: 'The light is on!'
 
-

If you are calling the script service directly, for example script.wakeup. All service data will be made available as variables.

+

The other way is calling the script as a service directly. In this case, all service data will be made available as variables. If we apply this approach on the script above, it would look like this:

+ +
# Example configuration.yaml entry
+automation:
+  trigger:
+    platform: state
+    entity_id: light.bedroom
+    from: 'off'
+    to: 'on'
+  action:
+    service: script.notify_pushover
+    data:
+      title: 'State change'
+      message: 'The light is on!'
+
+
+ +

Using the variables in the script requires the use of data_template:

+
# Example configuration.yaml entry
+script:
+  notify_pushover:
+    sequence:
+      - condition: state
+        entity_id: switch.pushover_notifications
+        state: 'on'
+      - service: notify.pushover
+        data_template:
+          title: ""
+          message: ""
+
+
diff --git a/sitemap.xml b/sitemap.xml index 428593000c..7930194873 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2113,62 +2113,62 @@ https://home-assistant.io/demo/frontend.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/demo/index.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/demo/panels/ha-panel-dev-event.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/demo/panels/ha-panel-dev-info.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/demo/panels/ha-panel-dev-service.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/demo/panels/ha-panel-dev-state.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/demo/panels/ha-panel-dev-template.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/demo/panels/ha-panel-history.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/demo/panels/ha-panel-iframe.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/demo/panels/ha-panel-logbook.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/demo/panels/ha-panel-map.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/googlef4f3693c209fe788.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/static/fonts/roboto/DESCRIPTION.en_us.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/static/fonts/robotomono/DESCRIPTION.en_us.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00 https://home-assistant.io/static/mdi-demo.html -2016-10-05T22:10:06+00:00 +2016-10-06T04:57:26+00:00