diff --git a/atom.xml b/atom.xml index 125b69bf36..c97f99fd05 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@
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