diff --git a/atom.xml b/atom.xml index a88f62ae42..b51ccc493b 100644 --- a/atom.xml +++ b/atom.xml @@ -4,7 +4,7 @@
Automation Examples
Here’s an example of input_number
being used as a trigger in an automation.
-
-# Example configuration.yaml entry using 'input_number' as a trigger in an automation
-
-# Define input_number
+# Example configuration.yaml entry using 'input_number' as a trigger in an automation
input_number:
bedroom_brightness:
name: Brightness
@@ -124,8 +121,6 @@ Before version 0.55 this component was known as
min: 0
max: 254
step: 1
-
-# Automation.
automation:
- alias: Bedroom Light - Adjust Brightness
trigger:
@@ -133,7 +128,7 @@ Before version 0.55 this component was known as
entity_id: input_number.bedroom_brightness
action:
- service: light.turn_on
-# Note the use of 'data_template:' below rather than the normal 'data:' if you weren't using an input variable
+ # Note the use of 'data_template:' below rather than the normal 'data:' if you weren't using an input variable
data_template:
entity_id: light.bedroom
brightness: '{{ trigger.to_state.state | int }}'
@@ -141,10 +136,7 @@ Before version 0.55 this component was known as
Another code example using input_number
, this time being used in an action in an automation.
-
-# Example configuration.yaml entry using 'input_number' in an action in an automation
-
-# Define 'input_select'
+# Example configuration.yaml entry using 'input_number' in an action in an automation
input_select:
scene_bedroom:
name: Scene
@@ -156,8 +148,6 @@ Before version 0.55 this component was known as
- Relax
- 'OFF'
initial: 'Select'
-
-# Define input_number
input_number:
bedroom_brightness:
name: Brightness
@@ -165,8 +155,6 @@ Before version 0.55 this component was known as
min: 0
max: 254
step: 1
-
-# Automation.
automation:
- alias: Bedroom Light - Custom
trigger:
@@ -175,18 +163,14 @@ Before version 0.55 this component was known as
to: CUSTOM
action:
- service: light.turn_on
-# Again, note the use of 'data_template:' rather than the normal 'data:' if you weren't using an input variable.
+ # Again, note the use of 'data_template:' rather than the normal 'data:' if you weren't using an input variable.
data_template:
entity_id: light.bedroom
brightness: '{{ states.input_number.bedroom_brightness.state | int }}'
-
Example of input_number
being used in a bidirectional manner, both being set by and controlled by an MQTT action in an automation.
-
-# Example configuration.yaml entry using 'input_number' in an action in an automation
-
-# Define input_number
+# Example configuration.yaml entry using 'input_number' in an action in an automation
input_number:
target_temp:
name: Target Heater Temperature Slider
@@ -195,33 +179,30 @@ Before version 0.55 this component was known as
step: 1
unit_of_measurement: step
icon: mdi:target
-
-# Automation.
# This automation script runs when a value is received via MQTT on retained topic: setTemperature
# It sets the value slider on the GUI. This slides also had its own automation when the value is changed.
-- alias: Set temp slider
- trigger:
- platform: mqtt
- topic: "setTemperature"
- action:
- service: input_number.set_value
- data_template:
- entity_id: input_number.target_temp
- value: '{{ trigger.payload}}'
-
- # This automation script runs when the target temperature slider is moved.
- # It publishes its value to the same MQTT topic it is also subscribed to.
-- alias: Temp slider moved
- trigger:
- platform: state
- entity_id: input_number.target_temp
- action:
- service: mqtt.publish
- data_template:
+automation:
+ - alias: Set temp slider
+ trigger:
+ platform: mqtt
topic: "setTemperature"
- retain: true
- payload: '{{ states.input_number.target_temp.state | int }}'
-
+ action:
+ service: input_number.set_value
+ data_template:
+ entity_id: input_number.target_temp
+ value: '{{ trigger.payload}}'
+# This automation script runs when the target temperature slider is moved.
+# It publishes its value to the same MQTT topic it is also subscribed to.
+ - alias: Temp slider moved
+ trigger:
+ platform: state
+ entity_id: input_number.target_temp
+ action:
+ service: mqtt.publish
+ data_template:
+ topic: "setTemperature"
+ retain: true
+ payload: '{{ states.input_number.target_temp.state | int }}'
diff --git a/sitemap.xml b/sitemap.xml
index f0f2bd90f0..be430e164f 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -3746,7 +3746,7 @@
https://home-assistant.io/components/switch.hook/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/cookbook/automation_for_rainy_days/
@@ -4418,99 +4418,99 @@
https://home-assistant.io/docs/autostart/init.d/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/api/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/configuration/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/example_apps/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/installation/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/operation/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/reboot/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/running/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/tutorial/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/updating/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/appdaemon/windows/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/certificates/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/hadashboard/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/hass-configurator/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/ios/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/nginx/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/notebooks/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/scenegen/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/ecosystem/synology/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/tools/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/tools/dev-tools/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/tools/hass/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/docs/tools/scripts/
-2017-12-03T14:26:23+00:00
+2017-12-03T15:14:56+00:00
https://home-assistant.io/faq/after-upgrading/
@@ -5634,62 +5634,62 @@
https://home-assistant.io/demo/frontend.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/demo/index.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-event.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-info.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-service.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-state.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/demo/panels/ha-panel-dev-template.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/demo/panels/ha-panel-history.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/demo/panels/ha-panel-iframe.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/demo/panels/ha-panel-logbook.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/demo/panels/ha-panel-map.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/googlef4f3693c209fe788.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/static/fonts/roboto/DESCRIPTION.en_us.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/static/fonts/robotomono/DESCRIPTION.en_us.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00
https://home-assistant.io/static/mdi-demo.html
-2017-12-03T14:25:38+00:00
+2017-12-03T15:14:07+00:00