mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-24 01:37:23 +00:00
Adjust automation to plural triggers/conditions/actions keys (#34825)
This commit is contained in:
parent
e090d64fa3
commit
96e00f69a0
@ -14,10 +14,10 @@ You can also perform the action to activate [a scene](/integrations/scene/) whic
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
# Change the light in the kitchen and living room to 150 brightness and color red.
|
# Change the light in the kitchen and living room to 150 brightness and color red.
|
||||||
trigger:
|
triggers:
|
||||||
- platform: sun
|
- platform: sun
|
||||||
event: sunset
|
event: sunset
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
@ -29,13 +29,13 @@ automation:
|
|||||||
|
|
||||||
automation 2:
|
automation 2:
|
||||||
# Notify me on my mobile phone of an event
|
# Notify me on my mobile phone of an event
|
||||||
trigger:
|
triggers:
|
||||||
- platform: sun
|
- platform: sun
|
||||||
event: sunset
|
event: sunset
|
||||||
offset: -00:30
|
offset: -00:30
|
||||||
variables:
|
variables:
|
||||||
notification_action: notify.paulus_iphone
|
notification_action: notify.paulus_iphone
|
||||||
action:
|
actions:
|
||||||
# Actions are scripts so can also be a list of actions
|
# Actions are scripts so can also be a list of actions
|
||||||
- action: "{{ notification_action }}"
|
- action: "{{ notification_action }}"
|
||||||
data:
|
data:
|
||||||
@ -53,11 +53,11 @@ Conditions can also be part of an action. You can combine multiple actions and c
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Office at evening"
|
- alias: "Office at evening"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.office_occupancy
|
entity_id: sensor.office_occupancy
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify
|
- action: notify.notify
|
||||||
data:
|
data:
|
||||||
message: "Testing conditional actions"
|
message: "Testing conditional actions"
|
||||||
|
@ -16,11 +16,11 @@ Example of using condition:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Turn on office lights"
|
- alias: "Turn on office lights"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.office_motion_sensor
|
entity_id: sensor.office_motion_sensor
|
||||||
to: "on"
|
to: "on"
|
||||||
condition:
|
conditions:
|
||||||
- or:
|
- or:
|
||||||
- condition: numeric_state
|
- condition: numeric_state
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
@ -29,7 +29,7 @@ automation:
|
|||||||
- condition: numeric_state
|
- condition: numeric_state
|
||||||
entity_id: sensor.office_lux_sensor
|
entity_id: sensor.office_lux_sensor
|
||||||
below: 10
|
below: 10
|
||||||
action:
|
actions:
|
||||||
- action: scene.turn_on
|
- action: scene.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: scene.office_lights
|
entity_id: scene.office_lights
|
||||||
@ -44,12 +44,12 @@ The `condition` option of an automation, also accepts a single condition templat
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Turn on office lights"
|
- alias: "Turn on office lights"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.office_motion_sensor
|
entity_id: sensor.office_motion_sensor
|
||||||
to: "on"
|
to: "on"
|
||||||
condition: "{{ state_attr('sun.sun', 'elevation') < 4 }}"
|
condition: "{{ state_attr('sun.sun', 'elevation') < 4 }}"
|
||||||
action:
|
actions:
|
||||||
- action: scene.turn_on
|
- action: scene.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: scene.office_lights
|
entity_id: scene.office_lights
|
||||||
|
@ -31,9 +31,9 @@ Some automations you only want to run every 5 minutes. This can be achieved usin
|
|||||||
automation:
|
automation:
|
||||||
- mode: single
|
- mode: single
|
||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
trigger:
|
triggers:
|
||||||
- ...
|
- ...
|
||||||
action:
|
actions:
|
||||||
- ...
|
- ...
|
||||||
- delay: 300 # seconds (=5 minutes)
|
- delay: 300 # seconds (=5 minutes)
|
||||||
```
|
```
|
||||||
@ -46,8 +46,8 @@ Sometimes an automation is doing an action on a device that does not support mul
|
|||||||
automation:
|
automation:
|
||||||
- mode: queued
|
- mode: queued
|
||||||
max: 25
|
max: 25
|
||||||
trigger:
|
triggers:
|
||||||
- ...
|
- ...
|
||||||
action:
|
actions:
|
||||||
- ...
|
- ...
|
||||||
```
|
```
|
||||||
|
@ -201,11 +201,11 @@ These are the properties available for a [Zone trigger](/docs/automation/trigger
|
|||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml entries
|
# Example configuration.yaml entries
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: device_tracker.paulus
|
entity_id: device_tracker.paulus
|
||||||
id: paulus_device
|
id: paulus_device
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify
|
- action: notify.notify
|
||||||
data:
|
data:
|
||||||
message: >
|
message: >
|
||||||
@ -215,17 +215,17 @@ automation:
|
|||||||
This was triggered by {{ trigger.id }}
|
This was triggered by {{ trigger.id }}
|
||||||
|
|
||||||
automation 2:
|
automation 2:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
topic: "/notify/+"
|
topic: "/notify/+"
|
||||||
action:
|
actions:
|
||||||
action: >
|
action: >
|
||||||
notify.{{ trigger.topic.split('/')[-1] }}
|
notify.{{ trigger.topic.split('/')[-1] }}
|
||||||
data:
|
data:
|
||||||
message: "{{ trigger.payload }}"
|
message: "{{ trigger.payload }}"
|
||||||
|
|
||||||
automation 3:
|
automation 3:
|
||||||
trigger:
|
triggers:
|
||||||
# Multiple entities for which you want to perform the same action.
|
# Multiple entities for which you want to perform the same action.
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id:
|
entity_id:
|
||||||
@ -235,14 +235,14 @@ automation 3:
|
|||||||
to: "on"
|
to: "on"
|
||||||
# Trigger when someone leaves one of those lights on for 10 minutes.
|
# Trigger when someone leaves one of those lights on for 10 minutes.
|
||||||
for: "00:10:00"
|
for: "00:10:00"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_off
|
- action: light.turn_off
|
||||||
target:
|
target:
|
||||||
# Turn off whichever entity triggered the automation.
|
# Turn off whichever entity triggered the automation.
|
||||||
entity_id: "{{ trigger.entity_id }}"
|
entity_id: "{{ trigger.entity_id }}"
|
||||||
|
|
||||||
automation 4:
|
automation 4:
|
||||||
trigger:
|
triggers:
|
||||||
# When an NFC tag is scanned by Home Assistant...
|
# When an NFC tag is scanned by Home Assistant...
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: tag_scanned
|
event_type: tag_scanned
|
||||||
@ -251,11 +251,11 @@ automation 4:
|
|||||||
user_id:
|
user_id:
|
||||||
- 06cbf6deafc54cf0b2ffa49552a396ba
|
- 06cbf6deafc54cf0b2ffa49552a396ba
|
||||||
- 2df8a2a6e0be4d5d962aad2d39ed4c9c
|
- 2df8a2a6e0be4d5d962aad2d39ed4c9c
|
||||||
condition:
|
conditions:
|
||||||
# Check NFC tag (ID) is the one by the front door
|
# Check NFC tag (ID) is the one by the front door
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ trigger.event.data.tag_id == '8b6d6755-b4d5-4c23-818b-cf224d221ab7'}}"
|
value_template: "{{ trigger.event.data.tag_id == '8b6d6755-b4d5-4c23-818b-cf224d221ab7'}}"
|
||||||
action:
|
actions:
|
||||||
# Turn off various lights
|
# Turn off various lights
|
||||||
- action: light.turn_off
|
- action: light.turn_off
|
||||||
target:
|
target:
|
||||||
|
@ -46,7 +46,7 @@ This video tutorial explains how trigger IDs work.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: "MY_CUSTOM_EVENT"
|
event_type: "MY_CUSTOM_EVENT"
|
||||||
id: "custom_event"
|
id: "custom_event"
|
||||||
@ -74,7 +74,7 @@ The second variant is setting variables that are available when attaching a trig
|
|||||||
automation:
|
automation:
|
||||||
trigger_variables:
|
trigger_variables:
|
||||||
my_event: example_event
|
my_event: example_event
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
# Able to use `trigger_variables`
|
# Able to use `trigger_variables`
|
||||||
event_type: "{{ my_event }}"
|
event_type: "{{ my_event }}"
|
||||||
@ -93,7 +93,7 @@ Events can be fired by integrations or via the API. There is no limitation to th
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: "MY_CUSTOM_EVENT"
|
event_type: "MY_CUSTOM_EVENT"
|
||||||
# optional
|
# optional
|
||||||
@ -111,7 +111,7 @@ event that contain no, or similar, data and contexts.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type:
|
event_type:
|
||||||
- automation_reloaded
|
- automation_reloaded
|
||||||
@ -132,7 +132,7 @@ automation:
|
|||||||
sub_event: ABC
|
sub_event: ABC
|
||||||
node: ac
|
node: ac
|
||||||
value: on
|
value: on
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: "{{ 'MY_CUSTOM_EVENT_' ~ sub_event }}"
|
event_type: "{{ 'MY_CUSTOM_EVENT_' ~ sub_event }}"
|
||||||
```
|
```
|
||||||
@ -145,7 +145,7 @@ Fires when Home Assistant starts up or shuts down.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
# Event can also be 'shutdown'
|
# Event can also be 'shutdown'
|
||||||
event: start
|
event: start
|
||||||
@ -161,7 +161,7 @@ Fires when a specific message is received on given MQTT topic. Optionally can ma
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
topic: "living_room/switch/ac"
|
topic: "living_room/switch/ac"
|
||||||
# Optional
|
# Optional
|
||||||
@ -176,7 +176,7 @@ The trigger in the example below will trigger only when the message received on
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
topic: "living_room/switch/ac"
|
topic: "living_room/switch/ac"
|
||||||
payload: "on"
|
payload: "on"
|
||||||
@ -199,7 +199,7 @@ automation:
|
|||||||
room: "living_room"
|
room: "living_room"
|
||||||
node: "ac"
|
node: "ac"
|
||||||
value: "on"
|
value: "on"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: mqtt
|
- platform: mqtt
|
||||||
topic: "{{ room ~ '/switch/' ~ node}}"
|
topic: "{{ room ~ '/switch/' ~ node}}"
|
||||||
# Optional
|
# Optional
|
||||||
@ -222,7 +222,7 @@ If the current state of your entity is `50` and you set the threshold to `below:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: sensor.temperature
|
entity_id: sensor.temperature
|
||||||
# If given, will trigger when the value of the given attribute for the given entity changes..
|
# If given, will trigger when the value of the given attribute for the given entity changes..
|
||||||
@ -247,7 +247,7 @@ When the `attribute` option is specified the trigger is compared to the given `a
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: climate.kitchen
|
entity_id: climate.kitchen
|
||||||
attribute: current_temperature
|
attribute: current_temperature
|
||||||
@ -264,7 +264,7 @@ The state of the entity can be referenced like this:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: sensor.temperature
|
entity_id: sensor.temperature
|
||||||
value_template: "{{ state.state | float * 9 / 5 + 32 }}"
|
value_template: "{{ state.state | float * 9 / 5 + 32 }}"
|
||||||
@ -279,7 +279,7 @@ Attributes of the entity can be referenced like this:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: climate.kitchen
|
entity_id: climate.kitchen
|
||||||
value_template: "{{ state.attributes.current_temperature - state.attributes.temperature_set_point }}"
|
value_template: "{{ state.attributes.current_temperature - state.attributes.temperature_set_point }}"
|
||||||
@ -299,7 +299,7 @@ However, the comparison will only be made when the entity specified in the trigg
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: sensor.outside_temperature
|
entity_id: sensor.outside_temperature
|
||||||
# Other entity ids can be specified for above and/or below thresholds
|
# Other entity ids can be specified for above and/or below thresholds
|
||||||
@ -312,7 +312,7 @@ The `for:` can also be specified as `HH:MM:SS` like this:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: sensor.temperature
|
entity_id: sensor.temperature
|
||||||
# At least one of the following required
|
# At least one of the following required
|
||||||
@ -331,7 +331,7 @@ You can also use templates in the `for` option.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id:
|
entity_id:
|
||||||
- sensor.temperature_1
|
- sensor.temperature_1
|
||||||
@ -340,7 +340,7 @@ automation:
|
|||||||
for:
|
for:
|
||||||
minutes: "{{ states('input_number.high_temp_min')|int }}"
|
minutes: "{{ states('input_number.high_temp_min')|int }}"
|
||||||
seconds: "{{ states('input_number.high_temp_sec')|int }}"
|
seconds: "{{ states('input_number.high_temp_sec')|int }}"
|
||||||
action:
|
actions:
|
||||||
- action: persistent_notification.create
|
- action: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
message: >
|
message: >
|
||||||
@ -378,7 +378,7 @@ This automation triggers if either Paulus or Anne-Therese are home for one minut
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id:
|
entity_id:
|
||||||
- device_tracker.paulus
|
- device_tracker.paulus
|
||||||
@ -398,7 +398,7 @@ It's possible to give a list of `from` states or `to` states:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: vacuum.test
|
entity_id: vacuum.test
|
||||||
from:
|
from:
|
||||||
@ -411,7 +411,7 @@ If you want to trigger on all state changes, but not on attribute changes, you c
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: vacuum.test
|
entity_id: vacuum.test
|
||||||
to:
|
to:
|
||||||
@ -421,7 +421,7 @@ If you want to trigger on all state changes *except* specific ones, use `not_fro
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: vacuum.test
|
entity_id: vacuum.test
|
||||||
not_from:
|
not_from:
|
||||||
@ -442,7 +442,7 @@ For example, this trigger only fires when the boiler has been heating for 10 min
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: climate.living_room
|
entity_id: climate.living_room
|
||||||
attribute: hvac_action
|
attribute: hvac_action
|
||||||
@ -454,7 +454,7 @@ This trigger fires whenever the boiler's `hvac_action` attribute changes:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: climate.living_room
|
entity_id: climate.living_room
|
||||||
attribute: hvac_action
|
attribute: hvac_action
|
||||||
@ -469,7 +469,7 @@ state for 30 seconds:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: light.office
|
entity_id: light.office
|
||||||
# Must stay "on" for 30 seconds
|
# Must stay "on" for 30 seconds
|
||||||
@ -488,7 +488,7 @@ the time specified, but doesn't care about "playing" or "paused".
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: media_player.kitchen
|
entity_id: media_player.kitchen
|
||||||
# Not "off" for 30 minutes
|
# Not "off" for 30 minutes
|
||||||
@ -504,7 +504,7 @@ same for `for` the time specified, regardless of the current state value.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: media_player.kitchen
|
entity_id: media_player.kitchen
|
||||||
# The media player remained in its current state for 1 hour
|
# The media player remained in its current state for 1 hour
|
||||||
@ -517,7 +517,7 @@ You can also use templates in the `for` option.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id:
|
entity_id:
|
||||||
- device_tracker.paulus
|
- device_tracker.paulus
|
||||||
@ -526,7 +526,7 @@ automation:
|
|||||||
for:
|
for:
|
||||||
minutes: "{{ states('input_number.lock_min')|int }}"
|
minutes: "{{ states('input_number.lock_min')|int }}"
|
||||||
seconds: "{{ states('input_number.lock_sec')|int }}"
|
seconds: "{{ states('input_number.lock_sec')|int }}"
|
||||||
action:
|
actions:
|
||||||
- action: lock.lock
|
- action: lock.lock
|
||||||
target:
|
target:
|
||||||
entity_id: lock.my_place
|
entity_id: lock.my_place
|
||||||
@ -556,7 +556,7 @@ Since the duration of twilight is different throughout the year, it is recommend
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: sun
|
- platform: sun
|
||||||
# Possible values: sunset, sunrise
|
# Possible values: sunset, sunrise
|
||||||
event: sunset
|
event: sunset
|
||||||
@ -573,13 +573,13 @@ Sometimes you may want more granular control over an automation than simply suns
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Exterior Lighting on when dark outside"
|
- alias: "Exterior Lighting on when dark outside"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
attribute: elevation
|
attribute: elevation
|
||||||
# Can be a positive or negative number
|
# Can be a positive or negative number
|
||||||
below: -4.0
|
below: -4.0
|
||||||
action:
|
actions:
|
||||||
- action: switch.turn_on
|
- action: switch.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: switch.exterior_lighting
|
entity_id: switch.exterior_lighting
|
||||||
@ -607,7 +607,7 @@ scanned using the Home Assistant Companion mobile application.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: tag
|
- platform: tag
|
||||||
tag_id: A7-6B-90-5F
|
tag_id: A7-6B-90-5F
|
||||||
```
|
```
|
||||||
@ -617,7 +617,7 @@ device/scanner by setting the `device_id`:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: tag
|
- platform: tag
|
||||||
tag_id: A7-6B-90-5F
|
tag_id: A7-6B-90-5F
|
||||||
device_id: 0e19cd3cf2b311ea88f469a7512c307d
|
device_id: 0e19cd3cf2b311ea88f469a7512c307d
|
||||||
@ -627,7 +627,7 @@ Or trigger on multiple possible devices for multiple tags:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: tag
|
- platform: tag
|
||||||
tag_id:
|
tag_id:
|
||||||
- "A7-6B-90-5F"
|
- "A7-6B-90-5F"
|
||||||
@ -649,7 +649,7 @@ With template triggers you can also evaluate attribute changes by using is_state
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: template
|
- platform: template
|
||||||
value_template: "{% if is_state('device_tracker.paulus', 'home') %}true{% endif %}"
|
value_template: "{% if is_state('device_tracker.paulus', 'home') %}true{% endif %}"
|
||||||
|
|
||||||
@ -665,7 +665,7 @@ You can also use templates in the `for` option.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: template
|
- platform: template
|
||||||
value_template: "{{ is_state('device_tracker.paulus', 'home') }}"
|
value_template: "{{ is_state('device_tracker.paulus', 'home') }}"
|
||||||
for:
|
for:
|
||||||
@ -694,7 +694,7 @@ A string that represents a time to fire on each day. Can be specified as `HH:MM`
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: time
|
- platform: time
|
||||||
# Military time format. This trigger will fire at 3:32 PM
|
# Military time format. This trigger will fire at 3:32 PM
|
||||||
at: "15:32:00"
|
at: "15:32:00"
|
||||||
@ -714,11 +714,11 @@ The entity ID of an [input datetime](/integrations/input_datetime/).
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.motion
|
entity_id: binary_sensor.motion
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- action: climate.turn_on
|
- action: climate.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: climate.office
|
entity_id: climate.office
|
||||||
@ -729,10 +729,10 @@ automation:
|
|||||||
datetime: >
|
datetime: >
|
||||||
{{ (now().timestamp() + 2*60*60)
|
{{ (now().timestamp() + 2*60*60)
|
||||||
| timestamp_custom('%Y-%m-%d %H:%M:%S') }}
|
| timestamp_custom('%Y-%m-%d %H:%M:%S') }}
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: time
|
- platform: time
|
||||||
at: input_datetime.turn_off_ac
|
at: input_datetime.turn_off_ac
|
||||||
action:
|
actions:
|
||||||
- action: climate.turn_off
|
- action: climate.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: climate.office
|
entity_id: climate.office
|
||||||
@ -746,10 +746,10 @@ The Entity ID of a [sensor](/integrations/sensor/) with the "timestamp" device c
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: time
|
- platform: time
|
||||||
at: sensor.phone_next_alarm
|
at: sensor.phone_next_alarm
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.bedroom
|
entity_id: light.bedroom
|
||||||
@ -763,12 +763,12 @@ For example, this trigger fires 5 minutes before the phone alarm goes off.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: time
|
- platform: time
|
||||||
at:
|
at:
|
||||||
entity_id: sensor.phone_next_alarm
|
entity_id: sensor.phone_next_alarm
|
||||||
offset: -00:05:00
|
offset: -00:05:00
|
||||||
action:
|
actions:
|
||||||
- service: light.turn_on
|
- service: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.bedroom
|
entity_id: light.bedroom
|
||||||
@ -784,7 +784,7 @@ Multiple times can be provided in a list. All formats can be intermixed.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time
|
- platform: time
|
||||||
at:
|
at:
|
||||||
- input_datetime.leave_for_work
|
- input_datetime.leave_for_work
|
||||||
@ -799,20 +799,20 @@ With the time pattern trigger, you can match if the hour, minute or second of th
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
# Matches every hour at 5 minutes past whole
|
# Matches every hour at 5 minutes past whole
|
||||||
minutes: 5
|
minutes: 5
|
||||||
|
|
||||||
automation 2:
|
automation 2:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
# Trigger once per minute during the hour of 3
|
# Trigger once per minute during the hour of 3
|
||||||
hours: "3"
|
hours: "3"
|
||||||
minutes: "*"
|
minutes: "*"
|
||||||
|
|
||||||
automation 3:
|
automation 3:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
# You can also match on interval. This will match every 5 minutes
|
# You can also match on interval. This will match every 5 minutes
|
||||||
minutes: "/5"
|
minutes: "/5"
|
||||||
@ -828,7 +828,7 @@ Persistent notification triggers are fired when a `persistent_notification` is `
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: persistent_notification
|
- platform: persistent_notification
|
||||||
update_type:
|
update_type:
|
||||||
- added
|
- added
|
||||||
@ -844,7 +844,7 @@ Webhook trigger fires when a web request is made to the webhook endpoint: `/api/
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: webhook
|
- platform: webhook
|
||||||
webhook_id: "some_hook_id"
|
webhook_id: "some_hook_id"
|
||||||
allowed_methods:
|
allowed_methods:
|
||||||
@ -892,7 +892,7 @@ Zone trigger fires when an entity is entering or leaving the zone. The entity ca
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: zone
|
- platform: zone
|
||||||
entity_id: person.paulus
|
entity_id: person.paulus
|
||||||
zone: zone.home
|
zone: zone.home
|
||||||
@ -911,7 +911,7 @@ This isn't for use with `device_tracker` entities. For those look above at the `
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: geo_location
|
- platform: geo_location
|
||||||
source: nsw_rural_fire_service_feed
|
source: nsw_rural_fire_service_feed
|
||||||
zone: zone.bushfire_alert_zone
|
zone: zone.bushfire_alert_zone
|
||||||
@ -938,7 +938,7 @@ An optional time offset can be given to have it fire a set time before or after
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: calendar
|
- platform: calendar
|
||||||
# Possible values: start, end
|
# Possible values: start, end
|
||||||
event: start
|
event: start
|
||||||
@ -959,7 +959,7 @@ Sentences are allowed to use some basic [template syntax](https://developers.hom
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: conversation
|
- platform: conversation
|
||||||
command:
|
command:
|
||||||
- "[it's ]party time"
|
- "[it's ]party time"
|
||||||
@ -1002,7 +1002,7 @@ It is possible to specify multiple triggers for the same rule. To do so just pre
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
# first trigger
|
# first trigger
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
minutes: 5
|
minutes: 5
|
||||||
@ -1017,7 +1017,7 @@ It is possible to specify multiple entities for the same trigger. To do so add m
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id:
|
entity_id:
|
||||||
- sensor.one
|
- sensor.one
|
||||||
@ -1033,7 +1033,7 @@ To do so, add `enabled: false` to the trigger. For example:
|
|||||||
```yaml
|
```yaml
|
||||||
# Example script with a disabled trigger
|
# Example script with a disabled trigger
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
# This trigger will not trigger, as it is disabled.
|
# This trigger will not trigger, as it is disabled.
|
||||||
# This automation does not run when the sun is set.
|
# This automation does not run when the sun is set.
|
||||||
- enabled: false
|
- enabled: false
|
||||||
@ -1066,7 +1066,7 @@ blueprint:
|
|||||||
trigger_variables:
|
trigger_variables:
|
||||||
_enable_number: !input input_number
|
_enable_number: !input input_number
|
||||||
|
|
||||||
trigger:
|
triggers:
|
||||||
- platform: sun
|
- platform: sun
|
||||||
event_type: sunrise
|
event_type: sunrise
|
||||||
enabled: !input input_boolean
|
enabled: !input input_boolean
|
||||||
@ -1094,7 +1094,7 @@ blueprint:
|
|||||||
selector:
|
selector:
|
||||||
trigger:
|
trigger:
|
||||||
|
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: manual_event
|
event_type: manual_event
|
||||||
- triggers: !input usertrigger
|
- triggers: !input usertrigger
|
||||||
|
@ -15,7 +15,7 @@ automation: !include automations.yaml
|
|||||||
|
|
||||||
# Labeled automation block
|
# Labeled automation block
|
||||||
automation kitchen:
|
automation kitchen:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: ...
|
- platform: ...
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ trace:
|
|||||||
default: 5
|
default: 5
|
||||||
required: false
|
required: false
|
||||||
variables:
|
variables:
|
||||||
description: "Variables that will be available inside your templates, both in `condition` and `action`."
|
description: "Variables that will be available inside your templates, both in `conditions` and `actions`."
|
||||||
required: false
|
required: false
|
||||||
default: {}
|
default: {}
|
||||||
type: map
|
type: map
|
||||||
@ -84,7 +84,7 @@ max_exceeded:
|
|||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
default: warning
|
default: warning
|
||||||
trigger:
|
triggers:
|
||||||
description: "The trigger(s) which will start the automation. Multiple triggers can be added and the automation will start when any of these triggers trigger."
|
description: "The trigger(s) which will start the automation. Multiple triggers can be added and the automation will start when any of these triggers trigger."
|
||||||
required: true
|
required: true
|
||||||
type: list
|
type: list
|
||||||
@ -102,11 +102,11 @@ trigger:
|
|||||||
PARAMETER_NAME:
|
PARAMETER_NAME:
|
||||||
description: "The value of the variable. Any YAML is valid. Templates can also be used to pass a value to the variable."
|
description: "The value of the variable. Any YAML is valid. Templates can also be used to pass a value to the variable."
|
||||||
type: any
|
type: any
|
||||||
condition:
|
conditions:
|
||||||
description: Conditions that have to be `true` to start the automation. By default all conditions listed have to be `true`, you can use [logical conditions](/docs/scripts/conditions/#logical-conditions) to change this default behavior.
|
description: Conditions that have to be `true` to start the automation. By default all conditions listed have to be `true`, you can use [logical conditions](/docs/scripts/conditions/#logical-conditions) to change this default behavior.
|
||||||
required: false
|
required: false
|
||||||
type: list
|
type: list
|
||||||
action:
|
actions:
|
||||||
description: "The sequence of actions to be performed in the script."
|
description: "The sequence of actions to be performed in the script."
|
||||||
required: true
|
required: true
|
||||||
type: list
|
type: list
|
||||||
@ -138,7 +138,7 @@ automation my_lights:
|
|||||||
# Turns on lights 1 hour before sunset if people are home
|
# Turns on lights 1 hour before sunset if people are home
|
||||||
# and if people get home between 16:00-23:00
|
# and if people get home between 16:00-23:00
|
||||||
- alias: "Rule 1 Light on in the evening"
|
- alias: "Rule 1 Light on in the evening"
|
||||||
trigger:
|
triggers:
|
||||||
# Prefix the first line of each trigger configuration
|
# Prefix the first line of each trigger configuration
|
||||||
# with a '-' to enter multiple
|
# with a '-' to enter multiple
|
||||||
- platform: sun
|
- platform: sun
|
||||||
@ -147,7 +147,7 @@ automation my_lights:
|
|||||||
- platform: state
|
- platform: state
|
||||||
entity_id: all
|
entity_id: all
|
||||||
to: "home"
|
to: "home"
|
||||||
condition:
|
conditions:
|
||||||
# Prefix the first line of each condition configuration
|
# Prefix the first line of each condition configuration
|
||||||
# with a '-'' to enter multiple
|
# with a '-'' to enter multiple
|
||||||
- condition: state
|
- condition: state
|
||||||
@ -156,7 +156,7 @@ automation my_lights:
|
|||||||
- condition: time
|
- condition: time
|
||||||
after: "16:00:00"
|
after: "16:00:00"
|
||||||
before: "23:00:00"
|
before: "23:00:00"
|
||||||
action:
|
actions:
|
||||||
# With a single service entry, we don't need a '-' before service - though you can if you want to
|
# With a single service entry, we don't need a '-' before service - though you can if you want to
|
||||||
- action: homeassistant.turn_on
|
- action: homeassistant.turn_on
|
||||||
target:
|
target:
|
||||||
@ -164,26 +164,26 @@ automation my_lights:
|
|||||||
|
|
||||||
# Turn off lights when everybody leaves the house
|
# Turn off lights when everybody leaves the house
|
||||||
- alias: "Rule 2 - Away Mode"
|
- alias: "Rule 2 - Away Mode"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: all
|
entity_id: all
|
||||||
to: "not_home"
|
to: "not_home"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_off
|
- action: light.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: all
|
entity_id: all
|
||||||
|
|
||||||
# Notify when Paulus leaves the house in the evening
|
# Notify when Paulus leaves the house in the evening
|
||||||
- alias: "Leave Home notification"
|
- alias: "Leave Home notification"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: zone
|
- platform: zone
|
||||||
event: leave
|
event: leave
|
||||||
zone: zone.home
|
zone: zone.home
|
||||||
entity_id: device_tracker.paulus
|
entity_id: device_tracker.paulus
|
||||||
condition:
|
conditions:
|
||||||
- condition: time
|
- condition: time
|
||||||
after: "20:00"
|
after: "20:00"
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify
|
- action: notify.notify
|
||||||
data:
|
data:
|
||||||
message: "Paulus left the house"
|
message: "Paulus left the house"
|
||||||
@ -191,12 +191,12 @@ automation my_lights:
|
|||||||
# Send a notification via Pushover with the event of a Xiaomi cube. Custom event from the Xiaomi integration.
|
# Send a notification via Pushover with the event of a Xiaomi cube. Custom event from the Xiaomi integration.
|
||||||
- alias: "Xiaomi Cube Action"
|
- alias: "Xiaomi Cube Action"
|
||||||
initial_state: false
|
initial_state: false
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: cube_action
|
event_type: cube_action
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.cube_158d000103a3de
|
entity_id: binary_sensor.cube_158d000103a3de
|
||||||
action:
|
actions:
|
||||||
- action: notify.pushover
|
- action: notify.pushover
|
||||||
data:
|
data:
|
||||||
title: "Cube event detected"
|
title: "Cube event detected"
|
||||||
@ -217,7 +217,7 @@ At startup, automations by default restore their last state of when Home Assista
|
|||||||
automation:
|
automation:
|
||||||
- alias: "Automation Name"
|
- alias: "Automation Name"
|
||||||
initial_state: false
|
initial_state: false
|
||||||
trigger:
|
triggers:
|
||||||
- platform: ...
|
- platform: ...
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -230,7 +230,7 @@ automation:
|
|||||||
- alias: "Automation Name"
|
- alias: "Automation Name"
|
||||||
trace:
|
trace:
|
||||||
stored_traces: 10
|
stored_traces: 10
|
||||||
trigger:
|
triggers:
|
||||||
- platform: ...
|
- platform: ...
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -244,18 +244,18 @@ If you want to migrate your manual automations to use the editor, you'll have to
|
|||||||
# Example automations.yaml entry. Note, automations.yaml is always a list!
|
# Example automations.yaml entry. Note, automations.yaml is always a list!
|
||||||
- id: my_unique_id # <-- Required for editor to work, for automations created with the editor the id will be automatically generated.
|
- id: my_unique_id # <-- Required for editor to work, for automations created with the editor the id will be automatically generated.
|
||||||
alias: "Hello world"
|
alias: "Hello world"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
from: below_horizon
|
from: below_horizon
|
||||||
to: above_horizon
|
to: above_horizon
|
||||||
condition:
|
conditions:
|
||||||
- condition: numeric_state
|
- condition: numeric_state
|
||||||
entity_id: sensor.temperature
|
entity_id: sensor.temperature
|
||||||
above: 17
|
above: 17
|
||||||
below: 25
|
below: 25
|
||||||
value_template: "{{ float(state.state) + 2 }}"
|
value_template: "{{ float(state.state) + 2 }}"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -267,13 +267,13 @@ blueprint:
|
|||||||
mode: restart
|
mode: restart
|
||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
|
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: !input motion_entity
|
entity_id: !input motion_entity
|
||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
|
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target: !input light_target
|
target: !input light_target
|
||||||
- wait_for_trigger:
|
- wait_for_trigger:
|
||||||
|
@ -1381,7 +1381,7 @@ Targets are meant to be used with the `target` property of an action in
|
|||||||
a script sequence. For example:
|
a script sequence. For example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target: !input lights
|
target: !input lights
|
||||||
```
|
```
|
||||||
|
@ -44,11 +44,11 @@ The automation we're going to use in this tutorial controls a light based on a m
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.motion_kitchen
|
entity_id: binary_sensor.motion_kitchen
|
||||||
|
|
||||||
action:
|
actions:
|
||||||
action: >
|
action: >
|
||||||
{% if trigger.to_state.state == "on" %}
|
{% if trigger.to_state.state == "on" %}
|
||||||
light.turn_on
|
light.turn_on
|
||||||
@ -91,7 +91,7 @@ Now we have to decide what steps we want to make configurable. We want to make i
|
|||||||
Configurable parts in blueprints are called [inputs](/docs/blueprint/schema/#blueprint-inputs). To make the motion sensor entity configurable, we're replacing the entity ID with a custom YAML tag `!input`. This YAML tag has to be combined with the name of the input:
|
Configurable parts in blueprints are called [inputs](/docs/blueprint/schema/#blueprint-inputs). To make the motion sensor entity configurable, we're replacing the entity ID with a custom YAML tag `!input`. This YAML tag has to be combined with the name of the input:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: !input motion_sensor
|
entity_id: !input motion_sensor
|
||||||
```
|
```
|
||||||
@ -103,7 +103,7 @@ Inputs are not limited to strings. They can contain complex objects too. So in t
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: >
|
action: >
|
||||||
{% if trigger.to_state.state == "on" %}
|
{% if trigger.to_state.state == "on" %}
|
||||||
light.turn_on
|
light.turn_on
|
||||||
@ -233,11 +233,11 @@ blueprint:
|
|||||||
entity:
|
entity:
|
||||||
- domain: light
|
- domain: light
|
||||||
|
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: !input motion_sensor
|
entity_id: !input motion_sensor
|
||||||
|
|
||||||
action:
|
actions:
|
||||||
- action: >
|
- action: >
|
||||||
{% if trigger.to_state.state == "on" %}
|
{% if trigger.to_state.state == "on" %}
|
||||||
light.turn_on
|
light.turn_on
|
||||||
|
@ -267,20 +267,20 @@ These work recursively. As an example using `!include_dir_list automation`, will
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Automation 1"
|
- alias: "Automation 1"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.iphone
|
entity_id: device_tracker.iphone
|
||||||
to: "home"
|
to: "home"
|
||||||
action:
|
actions:
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.entryway
|
entity_id: light.entryway
|
||||||
- alias: "Automation 2"
|
- alias: "Automation 2"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.iphone
|
entity_id: device_tracker.iphone
|
||||||
from: "home"
|
from: "home"
|
||||||
action:
|
actions:
|
||||||
action: light.turn_off
|
action: light.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: light.entryway
|
entity_id: light.entryway
|
||||||
@ -298,11 +298,11 @@ automation: !include_dir_list automation/presence/
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
alias: "Automation 1"
|
alias: "Automation 1"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.iphone
|
entity_id: device_tracker.iphone
|
||||||
to: "home"
|
to: "home"
|
||||||
action:
|
actions:
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.entryway
|
entity_id: light.entryway
|
||||||
@ -312,11 +312,11 @@ action:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
alias: "Automation 2"
|
alias: "Automation 2"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.iphone
|
entity_id: device_tracker.iphone
|
||||||
from: "home"
|
from: "home"
|
||||||
action:
|
actions:
|
||||||
action: light.turn_off
|
action: light.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: light.entryway
|
entity_id: light.entryway
|
||||||
@ -333,7 +333,7 @@ It is important to note that each file must contain only **one** entry when usin
|
|||||||
alexa:
|
alexa:
|
||||||
intents:
|
intents:
|
||||||
LocateIntent:
|
LocateIntent:
|
||||||
action:
|
actions:
|
||||||
action: notify.pushover
|
action: notify.pushover
|
||||||
data:
|
data:
|
||||||
message: "Your location has been queried via Alexa."
|
message: "Your location has been queried via Alexa."
|
||||||
@ -371,7 +371,7 @@ alexa:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
{% raw %}
|
{% raw %}
|
||||||
action:
|
actions:
|
||||||
action: notify.pushover
|
action: notify.pushover
|
||||||
data:
|
data:
|
||||||
message: "Your location has been queried via Alexa."
|
message: "Your location has been queried via Alexa."
|
||||||
@ -408,20 +408,20 @@ speech:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Automation 1"
|
- alias: "Automation 1"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: device_tracker.iphone
|
entity_id: device_tracker.iphone
|
||||||
to: "home"
|
to: "home"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.entryway
|
entity_id: light.entryway
|
||||||
- alias: "Automation 2"
|
- alias: "Automation 2"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: device_tracker.iphone
|
entity_id: device_tracker.iphone
|
||||||
from: "home"
|
from: "home"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_off
|
- action: light.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: light.entryway
|
entity_id: light.entryway
|
||||||
@ -439,20 +439,20 @@ automation: !include_dir_merge_list automation/
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Automation 1"
|
- alias: "Automation 1"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: device_tracker.iphone
|
entity_id: device_tracker.iphone
|
||||||
to: "home"
|
to: "home"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.entryway
|
entity_id: light.entryway
|
||||||
- alias: "Automation 2"
|
- alias: "Automation 2"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: device_tracker.iphone
|
entity_id: device_tracker.iphone
|
||||||
from: "home"
|
from: "home"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_off
|
- action: light.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: light.entryway
|
entity_id: light.entryway
|
||||||
|
@ -57,12 +57,12 @@ Scenes can be activated using the action `scene.turn_on` (there is no 'scene.tur
|
|||||||
```yaml
|
```yaml
|
||||||
# Example automation
|
# Example automation
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.sweetheart
|
entity_id: device_tracker.sweetheart
|
||||||
from: "not_home"
|
from: "not_home"
|
||||||
to: "home"
|
to: "home"
|
||||||
action:
|
actions:
|
||||||
action: scene.turn_on
|
action: scene.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: scene.romantic
|
entity_id: scene.romantic
|
||||||
@ -75,12 +75,12 @@ With the `scene.apply` action you are able to apply a scene without first defini
|
|||||||
```yaml
|
```yaml
|
||||||
# Example automation
|
# Example automation
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.sweetheart
|
entity_id: device_tracker.sweetheart
|
||||||
from: "not_home"
|
from: "not_home"
|
||||||
to: "home"
|
to: "home"
|
||||||
action:
|
actions:
|
||||||
action: scene.apply
|
action: scene.apply
|
||||||
data:
|
data:
|
||||||
entities:
|
entities:
|
||||||
@ -104,12 +104,12 @@ light will transition to the scene in 2.5 seconds.
|
|||||||
```yaml
|
```yaml
|
||||||
# Example automation
|
# Example automation
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.sweetheart
|
entity_id: device_tracker.sweetheart
|
||||||
from: "not_home"
|
from: "not_home"
|
||||||
to: "home"
|
to: "home"
|
||||||
action:
|
actions:
|
||||||
action: scene.turn_on
|
action: scene.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: scene.romantic
|
entity_id: scene.romantic
|
||||||
|
@ -146,7 +146,7 @@ The `condition` {% term action %} only stops executing the current sequence bloc
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Check if Paulus ishome AND temperature is below 20"
|
- alias: "Check if Paulus ishome AND temperature is below 20"
|
||||||
condition:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: "device_tracker.paulus"
|
entity_id: "device_tracker.paulus"
|
||||||
state: "home"
|
state: "home"
|
||||||
@ -360,11 +360,11 @@ The following {% term automation %} example shows how to raise a custom event ca
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Fire Event"
|
- alias: "Fire Event"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: switch.kitchen
|
entity_id: switch.kitchen
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- event: event_light_state_changed
|
- event: event_light_state_changed
|
||||||
event_data:
|
event_data:
|
||||||
state: "on"
|
state: "on"
|
||||||
@ -376,10 +376,10 @@ The following {% term automation %} example shows how to capture the custom even
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Capture Event"
|
- alias: "Capture Event"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: event_light_state_changed
|
event_type: event_light_state_changed
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify
|
- action: notify.notify
|
||||||
data:
|
data:
|
||||||
message: "kitchen light is turned {{ trigger.event.data.state }}"
|
message: "kitchen light is turned {{ trigger.event.data.state }}"
|
||||||
@ -524,16 +524,16 @@ _until_ the condition(s) evaluate to true.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.xyz
|
entity_id: binary_sensor.xyz
|
||||||
to: "on"
|
to: "on"
|
||||||
condition:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.something
|
entity_id: binary_sensor.something
|
||||||
state: "off"
|
state: "off"
|
||||||
mode: single
|
mode: single
|
||||||
action:
|
actions:
|
||||||
- alias: "Repeat the sequence UNTIL the conditions are true"
|
- alias: "Repeat the sequence UNTIL the conditions are true"
|
||||||
repeat:
|
repeat:
|
||||||
sequence:
|
sequence:
|
||||||
@ -621,12 +621,12 @@ The `choose` {% term action %} can be used like an "if/then/elseif/then.../else"
|
|||||||
```yaml
|
```yaml
|
||||||
# Example with "if", "elif" and "else"
|
# Example with "if", "elif" and "else"
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: input_boolean.simulate
|
entity_id: input_boolean.simulate
|
||||||
to: "on"
|
to: "on"
|
||||||
mode: restart
|
mode: restart
|
||||||
action:
|
actions:
|
||||||
- choose:
|
- choose:
|
||||||
# IF morning
|
# IF morning
|
||||||
- conditions:
|
- conditions:
|
||||||
@ -664,10 +664,10 @@ For example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: input_select.home_mode
|
entity_id: input_select.home_mode
|
||||||
action:
|
actions:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions: >
|
- conditions: >
|
||||||
{{ trigger.to_state.state == 'Home' and
|
{{ trigger.to_state.state == 'Home' and
|
||||||
@ -706,12 +706,12 @@ When the sun goes below the horizon, the `porch` and `garden` lights must turn o
|
|||||||
# Example with "if" and "if"
|
# Example with "if" and "if"
|
||||||
automation:
|
automation:
|
||||||
- alias: "Turn lights on when the sun gets dim and if some room is occupied"
|
- alias: "Turn lights on when the sun gets dim and if some room is occupied"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
attribute: elevation
|
attribute: elevation
|
||||||
below: 4
|
below: 4
|
||||||
action:
|
actions:
|
||||||
# This must always apply
|
# This must always apply
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
data:
|
data:
|
||||||
@ -770,11 +770,11 @@ groups themselves. In total, four actions are executed, one after the other.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.motion
|
entity_id: binary_sensor.motion
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- alias: "Turn on devices"
|
- alias: "Turn on devices"
|
||||||
sequence:
|
sequence:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
@ -807,11 +807,11 @@ The following example shows sending messages out at the same time (in parallel):
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.motion
|
entity_id: binary_sensor.motion
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- parallel:
|
- parallel:
|
||||||
- action: notify.person1
|
- action: notify.person1
|
||||||
data:
|
data:
|
||||||
@ -966,7 +966,7 @@ blueprint:
|
|||||||
selector:
|
selector:
|
||||||
boolean:
|
boolean:
|
||||||
|
|
||||||
action:
|
actions:
|
||||||
- delay: 0:35
|
- delay: 0:35
|
||||||
enabled: !input input_boolean
|
enabled: !input input_boolean
|
||||||
```
|
```
|
||||||
|
@ -19,7 +19,7 @@ All conditions support an optional `alias`.
|
|||||||
Test multiple conditions in one condition statement. Passes if all embedded conditions are true.
|
Test multiple conditions in one condition statement. Passes if all embedded conditions are true.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Paulus home AND temperature below 20"
|
alias: "Paulus home AND temperature below 20"
|
||||||
condition: and
|
condition: and
|
||||||
conditions:
|
conditions:
|
||||||
@ -36,7 +36,7 @@ If you do not want to combine AND and OR conditions, you can list them sequentia
|
|||||||
The following configuration works the same as the one listed above:
|
The following configuration works the same as the one listed above:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: "device_tracker.paulus"
|
entity_id: "device_tracker.paulus"
|
||||||
state: "home"
|
state: "home"
|
||||||
@ -50,7 +50,7 @@ Currently you need to format your conditions like this to be able to edit them u
|
|||||||
The AND condition also has a shorthand form. The following configuration works the same as the ones listed above:
|
The AND condition also has a shorthand form. The following configuration works the same as the ones listed above:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Paulus home AND temperature below 20"
|
alias: "Paulus home AND temperature below 20"
|
||||||
and:
|
and:
|
||||||
- condition: state
|
- condition: state
|
||||||
@ -66,7 +66,7 @@ condition:
|
|||||||
Test multiple conditions in one condition statement. Passes if any embedded condition is true.
|
Test multiple conditions in one condition statement. Passes if any embedded condition is true.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Paulus home OR temperature below 20"
|
alias: "Paulus home OR temperature below 20"
|
||||||
condition: or
|
condition: or
|
||||||
conditions:
|
conditions:
|
||||||
@ -81,7 +81,7 @@ condition:
|
|||||||
The OR condition also has a shorthand form. The following configuration works the same as the one listed above:
|
The OR condition also has a shorthand form. The following configuration works the same as the one listed above:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Paulus home OR temperature below 20"
|
alias: "Paulus home OR temperature below 20"
|
||||||
or:
|
or:
|
||||||
- condition: state
|
- condition: state
|
||||||
@ -98,7 +98,7 @@ Test multiple AND and OR conditions in one condition statement. Passes if any em
|
|||||||
This allows you to mix several AND and OR conditions together.
|
This allows you to mix several AND and OR conditions together.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: and
|
condition: and
|
||||||
conditions:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
@ -117,7 +117,7 @@ condition:
|
|||||||
Or in shorthand form:
|
Or in shorthand form:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
and:
|
and:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: "device_tracker.paulus"
|
entity_id: "device_tracker.paulus"
|
||||||
@ -136,7 +136,7 @@ condition:
|
|||||||
Test multiple conditions in one condition statement. Passes if all embedded conditions are **not** true.
|
Test multiple conditions in one condition statement. Passes if all embedded conditions are **not** true.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Paulus not home AND alarm not disarmed"
|
alias: "Paulus not home AND alarm not disarmed"
|
||||||
condition: not
|
condition: not
|
||||||
conditions:
|
conditions:
|
||||||
@ -151,7 +151,7 @@ condition:
|
|||||||
The NOT condition also has a shorthand form. The following configuration works the same as the one listed above:
|
The NOT condition also has a shorthand form. The following configuration works the same as the one listed above:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Paulus not home AND alarm not disarmed"
|
alias: "Paulus not home AND alarm not disarmed"
|
||||||
not:
|
not:
|
||||||
- condition: state
|
- condition: state
|
||||||
@ -169,7 +169,7 @@ This type of condition attempts to parse the state of the specified entity or th
|
|||||||
If both `below` and `above` are specified, both tests have to pass.
|
If both `below` and `above` are specified, both tests have to pass.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Temperature between 17 and 25 degrees"
|
alias: "Temperature between 17 and 25 degrees"
|
||||||
condition: numeric_state
|
condition: numeric_state
|
||||||
entity_id: sensor.temperature
|
entity_id: sensor.temperature
|
||||||
@ -182,7 +182,7 @@ You can optionally use a `value_template` to process the value of the state befo
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: numeric_state
|
condition: numeric_state
|
||||||
entity_id: sensor.temperature
|
entity_id: sensor.temperature
|
||||||
above: 17
|
above: 17
|
||||||
@ -197,7 +197,7 @@ It is also possible to test the condition against multiple entities at once.
|
|||||||
The condition will pass if **all** entities match the thresholds.
|
The condition will pass if **all** entities match the thresholds.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: numeric_state
|
condition: numeric_state
|
||||||
entity_id:
|
entity_id:
|
||||||
- sensor.kitchen_temperature
|
- sensor.kitchen_temperature
|
||||||
@ -209,7 +209,7 @@ Alternatively, the condition can test against a state attribute.
|
|||||||
The condition will pass if the attribute value of the entity matches the thresholds.
|
The condition will pass if the attribute value of the entity matches the thresholds.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: numeric_state
|
condition: numeric_state
|
||||||
entity_id: climate.living_room_thermostat
|
entity_id: climate.living_room_thermostat
|
||||||
attribute: temperature
|
attribute: temperature
|
||||||
@ -222,7 +222,7 @@ that contain a numeric value, can be used in the `above` and `below`
|
|||||||
options to make the condition more dynamic.
|
options to make the condition more dynamic.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: numeric_state
|
condition: numeric_state
|
||||||
entity_id: climate.living_room_thermostat
|
entity_id: climate.living_room_thermostat
|
||||||
attribute: temperature
|
attribute: temperature
|
||||||
@ -235,7 +235,7 @@ condition:
|
|||||||
Tests if an entity has a specified state.
|
Tests if an entity has a specified state.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Paulus not home for an hour and a bit"
|
alias: "Paulus not home for an hour and a bit"
|
||||||
condition: state
|
condition: state
|
||||||
entity_id: device_tracker.paulus
|
entity_id: device_tracker.paulus
|
||||||
@ -251,7 +251,7 @@ It is also possible to test the condition against multiple entities at once.
|
|||||||
The condition will pass if **all** entities match the state.
|
The condition will pass if **all** entities match the state.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: state
|
condition: state
|
||||||
entity_id:
|
entity_id:
|
||||||
- light.kitchen
|
- light.kitchen
|
||||||
@ -263,7 +263,7 @@ Instead of matching all, it is also possible if one of the entities matches.
|
|||||||
In the following example the condition will pass if **any** entity matches the state.
|
In the following example the condition will pass if **any** entity matches the state.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: state
|
condition: state
|
||||||
entity_id:
|
entity_id:
|
||||||
- binary_sensor.motion_sensor_left
|
- binary_sensor.motion_sensor_left
|
||||||
@ -276,7 +276,7 @@ Testing if an entity is matching a set of possible conditions;
|
|||||||
The condition will pass if the entity matches one of the states given.
|
The condition will pass if the entity matches one of the states given.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: state
|
condition: state
|
||||||
entity_id: alarm_control_panel.home
|
entity_id: alarm_control_panel.home
|
||||||
state:
|
state:
|
||||||
@ -288,7 +288,7 @@ Or, combine multiple entities with multiple states. In the following example,
|
|||||||
both media players need to be either paused or playing for the condition to pass.
|
both media players need to be either paused or playing for the condition to pass.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: state
|
condition: state
|
||||||
entity_id:
|
entity_id:
|
||||||
- media_player.living_room
|
- media_player.living_room
|
||||||
@ -302,7 +302,7 @@ Alternatively, the condition can test against a state attribute.
|
|||||||
The condition will pass if the attribute matches the given state.
|
The condition will pass if the attribute matches the given state.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: state
|
condition: state
|
||||||
entity_id: climate.living_room_thermostat
|
entity_id: climate.living_room_thermostat
|
||||||
attribute: fan_mode
|
attribute: fan_mode
|
||||||
@ -314,7 +314,7 @@ entities). The condition will pass if the state of the entity matches the state
|
|||||||
of the given helper entity.
|
of the given helper entity.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: state
|
condition: state
|
||||||
entity_id: alarm_control_panel.home
|
entity_id: alarm_control_panel.home
|
||||||
state: input_select.guest_mode
|
state: input_select.guest_mode
|
||||||
@ -325,7 +325,7 @@ You can also use templates in the `for` option.
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: state
|
condition: state
|
||||||
entity_id: device_tracker.paulus
|
entity_id: device_tracker.paulus
|
||||||
state: "home"
|
state: "home"
|
||||||
@ -345,7 +345,7 @@ The `for` template(s) will be evaluated when the condition is tested.
|
|||||||
The sun state can be used to test if the sun has set or risen.
|
The sun state can be used to test if the sun has set or risen.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Sun up"
|
alias: "Sun up"
|
||||||
condition: state # 'day' condition: from sunrise until sunset
|
condition: state # 'day' condition: from sunrise until sunset
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
@ -353,7 +353,7 @@ condition:
|
|||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Sun down"
|
alias: "Sun down"
|
||||||
condition: state # from sunset until sunrise
|
condition: state # from sunset until sunrise
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
@ -370,7 +370,7 @@ For an in-depth explanation of sun elevation, see [sun elevation trigger][sun_el
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: and # 'twilight' condition: dusk and dawn, in typical locations
|
condition: and # 'twilight' condition: dusk and dawn, in typical locations
|
||||||
conditions:
|
conditions:
|
||||||
- condition: template
|
- condition: template
|
||||||
@ -384,7 +384,7 @@ condition:
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: template # 'night' condition: from dusk to dawn, in typical locations
|
condition: template # 'night' condition: from dusk to dawn, in typical locations
|
||||||
value_template: "{{ state_attr('sun.sun', 'elevation') < -6 }}"
|
value_template: "{{ state_attr('sun.sun', 'elevation') < -6 }}"
|
||||||
```
|
```
|
||||||
@ -405,7 +405,7 @@ The sunset/sunrise conditions do not work in locations inside the polar circles,
|
|||||||
|
|
||||||
This is an example of 1 hour offset before sunset:
|
This is an example of 1 hour offset before sunset:
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: sun
|
condition: sun
|
||||||
after: sunset
|
after: sunset
|
||||||
after_offset: "-01:00:00"
|
after_offset: "-01:00:00"
|
||||||
@ -414,7 +414,7 @@ condition:
|
|||||||
This is 'when dark' - equivalent to a state condition on `sun.sun` of `below_horizon`:
|
This is 'when dark' - equivalent to a state condition on `sun.sun` of `below_horizon`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
- condition: sun
|
- condition: sun
|
||||||
after: sunset
|
after: sunset
|
||||||
before: sunrise
|
before: sunrise
|
||||||
@ -423,7 +423,7 @@ condition:
|
|||||||
This is 'when light' - equivalent to a state condition on `sun.sun` of `above_horizon`:
|
This is 'when light' - equivalent to a state condition on `sun.sun` of `above_horizon`:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
- condition: sun
|
- condition: sun
|
||||||
after: sunrise
|
after: sunrise
|
||||||
before: sunset
|
before: sunset
|
||||||
@ -440,7 +440,7 @@ The template condition tests if the [given template][template] renders a value e
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Iphone battery above 50%"
|
alias: "Iphone battery above 50%"
|
||||||
condition: template
|
condition: template
|
||||||
value_template: "{{ (state_attr('device_tracker.iphone', 'battery_level')|int) > 50 }}"
|
value_template: "{{ (state_attr('device_tracker.iphone', 'battery_level')|int) > 50 }}"
|
||||||
@ -487,7 +487,7 @@ and [`not`](#not-condition) conditions:
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: or
|
condition: or
|
||||||
conditions:
|
conditions:
|
||||||
- "{{ is_state('device_tracker.iphone', 'away') }}"
|
- "{{ is_state('device_tracker.iphone', 'away') }}"
|
||||||
@ -539,7 +539,7 @@ It's also supported in script or automation `condition` actions:
|
|||||||
The time condition can test if it is after a specified time, before a specified time or if it is a certain day of the week.
|
The time condition can test if it is after a specified time, before a specified time or if it is a certain day of the week.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Time 15~02"
|
alias: "Time 15~02"
|
||||||
condition: time
|
condition: time
|
||||||
# At least one of the following is required.
|
# At least one of the following is required.
|
||||||
@ -565,7 +565,7 @@ or another `sensor` entity containing a timestamp with the "timestamp" device
|
|||||||
class, can be used instead.
|
class, can be used instead.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
- alias: "Example referencing a time helper"
|
- alias: "Example referencing a time helper"
|
||||||
condition: time
|
condition: time
|
||||||
after: input_datetime.house_silent_hours_start
|
after: input_datetime.house_silent_hours_start
|
||||||
@ -586,20 +586,20 @@ date part is fully ignored.
|
|||||||
The trigger condition can test if an automation was triggered by a certain trigger, identified by the trigger's `id`.
|
The trigger condition can test if an automation was triggered by a certain trigger, identified by the trigger's `id`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: trigger
|
condition: trigger
|
||||||
id: event_trigger
|
id: event_trigger
|
||||||
```
|
```
|
||||||
|
|
||||||
For a trigger identified by its index, both a string and integer is allowed:
|
For a trigger identified by its index, both a string and integer is allowed:
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: trigger
|
condition: trigger
|
||||||
id: "0"
|
id: "0"
|
||||||
```
|
```
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: trigger
|
condition: trigger
|
||||||
id: 0
|
id: 0
|
||||||
```
|
```
|
||||||
@ -607,7 +607,7 @@ condition:
|
|||||||
It is possible to give a list of triggers:
|
It is possible to give a list of triggers:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: trigger
|
condition: trigger
|
||||||
id:
|
id:
|
||||||
- event_1_trigger
|
- event_1_trigger
|
||||||
@ -619,7 +619,7 @@ condition:
|
|||||||
Zone conditions test if an entity is in a certain zone. For zone automation to work, you need to have set up a device tracker platform that supports reporting GPS coordinates.
|
Zone conditions test if an entity is in a certain zone. For zone automation to work, you need to have set up a device tracker platform that supports reporting GPS coordinates.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
alias: "Paulus at home"
|
alias: "Paulus at home"
|
||||||
condition: zone
|
condition: zone
|
||||||
entity_id: device_tracker.paulus
|
entity_id: device_tracker.paulus
|
||||||
@ -630,7 +630,7 @@ It is also possible to test the condition against multiple entities at once.
|
|||||||
The condition will pass if all entities are in the specified zone.
|
The condition will pass if all entities are in the specified zone.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: zone
|
condition: zone
|
||||||
entity_id:
|
entity_id:
|
||||||
- device_tracker.frenck
|
- device_tracker.frenck
|
||||||
@ -642,7 +642,7 @@ Testing if an entity is matching a set of possible zones;
|
|||||||
The condition will pass if the entity is in one of the zones.
|
The condition will pass if the entity is in one of the zones.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: zone
|
condition: zone
|
||||||
entity_id: device_tracker.paulus
|
entity_id: device_tracker.paulus
|
||||||
state:
|
state:
|
||||||
@ -655,7 +655,7 @@ both entities need to be either in the home or the work zone for the condition
|
|||||||
to pass.
|
to pass.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
condition: zone
|
condition: zone
|
||||||
entity_id:
|
entity_id:
|
||||||
- device_tracker.frenck
|
- device_tracker.frenck
|
||||||
@ -670,7 +670,7 @@ condition:
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
condition:
|
conditions:
|
||||||
- condition: numeric_state
|
- condition: numeric_state
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
value_template: "{{ state.attributes.elevation }}"
|
value_template: "{{ state.attributes.elevation }}"
|
||||||
@ -700,7 +700,7 @@ For example:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
# This condition will always pass, as it is disabled.
|
# This condition will always pass, as it is disabled.
|
||||||
condition:
|
conditions:
|
||||||
enabled: false
|
enabled: false
|
||||||
condition: state
|
condition: state
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
@ -728,7 +728,7 @@ blueprint:
|
|||||||
trigger_variables:
|
trigger_variables:
|
||||||
_enable_number: !input input_number
|
_enable_number: !input input_number
|
||||||
|
|
||||||
condition:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: sun.sun
|
entity_id: sun.sun
|
||||||
state: "above_horizon"
|
state: "above_horizon"
|
||||||
|
@ -104,10 +104,10 @@ If there is an automation that handles that event, it will be automatically trig
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Capture Event"
|
- alias: "Capture Event"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: event_light_state_changed
|
event_type: event_light_state_changed
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify
|
- action: notify.notify
|
||||||
data:
|
data:
|
||||||
message: "Light is turned {{ trigger.event.data.state }}"
|
message: "Light is turned {{ trigger.event.data.state }}"
|
||||||
|
@ -285,12 +285,12 @@ but you will still receive the done message.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Telegram callback to stop alerts for garage door"
|
- alias: "Telegram callback to stop alerts for garage door"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: telegram_callback
|
event_type: telegram_callback
|
||||||
event_data:
|
event_data:
|
||||||
data: "/garage_acknowledge"
|
data: "/garage_acknowledge"
|
||||||
action:
|
actions:
|
||||||
- action: alert.turn_off
|
- action: alert.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: alert.garage_door
|
entity_id: alert.garage_door
|
||||||
|
@ -436,14 +436,14 @@ Using this {% term trigger %} in an {% term automation %} will allow you to dete
|
|||||||
# Example automations.yaml entry
|
# Example automations.yaml entry
|
||||||
alias: Doorbell Pressed
|
alias: Doorbell Pressed
|
||||||
description: "Trigger when Amcrest Button Press Event Fires"
|
description: "Trigger when Amcrest Button Press Event Fires"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: amcrest
|
event_type: amcrest
|
||||||
event_data:
|
event_data:
|
||||||
event: "CallNoAnswered"
|
event: "CallNoAnswered"
|
||||||
payload:
|
payload:
|
||||||
action: "Start"
|
action: "Start"
|
||||||
action:
|
actions:
|
||||||
- type: flash
|
- type: flash
|
||||||
entity_id: light.living_room
|
entity_id: light.living_room
|
||||||
domain: light
|
domain: light
|
||||||
|
@ -146,7 +146,7 @@ The `androidtv.adb_command` action allows you to send either keys or ADB shell c
|
|||||||
In an [action](/getting-started/automation-action/) of your [automation setup](/getting-started/automation/) it could look like this:
|
In an [action](/getting-started/automation-action/) of your [automation setup](/getting-started/automation/) it could look like this:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: androidtv.adb_command
|
action: androidtv.adb_command
|
||||||
target:
|
target:
|
||||||
entity_id: media_player.androidtv_tv_living_room
|
entity_id: media_player.androidtv_tv_living_room
|
||||||
|
@ -147,14 +147,14 @@ Using the lock operation sensors, you can detect when a user operates a lock and
|
|||||||
- id: "1583706446906"
|
- id: "1583706446906"
|
||||||
alias: "joe_doe_front_door_operate"
|
alias: "joe_doe_front_door_operate"
|
||||||
description: John Doe locks or unlocks the Front Door
|
description: John Doe locks or unlocks the Front Door
|
||||||
trigger:
|
triggers:
|
||||||
- entity_id: sensor.front_door_operator
|
- entity_id: sensor.front_door_operator
|
||||||
platform: state
|
platform: state
|
||||||
to: John Doe
|
to: John Doe
|
||||||
condition:
|
conditions:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ not state_attr('sensor.front_door_operator', 'remote') }}"
|
value_template: "{{ not state_attr('sensor.front_door_operator', 'remote') }}"
|
||||||
action:
|
actions:
|
||||||
- data: {}
|
- data: {}
|
||||||
entity_id: camera.inside
|
entity_id: camera.inside
|
||||||
action: camera.turn_off
|
action: camera.turn_off
|
||||||
|
@ -81,10 +81,10 @@ See the example below for how an automation trigger translates to a message on t
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Sunset Service Bus message"
|
- alias: "Sunset Service Bus message"
|
||||||
trigger:
|
triggers:
|
||||||
platform: sun
|
platform: sun
|
||||||
event: sunset
|
event: sunset
|
||||||
action:
|
actions:
|
||||||
action: notify.test_queue
|
action: notify.test_queue
|
||||||
data:
|
data:
|
||||||
message: "Sun is going down"
|
message: "Sun is going down"
|
||||||
|
@ -51,10 +51,10 @@ at 3 AM:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Backup Home Assistant every night at 3 AM"
|
- alias: "Backup Home Assistant every night at 3 AM"
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "03:00:00"
|
at: "03:00:00"
|
||||||
action:
|
actions:
|
||||||
alias: "Create backup now"
|
alias: "Create backup now"
|
||||||
action: backup.create
|
action: backup.create
|
||||||
```
|
```
|
||||||
|
@ -39,16 +39,16 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "If there is motion and it's dark turn on the gateway light"
|
- alias: "If there is motion and it's dark turn on the gateway light"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
|
entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
|
||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
condition:
|
conditions:
|
||||||
condition: numeric_state
|
condition: numeric_state
|
||||||
entity_id: sensor.illumination_34ce00xxxx11
|
entity_id: sensor.illumination_34ce00xxxx11
|
||||||
below: 300
|
below: 300
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.gateway_light_34ce00xxxx11
|
entity_id: light.gateway_light_34ce00xxxx11
|
||||||
@ -58,14 +58,14 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
|
|||||||
target:
|
target:
|
||||||
entity_id: automation.MOTION_OFF
|
entity_id: automation.MOTION_OFF
|
||||||
- alias: "If there no motion for 5 minutes turn off the gateway light"
|
- alias: "If there no motion for 5 minutes turn off the gateway light"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
|
entity_id: binary_sensor.motion_sensor_158d000xxxxxc2
|
||||||
from: "on"
|
from: "on"
|
||||||
to: "off"
|
to: "off"
|
||||||
for:
|
for:
|
||||||
minutes: 5
|
minutes: 5
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_off
|
- action: light.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: light.gateway_light_34ce00xxxx11
|
entity_id: light.gateway_light_34ce00xxxx11
|
||||||
@ -78,42 +78,42 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "If the window is open turn off the radiator"
|
- alias: "If the window is open turn off the radiator"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
|
entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
|
||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
action: climate.set_operation_mode
|
action: climate.set_operation_mode
|
||||||
target:
|
target:
|
||||||
entity_id: climate.livingroom
|
entity_id: climate.livingroom
|
||||||
data:
|
data:
|
||||||
operation_mode: "Off"
|
operation_mode: "Off"
|
||||||
- alias: "If the window is closed for 5 minutes turn on the radiator again"
|
- alias: "If the window is closed for 5 minutes turn on the radiator again"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
|
entity_id: binary_sensor.door_window_sensor_158d000xxxxxc2
|
||||||
from: "on"
|
from: "on"
|
||||||
to: "off"
|
to: "off"
|
||||||
for:
|
for:
|
||||||
minutes: 5
|
minutes: 5
|
||||||
action:
|
actions:
|
||||||
action: climate.set_operation_mode
|
action: climate.set_operation_mode
|
||||||
target:
|
target:
|
||||||
entity_id: climate.livingroom
|
entity_id: climate.livingroom
|
||||||
data:
|
data:
|
||||||
operation_mode: "Smart schedule"
|
operation_mode: "Smart schedule"
|
||||||
- alias: "Notify if door is opened when away"
|
- alias: "Notify if door is opened when away"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.door_window_sensor_15xxxxxxc9xx6b
|
entity_id: binary_sensor.door_window_sensor_15xxxxxxc9xx6b
|
||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
condition:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: group.family
|
entity_id: group.family
|
||||||
state: "not_home"
|
state: "not_home"
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify_person
|
- action: notify.notify_person
|
||||||
data:
|
data:
|
||||||
message: "The door has been opened"
|
message: "The door has been opened"
|
||||||
@ -123,12 +123,12 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Send notification on fire alarm"
|
- alias: "Send notification on fire alarm"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.smoke_sensor_158d0001574899
|
entity_id: binary_sensor.smoke_sensor_158d0001574899
|
||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- action: notify.html5
|
- action: notify.html5
|
||||||
data:
|
data:
|
||||||
title: Fire alarm!
|
title: Fire alarm!
|
||||||
@ -146,12 +146,12 @@ The requirement is that you have setup the [`xiaomi aqara` integration](/integra
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Send notification on gas alarm"
|
- alias: "Send notification on gas alarm"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.natgas_sensor_158dxxxxxxxxxx
|
entity_id: binary_sensor.natgas_sensor_158dxxxxxxxxxx
|
||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- action: notify.html5
|
- action: notify.html5
|
||||||
data:
|
data:
|
||||||
title: Gas alarm!
|
title: Gas alarm!
|
||||||
@ -166,35 +166,35 @@ As indicated in the table on top of this page there are 3 versions of the button
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Toggle dining light on single press"
|
- alias: "Toggle dining light on single press"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.click
|
event_type: xiaomi_aqara.click
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.switch_158d000xxxxxc2
|
entity_id: binary_sensor.switch_158d000xxxxxc2
|
||||||
click_type: single
|
click_type: single
|
||||||
action:
|
actions:
|
||||||
action: switch.toggle
|
action: switch.toggle
|
||||||
target:
|
target:
|
||||||
entity_id: switch.wall_switch_left_158d000xxxxx01
|
entity_id: switch.wall_switch_left_158d000xxxxx01
|
||||||
- alias: "Toggle couch light on double click"
|
- alias: "Toggle couch light on double click"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.click
|
event_type: xiaomi_aqara.click
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.switch_158d000xxxxxc2
|
entity_id: binary_sensor.switch_158d000xxxxxc2
|
||||||
click_type: double
|
click_type: double
|
||||||
action:
|
actions:
|
||||||
action: switch.toggle
|
action: switch.toggle
|
||||||
target:
|
target:
|
||||||
entity_id: switch.wall_switch_right_158d000xxxxx01
|
entity_id: switch.wall_switch_right_158d000xxxxx01
|
||||||
- alias: "Let a dog bark on long press"
|
- alias: "Let a dog bark on long press"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.click
|
event_type: xiaomi_aqara.click
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.switch_158d000xxxxxc2
|
entity_id: binary_sensor.switch_158d000xxxxxc2
|
||||||
click_type: long_click_press
|
click_type: long_click_press
|
||||||
action:
|
actions:
|
||||||
action: xiaomi_aqara.play_ringtone
|
action: xiaomi_aqara.play_ringtone
|
||||||
data:
|
data:
|
||||||
gw_mac: xxxxxxxxxxxx
|
gw_mac: xxxxxxxxxxxx
|
||||||
@ -208,65 +208,65 @@ Available events are `flip90`, `flip180`, `move`, `tap_twice`, `shake_air`, `swi
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Cube event flip90"
|
- alias: "Cube event flip90"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.cube_action
|
event_type: xiaomi_aqara.cube_action
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
||||||
action_type: flip90
|
action_type: flip90
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.gateway_light_28xxxxxxxxxx
|
entity_id: light.gateway_light_28xxxxxxxxxx
|
||||||
data:
|
data:
|
||||||
color_name: "springgreen"
|
color_name: "springgreen"
|
||||||
- alias: "Cube event flip180"
|
- alias: "Cube event flip180"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.cube_action
|
event_type: xiaomi_aqara.cube_action
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
||||||
action_type: flip180
|
action_type: flip180
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.gateway_light_28xxxxxxxxxx
|
entity_id: light.gateway_light_28xxxxxxxxxx
|
||||||
data:
|
data:
|
||||||
color_name: "darkviolet"
|
color_name: "darkviolet"
|
||||||
- alias: "Cube event move"
|
- alias: "Cube event move"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.cube_action
|
event_type: xiaomi_aqara.cube_action
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
||||||
action_type: move
|
action_type: move
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.gateway_light_28xxxxxxxxxx
|
entity_id: light.gateway_light_28xxxxxxxxxx
|
||||||
data:
|
data:
|
||||||
color_name: "gold"
|
color_name: "gold"
|
||||||
- alias: "Cube event tap_twice"
|
- alias: "Cube event tap_twice"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.cube_action
|
event_type: xiaomi_aqara.cube_action
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
||||||
action_type: tap_twice
|
action_type: tap_twice
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.gateway_light_28xxxxxxxxxx
|
entity_id: light.gateway_light_28xxxxxxxxxx
|
||||||
data:
|
data:
|
||||||
color_name: "deepskyblue"
|
color_name: "deepskyblue"
|
||||||
- alias: "Cube event shake_air"
|
- alias: "Cube event shake_air"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.cube_action
|
event_type: xiaomi_aqara.cube_action
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
entity_id: binary_sensor.cube_15xxxxxxxxxxxx
|
||||||
action_type: shake_air
|
action_type: shake_air
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.gateway_light_28xxxxxxxxxx
|
entity_id: light.gateway_light_28xxxxxxxxxx
|
||||||
@ -282,13 +282,13 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Decrease brightness of the gateway light"
|
- alias: "Decrease brightness of the gateway light"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.click
|
event_type: xiaomi_aqara.click
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.wall_switch_left_158xxxxxxxxx12
|
entity_id: binary_sensor.wall_switch_left_158xxxxxxxxx12
|
||||||
click_type: single
|
click_type: single
|
||||||
action:
|
actions:
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.gateway_light_34xxxxxxxx13
|
entity_id: light.gateway_light_34xxxxxxxx13
|
||||||
@ -305,13 +305,13 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- alias: "Increase brightness of the gateway light"
|
- alias: "Increase brightness of the gateway light"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.click
|
event_type: xiaomi_aqara.click
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.wall_switch_right_158xxxxxxxxx12
|
entity_id: binary_sensor.wall_switch_right_158xxxxxxxxx12
|
||||||
click_type: single
|
click_type: single
|
||||||
action:
|
actions:
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.gateway_light_34xxxxxxxx13
|
entity_id: light.gateway_light_34xxxxxxxx13
|
||||||
@ -328,13 +328,13 @@ The Aqara Wireless Switch is available as single-key and double-key version. Eac
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
- alias: "Turn off the gateway light"
|
- alias: "Turn off the gateway light"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.click
|
event_type: xiaomi_aqara.click
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.wall_switch_both_158xxxxxxxxx12
|
entity_id: binary_sensor.wall_switch_both_158xxxxxxxxx12
|
||||||
click_type: both
|
click_type: both
|
||||||
action:
|
actions:
|
||||||
action: light.turn_off
|
action: light.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: light.gateway_light_34xxxxxxxx13
|
entity_id: light.gateway_light_34xxxxxxxx13
|
||||||
@ -348,24 +348,24 @@ This automation toggles the living room lamp on vibration/tilt.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Turn on Living Room Lamp on vibration"
|
- alias: "Turn on Living Room Lamp on vibration"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.movement
|
event_type: xiaomi_aqara.movement
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.vibration_xxxx000000
|
entity_id: binary_sensor.vibration_xxxx000000
|
||||||
movement_type: vibrate
|
movement_type: vibrate
|
||||||
action:
|
actions:
|
||||||
action: light.toggle
|
action: light.toggle
|
||||||
target:
|
target:
|
||||||
entity_id: light.living_room_lamp
|
entity_id: light.living_room_lamp
|
||||||
- alias: "Turn on Living Room Lamp on tilt"
|
- alias: "Turn on Living Room Lamp on tilt"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: xiaomi_aqara.movement
|
event_type: xiaomi_aqara.movement
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: binary_sensor.vibration_xxxx000000
|
entity_id: binary_sensor.vibration_xxxx000000
|
||||||
movement_type: tilt
|
movement_type: tilt
|
||||||
action:
|
actions:
|
||||||
action: light.toggle
|
action: light.toggle
|
||||||
target:
|
target:
|
||||||
entity_id: light.living_room_lamp
|
entity_id: light.living_room_lamp
|
||||||
|
@ -135,11 +135,11 @@ Here, this example assumes your blink module is named `My Sync Module` and that
|
|||||||
```yaml
|
```yaml
|
||||||
- id: arm_blink_when_away
|
- id: arm_blink_when_away
|
||||||
alias: "Arm Blink When Away"
|
alias: "Arm Blink When Away"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: all
|
entity_id: all
|
||||||
to: "not_home"
|
to: "not_home"
|
||||||
action:
|
actions:
|
||||||
action: alarm_control_panel.alarm_arm_away
|
action: alarm_control_panel.alarm_arm_away
|
||||||
target:
|
target:
|
||||||
entity_id: alarm_control_panel.blink_my_sync_module
|
entity_id: alarm_control_panel.blink_my_sync_module
|
||||||
@ -152,11 +152,11 @@ Similar to the previous example, this automation will disarm blink when arriving
|
|||||||
```yaml
|
```yaml
|
||||||
- id: disarm_blink_when_home
|
- id: disarm_blink_when_home
|
||||||
alias: "Disarm Blink When Home"
|
alias: "Disarm Blink When Home"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: all
|
entity_id: all
|
||||||
to: "home"
|
to: "home"
|
||||||
action:
|
actions:
|
||||||
action: alarm_control_panel.alarm_disarm
|
action: alarm_control_panel.alarm_disarm
|
||||||
target:
|
target:
|
||||||
entity_id: alarm_control_panel.blink_my_sync_module
|
entity_id: alarm_control_panel.blink_my_sync_module
|
||||||
@ -173,11 +173,11 @@ The following example assumes your camera's name (in the Blink app) is `My Camer
|
|||||||
```yaml
|
```yaml
|
||||||
- id: save_blink_video_on_motion
|
- id: save_blink_video_on_motion
|
||||||
alias: "Save Blink Video on Motion"
|
alias: "Save Blink Video on Motion"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.blink_my_camera_motion_detected
|
entity_id: binary_sensor.blink_my_camera_motion_detected
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- action: blink.save_video
|
- action: blink.save_video
|
||||||
target:
|
target:
|
||||||
entity_id: camera.blink_my_camera
|
entity_id: camera.blink_my_camera
|
||||||
@ -202,10 +202,10 @@ The file name of the downloaded video file is not configurable.
|
|||||||
```yaml
|
```yaml
|
||||||
- id: save_recent_clips_from_my_camera
|
- id: save_recent_clips_from_my_camera
|
||||||
alias: "Save Recent Clips from My Camera"
|
alias: "Save Recent Clips from My Camera"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
minutes: /3
|
minutes: /3
|
||||||
action:
|
actions:
|
||||||
- action: blink.save_recent_clips
|
- action: blink.save_recent_clips
|
||||||
target:
|
target:
|
||||||
entity_id: camera.my_camera
|
entity_id: camera.my_camera
|
||||||
|
@ -79,7 +79,7 @@ The name of the action is `notify.bmw_connected_drive_<your_vehicle>`.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: notify.bmw_connected_drive_<your_vehicle>
|
action: notify.bmw_connected_drive_<your_vehicle>
|
||||||
data:
|
data:
|
||||||
message: The name of the POI # this is shown on the iDrive dashboard
|
message: The name of the POI # this is shown on the iDrive dashboard
|
||||||
|
@ -57,7 +57,7 @@ The **Bring** integration offers an action to send push notifications to the Bri
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: bring.send_message
|
action: bring.send_message
|
||||||
target:
|
target:
|
||||||
entity_id: todo.bring_shoppinglist
|
entity_id: todo.bring_shoppinglist
|
||||||
@ -71,7 +71,7 @@ Note that for the notification type `urgent_message` the attribute `item` is **r
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: bring.send_message
|
action: bring.send_message
|
||||||
target:
|
target:
|
||||||
entity_id: todo.bring_shoppinglist
|
entity_id: todo.bring_shoppinglist
|
||||||
|
@ -45,10 +45,10 @@ Because the {% term state %} of a button entity in Home Assistant is a timestamp
|
|||||||
means we can use it in our automations. For example:
|
means we can use it in our automations. For example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: button.my_button
|
entity_id: button.my_button
|
||||||
action:
|
actions:
|
||||||
- action: notify.frenck
|
- action: notify.frenck
|
||||||
data:
|
data:
|
||||||
message: "My button has been pressed!"
|
message: "My button has been pressed!"
|
||||||
|
@ -63,7 +63,7 @@ An example of a calendar {% term trigger %} in YAML:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: calendar
|
- platform: calendar
|
||||||
# Possible values: start, end
|
# Possible values: start, end
|
||||||
event: start
|
event: start
|
||||||
@ -99,11 +99,11 @@ This example automation consists of:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: Calendar notification
|
- alias: Calendar notification
|
||||||
trigger:
|
triggers:
|
||||||
- platform: calendar
|
- platform: calendar
|
||||||
event: start
|
event: start
|
||||||
entity_id: calendar.personal
|
entity_id: calendar.personal
|
||||||
action:
|
actions:
|
||||||
- action: persistent_notification.create
|
- action: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
message: >-
|
message: >-
|
||||||
@ -126,17 +126,17 @@ This example consists of:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: Front Light Schedule
|
- alias: Front Light Schedule
|
||||||
trigger:
|
triggers:
|
||||||
- platform: calendar
|
- platform: calendar
|
||||||
event: start
|
event: start
|
||||||
entity_id: calendar.device_automation
|
entity_id: calendar.device_automation
|
||||||
- platform: calendar
|
- platform: calendar
|
||||||
event: end
|
event: end
|
||||||
entity_id: calendar.device_automation
|
entity_id: calendar.device_automation
|
||||||
condition:
|
conditions:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ 'Front Lights' in trigger.calendar_event.summary }}"
|
value_template: "{{ 'Front Lights' in trigger.calendar_event.summary }}"
|
||||||
action:
|
actions:
|
||||||
- if:
|
- if:
|
||||||
- "{{ trigger.event == 'start' }}"
|
- "{{ trigger.event == 'start' }}"
|
||||||
then:
|
then:
|
||||||
|
@ -74,7 +74,7 @@ Play a live stream from a camera to selected media player(s). Requires [`stream`
|
|||||||
For example, the following action in an automation would send an `hls` live stream to your chromecast.
|
For example, the following action in an automation would send an `hls` live stream to your chromecast.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: camera.play_stream
|
action: camera.play_stream
|
||||||
target:
|
target:
|
||||||
entity_id: camera.yourcamera
|
entity_id: camera.yourcamera
|
||||||
@ -102,7 +102,7 @@ For example, the following action in an automation would take a recording from "
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: camera.record
|
action: camera.record
|
||||||
target:
|
target:
|
||||||
entity_id: camera.yourcamera
|
entity_id: camera.yourcamera
|
||||||
@ -128,7 +128,7 @@ For example, the following action in an automation would take a snapshot from "y
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: camera.snapshot
|
action: camera.snapshot
|
||||||
target:
|
target:
|
||||||
entity_id: camera.yourcamera
|
entity_id: camera.yourcamera
|
||||||
|
@ -65,10 +65,10 @@ Here are the automations for the above screenshot:
|
|||||||
# Rich Text Example 1.
|
# Rich Text Example 1.
|
||||||
# Show a one line message with a red banner
|
# Show a one line message with a red banner
|
||||||
- alias: "Notify On Build Failing"
|
- alias: "Notify On Build Failing"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: webhook
|
- platform: webhook
|
||||||
webhook_id: build_failed
|
webhook_id: build_failed
|
||||||
action:
|
actions:
|
||||||
action: notify.cisco_webex_teams_notify
|
action: notify.cisco_webex_teams_notify
|
||||||
data:
|
data:
|
||||||
message: "<blockquote class=danger>Build 0.89.5 compile failed."
|
message: "<blockquote class=danger>Build 0.89.5 compile failed."
|
||||||
@ -78,10 +78,10 @@ Here are the automations for the above screenshot:
|
|||||||
# Show a title and multi-line message with a yellow banner,
|
# Show a title and multi-line message with a yellow banner,
|
||||||
# with lists, a person mention and a link
|
# with lists, a person mention and a link
|
||||||
- alias: "Notify On Build Unstable"
|
- alias: "Notify On Build Unstable"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: webhook
|
- platform: webhook
|
||||||
webhook_id: build_unstable
|
webhook_id: build_unstable
|
||||||
action:
|
actions:
|
||||||
action: notify.cisco_webex_teams_notify
|
action: notify.cisco_webex_teams_notify
|
||||||
data:
|
data:
|
||||||
title: "<strong>Build 0.89.6 is unstable.</strong>"
|
title: "<strong>Build 0.89.6 is unstable.</strong>"
|
||||||
@ -101,10 +101,10 @@ Here are the automations for the above screenshot:
|
|||||||
# Show a title and multi-line message with a blue banner,
|
# Show a title and multi-line message with a blue banner,
|
||||||
# with lists, a person mention and a link
|
# with lists, a person mention and a link
|
||||||
- alias: "Notify On Build Passing"
|
- alias: "Notify On Build Passing"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: webhook
|
- platform: webhook
|
||||||
webhook_id: build_passed
|
webhook_id: build_passed
|
||||||
action:
|
actions:
|
||||||
action: notify.cisco_webex_teams_notify
|
action: notify.cisco_webex_teams_notify
|
||||||
data:
|
data:
|
||||||
title: "<strong>✅ Version 0.89.7 passed all tests and deployed to production!</strong>"
|
title: "<strong>✅ Version 0.89.7 passed all tests and deployed to production!</strong>"
|
||||||
|
@ -61,10 +61,10 @@ ClickSend is a notify platform and thus can be controlled by calling the notify
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
alias: "The sun has set"
|
alias: "The sun has set"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: sun
|
- platform: sun
|
||||||
event: sunset
|
event: sunset
|
||||||
action:
|
actions:
|
||||||
- action: notify.clicksend_tts
|
- action: notify.clicksend_tts
|
||||||
data:
|
data:
|
||||||
message: "The sun has set"
|
message: "The sun has set"
|
||||||
|
@ -52,10 +52,10 @@ Turn auxiliary heater on/off for climate device
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: climate.set_aux_heat
|
- action: climate.set_aux_heat
|
||||||
target:
|
target:
|
||||||
entity_id: climate.kitchen
|
entity_id: climate.kitchen
|
||||||
@ -78,10 +78,10 @@ reflecting a situation where the climate device is set to save energy. For examp
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: climate.set_preset_mode
|
- action: climate.set_preset_mode
|
||||||
target:
|
target:
|
||||||
entity_id: climate.kitchen
|
entity_id: climate.kitchen
|
||||||
@ -106,10 +106,10 @@ Set target temperature of climate device
|
|||||||
```yaml
|
```yaml
|
||||||
### Set temperature to 24 in heat mode
|
### Set temperature to 24 in heat mode
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: climate.set_temperature
|
- action: climate.set_temperature
|
||||||
target:
|
target:
|
||||||
entity_id: climate.kitchen
|
entity_id: climate.kitchen
|
||||||
@ -121,10 +121,10 @@ automation:
|
|||||||
```yaml
|
```yaml
|
||||||
### Set temperature range to 20 to 24 in heat_cool mode
|
### Set temperature range to 20 to 24 in heat_cool mode
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: climate.set_temperature
|
- action: climate.set_temperature
|
||||||
target:
|
target:
|
||||||
entity_id: climate.kitchen
|
entity_id: climate.kitchen
|
||||||
@ -147,10 +147,10 @@ Set target humidity of climate device
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: climate.set_humidity
|
- action: climate.set_humidity
|
||||||
target:
|
target:
|
||||||
entity_id: climate.kitchen
|
entity_id: climate.kitchen
|
||||||
@ -171,10 +171,10 @@ Set fan operation for climate device
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: climate.set_fan_mode
|
- action: climate.set_fan_mode
|
||||||
target:
|
target:
|
||||||
entity_id: climate.kitchen
|
entity_id: climate.kitchen
|
||||||
@ -195,10 +195,10 @@ Set climate device's HVAC mode
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: climate.set_hvac_mode
|
- action: climate.set_hvac_mode
|
||||||
target:
|
target:
|
||||||
entity_id: climate.kitchen
|
entity_id: climate.kitchen
|
||||||
@ -219,10 +219,10 @@ Set swing operation mode for climate device
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: climate.set_swing_mode
|
- action: climate.set_swing_mode
|
||||||
target:
|
target:
|
||||||
entity_id: climate.kitchen
|
entity_id: climate.kitchen
|
||||||
|
@ -54,11 +54,11 @@ Example usage in an {% term automation %}, taking the album art present on a Chr
|
|||||||
#automation.yaml
|
#automation.yaml
|
||||||
- alias: "Chromecast to Shelf Lights"
|
- alias: "Chromecast to Shelf Lights"
|
||||||
|
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: media_player.chromecast
|
entity_id: media_player.chromecast
|
||||||
|
|
||||||
action:
|
actions:
|
||||||
- action: color_extractor.turn_on
|
- action: color_extractor.turn_on
|
||||||
data_template:
|
data_template:
|
||||||
color_extract_url: "{{ states.media_player.chromecast.attributes.entity_picture }}"
|
color_extract_url: "{{ states.media_player.chromecast.attributes.entity_picture }}"
|
||||||
@ -71,11 +71,11 @@ With a nicer transition period of 5 seconds and setting brightness to 100% each
|
|||||||
#automation.yaml
|
#automation.yaml
|
||||||
- alias: "Nicer Chromecast to Shelf Lights"
|
- alias: "Nicer Chromecast to Shelf Lights"
|
||||||
|
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: media_player.chromecast
|
entity_id: media_player.chromecast
|
||||||
|
|
||||||
action:
|
actions:
|
||||||
- action: color_extractor.turn_on
|
- action: color_extractor.turn_on
|
||||||
data_template:
|
data_template:
|
||||||
color_extract_url: "{{ states.media_player.chromecast.attributes.entity_picture }}"
|
color_extract_url: "{{ states.media_player.chromecast.attributes.entity_picture }}"
|
||||||
|
@ -149,12 +149,12 @@ system_log:
|
|||||||
automation:
|
automation:
|
||||||
- id: 'errorcounterautomation'
|
- id: 'errorcounterautomation'
|
||||||
alias: "Error Counting Automation"
|
alias: "Error Counting Automation"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: system_log_event
|
event_type: system_log_event
|
||||||
event_data:
|
event_data:
|
||||||
level: ERROR
|
level: ERROR
|
||||||
action:
|
actions:
|
||||||
action: counter.increment
|
action: counter.increment
|
||||||
target:
|
target:
|
||||||
entity_id: counter.error_counter
|
entity_id: counter.error_counter
|
||||||
|
@ -75,10 +75,10 @@ Available actions: `cover.open_cover`, `cover.close_cover`, `cover.stop_cover`,
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: cover.open_cover
|
- action: cover.open_cover
|
||||||
target:
|
target:
|
||||||
entity_id: cover.demo
|
entity_id: cover.demo
|
||||||
@ -97,10 +97,10 @@ Set cover position of one or multiple covers.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: cover.set_cover_position
|
- action: cover.set_cover_position
|
||||||
target:
|
target:
|
||||||
entity_id: cover.demo
|
entity_id: cover.demo
|
||||||
@ -121,10 +121,10 @@ Set cover tilt position of one or multiple covers.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: cover.set_cover_tilt_position
|
- action: cover.set_cover_tilt_position
|
||||||
target:
|
target:
|
||||||
entity_id: cover.demo
|
entity_id: cover.demo
|
||||||
|
@ -291,11 +291,11 @@ script:
|
|||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: "Close covers at night"
|
- alias: "Close covers at night"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: sun
|
- platform: sun
|
||||||
event: sunset
|
event: sunset
|
||||||
offset: "+00:30:00"
|
offset: "+00:30:00"
|
||||||
action:
|
actions:
|
||||||
- action: cover.set_cover_position
|
- action: cover.set_cover_position
|
||||||
target:
|
target:
|
||||||
entity_id: cover.cover_group
|
entity_id: cover.cover_group
|
||||||
|
@ -194,26 +194,26 @@ If you have a Zigbee remote that is not yet supported you can request support fo
|
|||||||
automation:
|
automation:
|
||||||
- alias: "'Toggle lamp from dimmer'"
|
- alias: "'Toggle lamp from dimmer'"
|
||||||
initial_state: "on"
|
initial_state: "on"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: deconz_event
|
event_type: deconz_event
|
||||||
event_data:
|
event_data:
|
||||||
id: remote_control_1
|
id: remote_control_1
|
||||||
event: 1002
|
event: 1002
|
||||||
action:
|
actions:
|
||||||
- action: light.toggle
|
- action: light.toggle
|
||||||
target:
|
target:
|
||||||
entity_id: light.lamp
|
entity_id: light.lamp
|
||||||
|
|
||||||
- alias: "Increase brightness of lamp from dimmer"
|
- alias: "Increase brightness of lamp from dimmer"
|
||||||
initial_state: "on"
|
initial_state: "on"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: deconz_event
|
event_type: deconz_event
|
||||||
event_data:
|
event_data:
|
||||||
id: remote_control_1
|
id: remote_control_1
|
||||||
event: 2002
|
event: 2002
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.lamp
|
entity_id: light.lamp
|
||||||
@ -224,13 +224,13 @@ automation:
|
|||||||
|
|
||||||
- alias: "Decrease brightness of lamp from dimmer"
|
- alias: "Decrease brightness of lamp from dimmer"
|
||||||
initial_state: "on"
|
initial_state: "on"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: deconz_event
|
event_type: deconz_event
|
||||||
event_data:
|
event_data:
|
||||||
id: remote_control_1
|
id: remote_control_1
|
||||||
event: 3002
|
event: 3002
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.lamp
|
entity_id: light.lamp
|
||||||
@ -241,13 +241,13 @@ automation:
|
|||||||
|
|
||||||
- alias: 'Turn lamp on when turning cube clockwise'
|
- alias: 'Turn lamp on when turning cube clockwise'
|
||||||
initial_state: "on"
|
initial_state: "on"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: deconz_event
|
event_type: deconz_event
|
||||||
event_data:
|
event_data:
|
||||||
id: remote_control_1
|
id: remote_control_1
|
||||||
gesture: 7
|
gesture: 7
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.lamp
|
entity_id: light.lamp
|
||||||
@ -262,13 +262,13 @@ automation:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "React to color wheel changes"
|
- alias: "React to color wheel changes"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: deconz_event
|
event_type: deconz_event
|
||||||
event_data:
|
event_data:
|
||||||
id: tint_remote_1
|
id: tint_remote_1
|
||||||
event: 6002
|
event: 6002
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
data:
|
data:
|
||||||
xy_color:
|
xy_color:
|
||||||
@ -288,11 +288,11 @@ Note: Requires `on: true` to change color while the Philips Hue bulb is off. If
|
|||||||
automation:
|
automation:
|
||||||
- alias: "Flash Hue Bulb with Doorbell Motion"
|
- alias: "Flash Hue Bulb with Doorbell Motion"
|
||||||
mode: single
|
mode: single
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.doorbell_motion
|
entity_id: binary_sensor.doorbell_motion
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- action: deconz.configure
|
- action: deconz.configure
|
||||||
data:
|
data:
|
||||||
entity: light.hue_lamp
|
entity: light.hue_lamp
|
||||||
|
@ -22,12 +22,12 @@ Example:
|
|||||||
```yaml
|
```yaml
|
||||||
- id: "123456789"
|
- id: "123456789"
|
||||||
alias: "Light turns off"
|
alias: "Light turns off"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: device
|
- platform: device
|
||||||
device_id: 7a92d5ee74014a0b86903fc669b0bcd6
|
device_id: 7a92d5ee74014a0b86903fc669b0bcd6
|
||||||
domain: light
|
domain: light
|
||||||
type: turn_off
|
type: turn_off
|
||||||
entity_id: light.bowl
|
entity_id: light.bowl
|
||||||
action:
|
actions:
|
||||||
- action: camera.turn_off
|
- action: camera.turn_off
|
||||||
```
|
```
|
||||||
|
@ -47,14 +47,14 @@ If you have a sensor session running, and once you have enabled the Dexcom integ
|
|||||||
- id: '1234567890123'
|
- id: '1234567890123'
|
||||||
alias: "overnight_low_kitchen_lights"
|
alias: "overnight_low_kitchen_lights"
|
||||||
description: Turn on the lights in the kitchen if my blood sugar drops low overnight
|
description: Turn on the lights in the kitchen if my blood sugar drops low overnight
|
||||||
trigger:
|
triggers:
|
||||||
- below: '65'
|
- below: '65'
|
||||||
entity_id: sensor.dexcom_YOUR_USERNAME_glucose_value
|
entity_id: sensor.dexcom_YOUR_USERNAME_glucose_value
|
||||||
platform: numeric_state
|
platform: numeric_state
|
||||||
condition: time
|
condition: time
|
||||||
after: "22:00:00"
|
after: "22:00:00"
|
||||||
before: "06:00:00"
|
before: "06:00:00"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.kitchen
|
entity_id: light.kitchen
|
||||||
|
@ -108,7 +108,7 @@ intent_script:
|
|||||||
TurnLights:
|
TurnLights:
|
||||||
speech:
|
speech:
|
||||||
text: Turning {{ Room }} lights {{ OnOff }}
|
text: Turning {{ Room }} lights {{ OnOff }}
|
||||||
action:
|
actions:
|
||||||
- action: notify.pushbullet
|
- action: notify.pushbullet
|
||||||
data:
|
data:
|
||||||
message: Someone asked via apiai to turn {{ Room }} lights {{ OnOff }}
|
message: Someone asked via apiai to turn {{ Room }} lights {{ OnOff }}
|
||||||
|
@ -215,11 +215,11 @@ image_processing:
|
|||||||
```yaml
|
```yaml
|
||||||
# Example advanced automations.yaml entry
|
# Example advanced automations.yaml entry
|
||||||
- alias: "Doods scanning"
|
- alias: "Doods scanning"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id:
|
entity_id:
|
||||||
- binary_sensor.driveway
|
- binary_sensor.driveway
|
||||||
action:
|
actions:
|
||||||
- action: image_processing.scan
|
- action: image_processing.scan
|
||||||
target:
|
target:
|
||||||
entity_id: image_processing.doods_camera_driveway
|
entity_id: image_processing.doods_camera_driveway
|
||||||
|
@ -104,10 +104,10 @@ The example automation below shows how to turn on a light when somebody presses
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Doorbird Ring"
|
- alias: "Doorbird Ring"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: doorbird_driveway_gate_somebody_pressed_the_button
|
event_type: doorbird_driveway_gate_somebody_pressed_the_button
|
||||||
action:
|
actions:
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.side_entry_porch
|
entity_id: light.side_entry_porch
|
||||||
|
@ -76,10 +76,10 @@ This is a notify platform and thus can be controlled by calling the notify actio
|
|||||||
# Example automation notification entry
|
# Example automation notification entry
|
||||||
automation:
|
automation:
|
||||||
- alias: "The sun has set"
|
- alias: "The sun has set"
|
||||||
trigger:
|
triggers:
|
||||||
platform: sun
|
platform: sun
|
||||||
event: sunset
|
event: sunset
|
||||||
action:
|
actions:
|
||||||
action: notify.dovado
|
action: notify.dovado
|
||||||
data:
|
data:
|
||||||
message: "The sun has set"
|
message: "The sun has set"
|
||||||
|
@ -51,10 +51,10 @@ Along with the event the following payload parameters are available:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Download Failed Notification"
|
- alias: "Download Failed Notification"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: downloader_download_failed
|
event_type: downloader_download_failed
|
||||||
action:
|
actions:
|
||||||
action: persistent_notification.create
|
action: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
message: "{{trigger.event.data.filename}} download failed"
|
message: "{{trigger.event.data.filename}} download failed"
|
||||||
|
@ -167,10 +167,10 @@ You can use the response data in a template sensor that is updated every hour:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
template:
|
template:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
seconds: "*"
|
seconds: "*"
|
||||||
action:
|
actions:
|
||||||
- action: easyenergy.get_energy_usage_prices
|
- action: easyenergy.get_energy_usage_prices
|
||||||
response_variable: response
|
response_variable: response
|
||||||
data:
|
data:
|
||||||
|
@ -82,11 +82,11 @@ a binary sensor (a doorbell) is triggered:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: Visual doorbell notification example
|
- alias: Visual doorbell notification example
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.doorbell
|
entity_id: binary_sensor.doorbell
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- action: elgato.identify
|
- action: elgato.identify
|
||||||
target:
|
target:
|
||||||
entity_id: light.elgato_key_light
|
entity_id: light.elgato_key_light
|
||||||
|
@ -116,14 +116,14 @@ The following is an example implementation of an automation:
|
|||||||
# Example automation
|
# Example automation
|
||||||
- id: amp_volume_up
|
- id: amp_volume_up
|
||||||
alias: "Increase amplifier volume"
|
alias: "Increase amplifier volume"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: roku_command
|
event_type: roku_command
|
||||||
event_data:
|
event_data:
|
||||||
source_name: Home Assistant
|
source_name: Home Assistant
|
||||||
type: keypress
|
type: keypress
|
||||||
key: Fwd
|
key: Fwd
|
||||||
action:
|
actions:
|
||||||
- action: media_player.volume_up
|
- action: media_player.volume_up
|
||||||
target:
|
target:
|
||||||
entity_id: media_player.amplifier
|
entity_id: media_player.amplifier
|
||||||
|
@ -136,10 +136,10 @@ The response data can be added to a template sensor:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
template:
|
template:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
hours: "*"
|
hours: "*"
|
||||||
action:
|
actions:
|
||||||
- action: energyzero.get_energy_prices
|
- action: energyzero.get_energy_prices
|
||||||
response_variable: prices
|
response_variable: prices
|
||||||
data:
|
data:
|
||||||
|
@ -111,13 +111,13 @@ Sample automation to switch lights on and off:
|
|||||||
# Example automation to turn lights on/off on button release
|
# Example automation to turn lights on/off on button release
|
||||||
automation:
|
automation:
|
||||||
- alias: "Hall light switches"
|
- alias: "Hall light switches"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: button_pressed
|
event_type: button_pressed
|
||||||
event_data:
|
event_data:
|
||||||
id: [0xYY, 0xYY, 0xYY, 0xYY]
|
id: [0xYY, 0xYY, 0xYY, 0xYY]
|
||||||
pushed: 0
|
pushed: 0
|
||||||
action:
|
actions:
|
||||||
action: "{% if trigger.event.data.onoff %} light.turn_on {% else %} light.turn_off {%endif %}"
|
action: "{% if trigger.event.data.onoff %} light.turn_on {% else %} light.turn_off {%endif %}"
|
||||||
target:
|
target:
|
||||||
entity_id: "{% if trigger.event.data.which == 1 %} light.hall_left {% else %} light.hall_right {%endif %}"
|
entity_id: "{% if trigger.event.data.which == 1 %} light.hall_left {% else %} light.hall_right {%endif %}"
|
||||||
|
@ -45,10 +45,10 @@ In addition, the entity can have the following states:
|
|||||||
Because the state of an event entity in Home Assistant is a timestamp, it means we can use it in our automations. For example:
|
Because the state of an event entity in Home Assistant is a timestamp, it means we can use it in our automations. For example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: event.doorbell
|
entity_id: event.doorbell
|
||||||
action:
|
actions:
|
||||||
- action: notify.frenck
|
- action: notify.frenck
|
||||||
data:
|
data:
|
||||||
message: "Ding Dong! Someone is at the door!"
|
message: "Ding Dong! Someone is at the door!"
|
||||||
@ -63,10 +63,10 @@ This allows you, for example, to trigger a different action when the button on a
|
|||||||
When combining that with the [choose action](/docs/scripts/#choose-a-group-of-actions) script, you can assign multiple different actions to a single event entity. In the following example, short- or long-pressing the button on the remote will trigger a different scene:
|
When combining that with the [choose action](/docs/scripts/#choose-a-group-of-actions) script, you can assign multiple different actions to a single event entity. In the following example, short- or long-pressing the button on the remote will trigger a different scene:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: event.hue_remote_control
|
entity_id: event.hue_remote_control
|
||||||
action:
|
actions:
|
||||||
- alias: "Choose an action based on the type of event"
|
- alias: "Choose an action based on the type of event"
|
||||||
choose:
|
choose:
|
||||||
- conditions:
|
- conditions:
|
||||||
|
@ -129,7 +129,7 @@ This action call will set the operating `mode` of the system for a specified per
|
|||||||
For **AutoWithEco**, the period of time is a `duration` is up to 24 hours.
|
For **AutoWithEco**, the period of time is a `duration` is up to 24 hours.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- action:
|
- actions:
|
||||||
- action: evohome.set_system_mode
|
- action: evohome.set_system_mode
|
||||||
data:
|
data:
|
||||||
mode: AutoWithEco
|
mode: AutoWithEco
|
||||||
@ -139,7 +139,7 @@ For **AutoWithEco**, the period of time is a `duration` is up to 24 hours.
|
|||||||
For the other modes, such as **Away**, the duration is a `period` of days, where 1 day will revert at midnight tonight, and 2 days reverts at midnight tomorrow.
|
For the other modes, such as **Away**, the duration is a `period` of days, where 1 day will revert at midnight tonight, and 2 days reverts at midnight tomorrow.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- action:
|
- actions:
|
||||||
- action: evohome.set_system_mode
|
- action: evohome.set_system_mode
|
||||||
data:
|
data:
|
||||||
mode: Away
|
mode: Away
|
||||||
@ -161,7 +161,7 @@ This action will immediately pull the latest state data from the vendor's server
|
|||||||
This action will set the `setpoint` of a zone, as identified by its `entity_id`, for a specified period of time (**TemporaryOverride**). However, if no period of time is provided (c.f. a duration of 0, below), then the change is permanent (**PermanentOverride**).
|
This action will set the `setpoint` of a zone, as identified by its `entity_id`, for a specified period of time (**TemporaryOverride**). However, if no period of time is provided (c.f. a duration of 0, below), then the change is permanent (**PermanentOverride**).
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- action:
|
- actions:
|
||||||
- action: evohome.set_zone_override
|
- action: evohome.set_zone_override
|
||||||
target:
|
target:
|
||||||
entity_id: climate.loungeroom
|
entity_id: climate.loungeroom
|
||||||
@ -172,7 +172,7 @@ This action will set the `setpoint` of a zone, as identified by its `entity_id`,
|
|||||||
The `duration` can be up to 24 hours, after which the zone mode will revert to schedule (**FollowSchedule**). If the `duration` is 0 hours, then the change will be until the next setpoint.
|
The `duration` can be up to 24 hours, after which the zone mode will revert to schedule (**FollowSchedule**). If the `duration` is 0 hours, then the change will be until the next setpoint.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- action:
|
- actions:
|
||||||
- action: evohome.set_zone_override
|
- action: evohome.set_zone_override
|
||||||
target:
|
target:
|
||||||
entity_id: climate.loungeroom
|
entity_id: climate.loungeroom
|
||||||
|
@ -48,10 +48,10 @@ The phone number used in **target** should be registered with Facebook messenger
|
|||||||
# Example automation notification entry
|
# Example automation notification entry
|
||||||
automation:
|
automation:
|
||||||
- alias: "Evening Greeting"
|
- alias: "Evening Greeting"
|
||||||
trigger:
|
triggers:
|
||||||
platform: sun
|
platform: sun
|
||||||
event: sunset
|
event: sunset
|
||||||
action:
|
actions:
|
||||||
action: notify.facebook
|
action: notify.facebook
|
||||||
data:
|
data:
|
||||||
message: "Good Evening"
|
message: "Good Evening"
|
||||||
|
@ -50,10 +50,10 @@ Sets the speed percentage for fan device.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: fan.set_percentage
|
- action: fan.set_percentage
|
||||||
target:
|
target:
|
||||||
entity_id: fan.kitchen
|
entity_id: fan.kitchen
|
||||||
@ -74,10 +74,10 @@ Sets a preset mode for the fan device. Available preset modes are defined by the
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: fan.set_preset_mode
|
- action: fan.set_preset_mode
|
||||||
target:
|
target:
|
||||||
entity_id: fan.kitchen
|
entity_id: fan.kitchen
|
||||||
@ -98,10 +98,10 @@ Sets the rotation for fan device.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: fan.set_direction
|
- action: fan.set_direction
|
||||||
target:
|
target:
|
||||||
entity_id: fan.kitchen
|
entity_id: fan.kitchen
|
||||||
@ -122,10 +122,10 @@ Sets the oscillation for fan device.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: fan.oscillate
|
- action: fan.oscillate
|
||||||
target:
|
target:
|
||||||
entity_id: fan.kitchen
|
entity_id: fan.kitchen
|
||||||
@ -156,10 +156,10 @@ Turn fan device off. This is only supported if the fan device supports being tur
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: fan.turn_off
|
- action: fan.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: fan.kitchen
|
entity_id: fan.kitchen
|
||||||
@ -180,13 +180,13 @@ Increases the speed of the fan device.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: device
|
- platform: device
|
||||||
device_id: 097cd9f706a86e9163acb64ba7d630da
|
device_id: 097cd9f706a86e9163acb64ba7d630da
|
||||||
domain: lutron_caseta
|
domain: lutron_caseta
|
||||||
type: press
|
type: press
|
||||||
subtype: raise
|
subtype: raise
|
||||||
action:
|
actions:
|
||||||
- action: fan.increase_speed
|
- action: fan.increase_speed
|
||||||
target:
|
target:
|
||||||
entity_id: fan.dining_room_fan_by_front_door
|
entity_id: fan.dining_room_fan_by_front_door
|
||||||
@ -205,13 +205,13 @@ Decreases the speed of the fan device.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: device
|
- platform: device
|
||||||
device_id: 097cd9f706a86e9163acb64ba7d630da
|
device_id: 097cd9f706a86e9163acb64ba7d630da
|
||||||
domain: lutron_caseta
|
domain: lutron_caseta
|
||||||
type: press
|
type: press
|
||||||
subtype: lower
|
subtype: lower
|
||||||
action:
|
actions:
|
||||||
- action: fan.decrease_speed
|
- action: fan.decrease_speed
|
||||||
target:
|
target:
|
||||||
entity_id: fan.dining_room_fan_by_front_door
|
entity_id: fan.dining_room_fan_by_front_door
|
||||||
|
@ -29,10 +29,10 @@ Feedreader events can be used out of the box to trigger automation actions, e.g.
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Trigger action when new element(s) in RSS feed"
|
- alias: "Trigger action when new element(s) in RSS feed"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: feedreader
|
event_type: feedreader
|
||||||
action:
|
actions:
|
||||||
action: script.turn_on
|
action: script.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: script.my_action
|
entity_id: script.my_action
|
||||||
@ -43,12 +43,12 @@ automation:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Send notification of RSS feed title when updated"
|
- alias: "Send notification of RSS feed title when updated"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: feedreader
|
event_type: feedreader
|
||||||
event_data:
|
event_data:
|
||||||
feed_url: "https://hasspodcast.io/feed/podcast"
|
feed_url: "https://hasspodcast.io/feed/podcast"
|
||||||
action:
|
actions:
|
||||||
action: persistent_notification.create
|
action: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
title: "New HA Podcast available"
|
title: "New HA Podcast available"
|
||||||
|
@ -117,27 +117,27 @@ These are documented below.
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Switch on a light when incident is received"
|
- alias: "Switch on a light when incident is received"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: sensor.incidents
|
entity_id: sensor.incidents
|
||||||
action:
|
actions:
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.bedroom
|
entity_id: light.bedroom
|
||||||
|
|
||||||
- alias: "Play TTS incident details when incident is received"
|
- alias: "Play TTS incident details when incident is received"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: sensor.incidents
|
entity_id: sensor.incidents
|
||||||
attribute: message_to_speech_url
|
attribute: message_to_speech_url
|
||||||
condition:
|
conditions:
|
||||||
- condition: not
|
- condition: not
|
||||||
conditions:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: sensor.incidents
|
entity_id: sensor.incidents
|
||||||
attribute: message_to_speech_url
|
attribute: message_to_speech_url
|
||||||
state: None
|
state: None
|
||||||
action:
|
actions:
|
||||||
- action: media_player.play_media
|
- action: media_player.play_media
|
||||||
data_template:
|
data_template:
|
||||||
entity_id: media_player.nest_hub_bedroom
|
entity_id: media_player.nest_hub_bedroom
|
||||||
@ -146,10 +146,10 @@ automation:
|
|||||||
media_content_type: "audio/mp4"
|
media_content_type: "audio/mp4"
|
||||||
|
|
||||||
- alias: "Send response acknowledgement when a button is pressed"
|
- alias: "Send response acknowledgement when a button is pressed"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: switch.response_button
|
entity_id: switch.response_button
|
||||||
action:
|
actions:
|
||||||
action: homeassistant.turn_on
|
action: homeassistant.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: switch.incident_response
|
entity_id: switch.incident_response
|
||||||
@ -158,7 +158,7 @@ automation:
|
|||||||
trigger:
|
trigger:
|
||||||
platform: homeassistant
|
platform: homeassistant
|
||||||
event: start
|
event: start
|
||||||
action:
|
actions:
|
||||||
action: cast.show_lovelace_view
|
action: cast.show_lovelace_view
|
||||||
data:
|
data:
|
||||||
entity_id: media_player.nest_hub_bedroom
|
entity_id: media_player.nest_hub_bedroom
|
||||||
|
@ -78,13 +78,13 @@ The flic integration fires `flic_click` events on the bus. You can capture the e
|
|||||||
# Example configuration.yaml automation entry
|
# Example configuration.yaml automation entry
|
||||||
automation:
|
automation:
|
||||||
- alias: "Turn on lights in the living room when flic is pressed once"
|
- alias: "Turn on lights in the living room when flic is pressed once"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: flic_click
|
event_type: flic_click
|
||||||
event_data:
|
event_data:
|
||||||
button_name: flic_81e4ac74b6d2
|
button_name: flic_81e4ac74b6d2
|
||||||
click_type: single
|
click_type: single
|
||||||
action:
|
actions:
|
||||||
action: homeassistant.turn_on
|
action: homeassistant.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: group.lights_livingroom
|
entity_id: group.lights_livingroom
|
||||||
@ -104,10 +104,10 @@ To help detect and debug flic button clicks, you can use this automation that se
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "FLIC Html5 notify on every click"
|
- alias: "FLIC Html5 notify on every click"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: flic_click
|
event_type: flic_click
|
||||||
action:
|
actions:
|
||||||
- action: notify.html5
|
- action: notify.html5
|
||||||
data:
|
data:
|
||||||
title: "flic click"
|
title: "flic click"
|
||||||
|
@ -49,10 +49,10 @@ Example of an automation that sends a Home Assistant notification of the most re
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
alias: "Notify: flume"
|
alias: "Notify: flume"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
minutes: /5
|
minutes: /5
|
||||||
action:
|
actions:
|
||||||
- action: flume.list_notifications
|
- action: flume.list_notifications
|
||||||
data:
|
data:
|
||||||
config_entry: 1234 # replace this with your config entry id
|
config_entry: 1234 # replace this with your config entry id
|
||||||
|
@ -53,10 +53,10 @@ Automations can be triggered on file system events data using a template. The fo
|
|||||||
#Send notification for new image (including the image itself)
|
#Send notification for new image (including the image itself)
|
||||||
automation:
|
automation:
|
||||||
alias: "New file alert"
|
alias: "New file alert"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: event.created
|
entity_id: event.created
|
||||||
action:
|
actions:
|
||||||
action: notify.notify
|
action: notify.notify
|
||||||
data:
|
data:
|
||||||
title: New image captured!
|
title: New image captured!
|
||||||
|
@ -58,10 +58,10 @@ Foursquare check-in events can be used out of the box to trigger automation acti
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Trigger action when you check into a venue."
|
- alias: "Trigger action when you check into a venue."
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: foursquare.push
|
event_type: foursquare.push
|
||||||
action:
|
actions:
|
||||||
action: script.turn_on
|
action: script.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: script.my_action
|
entity_id: script.my_action
|
||||||
|
@ -116,10 +116,10 @@ fritz_box_reconnect:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Reconnect FRITZ!Box"
|
- alias: "Reconnect FRITZ!Box"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time
|
- platform: time
|
||||||
at: "05:00:00"
|
at: "05:00:00"
|
||||||
action:
|
actions:
|
||||||
- action: button.press
|
- action: button.press
|
||||||
target:
|
target:
|
||||||
entity_id: button.fritzbox_7530_reconnect
|
entity_id: button.fritzbox_7530_reconnect
|
||||||
@ -131,11 +131,11 @@ automation:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Guests Wi-Fi Turned On -> Send Password To Phone"
|
- alias: "Guests Wi-Fi Turned On -> Send Password To Phone"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: switch.fritzbox_7530_wifi_myssid
|
entity_id: switch.fritzbox_7530_wifi_myssid
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify
|
- action: notify.notify
|
||||||
data:
|
data:
|
||||||
title: "Guest Wi-Fi is enabled"
|
title: "Guest Wi-Fi is enabled"
|
||||||
|
@ -52,10 +52,10 @@ This example shows how to send notifications whenever the sensor's state changes
|
|||||||
# Example configuration.yaml entry.
|
# Example configuration.yaml entry.
|
||||||
automation:
|
automation:
|
||||||
- alias: "Notify about phone state"
|
- alias: "Notify about phone state"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.phone
|
entity_id: sensor.phone
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify
|
- action: notify.notify
|
||||||
data:
|
data:
|
||||||
title: "Phone"
|
title: "Phone"
|
||||||
|
@ -49,12 +49,12 @@ In case your device (friendly name) is called *badezimmer*, an example automatio
|
|||||||
```yaml
|
```yaml
|
||||||
# Example configuration.yaml automation
|
# Example configuration.yaml automation
|
||||||
alias: "Bathroom Motion Detected"
|
alias: "Bathroom Motion Detected"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.motion_sensor_166d0001171111
|
entity_id: binary_sensor.motion_sensor_166d0001171111
|
||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
action: media_player.turn_on
|
action: media_player.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: "media_player.badezimmer"
|
entity_id: "media_player.badezimmer"
|
||||||
|
@ -91,11 +91,11 @@ Each such entity has a state attribute that will contain a list of any such issu
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "GeniusHub Error Alerts"
|
- alias: "GeniusHub Error Alerts"
|
||||||
trigger:
|
triggers:
|
||||||
platform: numeric_state
|
platform: numeric_state
|
||||||
entity_id: sensor.geniushub_errors
|
entity_id: sensor.geniushub_errors
|
||||||
above: 0
|
above: 0
|
||||||
action:
|
actions:
|
||||||
- action: notify.pushbullet_notifier
|
- action: notify.pushbullet_notifier
|
||||||
data:
|
data:
|
||||||
title: "Genius Hub has errors"
|
title: "Genius Hub has errors"
|
||||||
@ -112,10 +112,10 @@ This alert may be useful to see if the CH is being turned on whilst you're on a
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "GeniusHub CH State Change Alert"
|
- alias: "GeniusHub CH State Change Alert"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.dual_channel_receiver_2_1
|
entity_id: binary_sensor.dual_channel_receiver_2_1
|
||||||
action:
|
actions:
|
||||||
- action: notify.pushbullet_notifier
|
- action: notify.pushbullet_notifier
|
||||||
data:
|
data:
|
||||||
title: "Warning: CH State Change!"
|
title: "Warning: CH State Change!"
|
||||||
|
@ -56,15 +56,15 @@ zone:
|
|||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: "Bush Fire Alert"
|
- alias: "Bush Fire Alert"
|
||||||
trigger:
|
triggers:
|
||||||
platform: geo_location
|
platform: geo_location
|
||||||
source: nsw_rural_fire_service_feed
|
source: nsw_rural_fire_service_feed
|
||||||
zone: zone.bush_fire_alert_zone
|
zone: zone.bush_fire_alert_zone
|
||||||
event: enter
|
event: enter
|
||||||
condition:
|
conditions:
|
||||||
condition: template
|
condition: template
|
||||||
value_template: "{{ trigger.to_state.attributes.type == 'Bush Fire' }}"
|
value_template: "{{ trigger.to_state.attributes.type == 'Bush Fire' }}"
|
||||||
action:
|
actions:
|
||||||
- action: persistent_notification.create
|
- action: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
message: "{{ trigger.to_state.name }} - {{ trigger.to_state.attributes.status }}"
|
message: "{{ trigger.to_state.name }} - {{ trigger.to_state.attributes.status }}"
|
||||||
|
@ -128,10 +128,10 @@ This example uses the [Latest release](#latest-release) entity provided by this
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.awesome_repository_latest_release
|
entity_id: sensor.awesome_repository_latest_release
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify
|
- action: notify.notify
|
||||||
data:
|
data:
|
||||||
title: "New github/repository release"
|
title: "New github/repository release"
|
||||||
@ -150,10 +150,10 @@ This example uses the [Stars](#diagnostic-entities) diagnostic entity provided b
|
|||||||
{% raw %}
|
{% raw %}
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.awesome_repository_stars
|
entity_id: sensor.awesome_repository_stars
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify
|
- action: notify.notify
|
||||||
data:
|
data:
|
||||||
title: "New github/repository new star"
|
title: "New github/repository new star"
|
||||||
|
@ -45,12 +45,12 @@ The integration will poll the inverter for new values every 10 seconds. If you w
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Goodwe inverter data polling"
|
- alias: "Goodwe inverter data polling"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
hours: "*"
|
hours: "*"
|
||||||
minutes: "*"
|
minutes: "*"
|
||||||
seconds: "/30"
|
seconds: "/30"
|
||||||
action:
|
actions:
|
||||||
- action: homeassistant.update_entity
|
- action: homeassistant.update_entity
|
||||||
target:
|
target:
|
||||||
entity_id: sensor.ppv
|
entity_id: sensor.ppv
|
||||||
|
@ -70,10 +70,10 @@ You can use the `homeassistant.update_entity` action to update the sensor on-dem
|
|||||||
- id: update_morning_commute_sensor
|
- id: update_morning_commute_sensor
|
||||||
alias: "Commute - Update morning commute sensor"
|
alias: "Commute - Update morning commute sensor"
|
||||||
initial_state: "on"
|
initial_state: "on"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
minutes: "/2"
|
minutes: "/2"
|
||||||
condition:
|
conditions:
|
||||||
- condition: time
|
- condition: time
|
||||||
after: "08:00:00"
|
after: "08:00:00"
|
||||||
before: "11:00:00"
|
before: "11:00:00"
|
||||||
@ -84,7 +84,7 @@ You can use the `homeassistant.update_entity` action to update the sensor on-dem
|
|||||||
- wed
|
- wed
|
||||||
- thu
|
- thu
|
||||||
- fri
|
- fri
|
||||||
action:
|
actions:
|
||||||
- action: homeassistant.update_entity
|
- action: homeassistant.update_entity
|
||||||
target:
|
target:
|
||||||
entity_id: sensor.morning_commute
|
entity_id: sensor.morning_commute
|
||||||
|
@ -80,7 +80,7 @@ In the file 'harmony_REMOTENAME.conf' you can find the available activities, for
|
|||||||
Using the activity name 'Watch TV', you can perform an action via automation to switch this activity on:
|
Using the activity name 'Watch TV', you can perform an action via automation to switch this activity on:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
- action: remote.turn_on
|
- action: remote.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: remote.bed_room_hub
|
entity_id: remote.bed_room_hub
|
||||||
@ -205,24 +205,24 @@ The example below shows how to control an `input_boolean` switch using the Harmo
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Watch TV started from harmony hub"
|
- alias: "Watch TV started from harmony hub"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: remote.family_room
|
entity_id: remote.family_room
|
||||||
condition:
|
conditions:
|
||||||
condition: template
|
condition: template
|
||||||
value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}'
|
value_template: '{{ trigger.to_state.attributes.current_activity == "Kodi" }}'
|
||||||
action:
|
actions:
|
||||||
action: input_boolean.turn_on
|
action: input_boolean.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: input_boolean.notify
|
entity_id: input_boolean.notify
|
||||||
- alias: "PowerOff started from harmony hub"
|
- alias: "PowerOff started from harmony hub"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: remote.family_room
|
entity_id: remote.family_room
|
||||||
condition:
|
conditions:
|
||||||
condition: template
|
condition: template
|
||||||
value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}'
|
value_template: '{{ trigger.to_state.attributes.current_activity == "PowerOff" }}'
|
||||||
action:
|
actions:
|
||||||
action: input_boolean.turn_off
|
action: input_boolean.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: input_boolean.notify
|
entity_id: input_boolean.notify
|
||||||
|
@ -170,7 +170,7 @@ Use the `hdmi_cec.select_device` action with the name of the device from configu
|
|||||||
So an Automation action using the example above would look something like this.
|
So an Automation action using the example above would look something like this.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: hdmi_cec.select_device
|
action: hdmi_cec.select_device
|
||||||
data:
|
data:
|
||||||
device: Chromecast
|
device: Chromecast
|
||||||
@ -183,7 +183,7 @@ Use the `hdmi_cec.power_on` action (no arguments) to power on any devices that s
|
|||||||
An Automation action using the example above would look something like this.
|
An Automation action using the example above would look something like this.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: hdmi_cec.power_on
|
action: hdmi_cec.power_on
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -194,7 +194,7 @@ Use the `hdmi_cec.standby` action (no arguments) to place in standby any devices
|
|||||||
An Automation action using the example above would look something like this.
|
An Automation action using the example above would look something like this.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: hdmi_cec.standby
|
action: hdmi_cec.standby
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -71,10 +71,10 @@ automation:
|
|||||||
- id: update_morning_commute_sensor
|
- id: update_morning_commute_sensor
|
||||||
alias: "Commute - Update morning commute sensor"
|
alias: "Commute - Update morning commute sensor"
|
||||||
initial_state: "on"
|
initial_state: "on"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
minutes: "/2"
|
minutes: "/2"
|
||||||
condition:
|
conditions:
|
||||||
- condition: time
|
- condition: time
|
||||||
after: "08:00:00"
|
after: "08:00:00"
|
||||||
before: "11:00:00"
|
before: "11:00:00"
|
||||||
@ -85,7 +85,7 @@ automation:
|
|||||||
- wed
|
- wed
|
||||||
- thu
|
- thu
|
||||||
- fri
|
- fri
|
||||||
action:
|
actions:
|
||||||
- action: homeassistant.update_entity
|
- action: homeassistant.update_entity
|
||||||
target:
|
target:
|
||||||
entity_id: sensor.morning_commute
|
entity_id: sensor.morning_commute
|
||||||
|
@ -313,7 +313,7 @@ Update the location of the Home Assistant default zone (usually "Home").
|
|||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: homeassistant.set_location
|
action: homeassistant.set_location
|
||||||
data:
|
data:
|
||||||
latitude: 32.87336
|
latitude: 32.87336
|
||||||
@ -335,7 +335,7 @@ for example, a light and a switch can be toggled in a single action.
|
|||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: homeassistant.toggle
|
action: homeassistant.toggle
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
@ -357,7 +357,7 @@ for example, a light and a switch can be turned on in a single action.
|
|||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: homeassistant.turn_on
|
action: homeassistant.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
@ -379,7 +379,7 @@ for example, a light and a switch can be turned off in a single action.
|
|||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: homeassistant.turn_off
|
action: homeassistant.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
@ -398,7 +398,7 @@ Force one or more entities to update its data rather than wait for the next sche
|
|||||||
#### Example
|
#### Example
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
action:
|
actions:
|
||||||
action: homeassistant.update_entity
|
action: homeassistant.update_entity
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
|
@ -454,14 +454,14 @@ The key name will be available in the event data in the `key_name` field. Exampl
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: homekit_tv_remote_key_pressed
|
event_type: homekit_tv_remote_key_pressed
|
||||||
event_data:
|
event_data:
|
||||||
key_name: arrow_right
|
key_name: arrow_right
|
||||||
|
|
||||||
# Send the arrow right key via a broadlink IR blaster
|
# Send the arrow right key via a broadlink IR blaster
|
||||||
action:
|
actions:
|
||||||
action: broadlink.send
|
action: broadlink.send
|
||||||
host: 192.168.1.55
|
host: 192.168.1.55
|
||||||
packet: XXXXXXXX
|
packet: XXXXXXXX
|
||||||
@ -474,13 +474,13 @@ The HomeKit integration emits `homekit_state_change` events. These events can be
|
|||||||
```yaml
|
```yaml
|
||||||
# Example for handling a HomeKit event
|
# Example for handling a HomeKit event
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: homekit_state_change
|
event_type: homekit_state_change
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: cover.garage_door
|
entity_id: cover.garage_door
|
||||||
action: open_cover
|
action: open_cover
|
||||||
action:
|
actions:
|
||||||
- action: persistent_notification.create
|
- action: persistent_notification.create
|
||||||
data:
|
data:
|
||||||
message: "The garage door got opened via HomeKit"
|
message: "The garage door got opened via HomeKit"
|
||||||
|
@ -252,14 +252,14 @@ Here's an example of how to use these events for automations:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: homematic.keypress
|
event_type: homematic.keypress
|
||||||
event_data:
|
event_data:
|
||||||
name: "Kitchen Switch"
|
name: "Kitchen Switch"
|
||||||
channel: 1
|
channel: 1
|
||||||
param: PRESS_SHORT
|
param: PRESS_SHORT
|
||||||
action:
|
actions:
|
||||||
action: switch.turn_on
|
action: switch.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: switch.Kitchen_Ambience
|
entity_id: switch.Kitchen_Ambience
|
||||||
@ -306,7 +306,7 @@ Simulate a button being pressed:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematic.virtualkey
|
action: homematic.virtualkey
|
||||||
data:
|
data:
|
||||||
address: "BidCoS-RF"
|
address: "BidCoS-RF"
|
||||||
@ -318,7 +318,7 @@ Open KeyMatic:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematic.virtualkey
|
action: homematic.virtualkey
|
||||||
data:
|
data:
|
||||||
address: "LEQ1234567"
|
address: "LEQ1234567"
|
||||||
@ -330,7 +330,7 @@ Set boolean variable to true:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematic.set_variable_value
|
action: homematic.set_variable_value
|
||||||
target:
|
target:
|
||||||
entity_id: homematic.ccu2
|
entity_id: homematic.ccu2
|
||||||
@ -348,7 +348,7 @@ Manually turn on a switch actor:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematic.set_device_value
|
action: homematic.set_device_value
|
||||||
data:
|
data:
|
||||||
address: "LEQ1234567"
|
address: "LEQ1234567"
|
||||||
@ -361,7 +361,7 @@ Manually set temperature on thermostat:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematic.set_device_value
|
action: homematic.set_device_value
|
||||||
data:
|
data:
|
||||||
address: "LEQ1234567"
|
address: "LEQ1234567"
|
||||||
@ -374,7 +374,7 @@ Manually set the active profile on thermostat:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematic.set_device_value
|
action: homematic.set_device_value
|
||||||
data:
|
data:
|
||||||
address: "LEQ1234567"
|
address: "LEQ1234567"
|
||||||
@ -388,7 +388,7 @@ Set the week program of a wall thermostat:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematic.put_paramset
|
action: homematic.put_paramset
|
||||||
data:
|
data:
|
||||||
interface: wireless
|
interface: wireless
|
||||||
@ -402,7 +402,7 @@ Set the week program of a wall thermostat with explicit `rx_mode` (BidCos-RF onl
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematic.put_paramset
|
action: homematic.put_paramset
|
||||||
data:
|
data:
|
||||||
interface: wireless
|
interface: wireless
|
||||||
@ -423,7 +423,7 @@ Manually set lock on KeyMatic devices:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: lock.lock
|
action: lock.lock
|
||||||
target:
|
target:
|
||||||
entity_id: lock.leq1234567
|
entity_id: lock.leq1234567
|
||||||
@ -433,7 +433,7 @@ Manually set unlock on KeyMatic devices:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: lock.unlock
|
action: lock.unlock
|
||||||
target:
|
target:
|
||||||
entity_id: lock.leq1234567
|
entity_id: lock.leq1234567
|
||||||
@ -488,11 +488,11 @@ template:
|
|||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: "Homematic Reconnect"
|
- alias: "Homematic Reconnect"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: binary_sensor.homematic_is_sending_updates
|
entity_id: binary_sensor.homematic_is_sending_updates
|
||||||
to: "off"
|
to: "off"
|
||||||
action:
|
actions:
|
||||||
# Reconnect, if sensor has not been updated for over 10 minutes
|
# Reconnect, if sensor has not been updated for over 10 minutes
|
||||||
action: homematic.reconnect
|
action: homematic.reconnect
|
||||||
```
|
```
|
||||||
@ -534,10 +534,10 @@ automation:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Homematic CCU Reboot"
|
- alias: "Homematic CCU Reboot"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: sensor.v_last_reboot
|
entity_id: sensor.v_last_reboot
|
||||||
action:
|
actions:
|
||||||
action: homematic.reconnect
|
action: homematic.reconnect
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ Activate eco mode with duration.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematicip_cloud.activate_eco_mode_with_duration
|
action: homematicip_cloud.activate_eco_mode_with_duration
|
||||||
data:
|
data:
|
||||||
duration: 60
|
duration: 60
|
||||||
@ -245,7 +245,7 @@ Activate eco mode with period.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematicip_cloud.activate_eco_mode_with_period
|
action: homematicip_cloud.activate_eco_mode_with_period
|
||||||
data:
|
data:
|
||||||
endtime: 2019-09-17 18:00
|
endtime: 2019-09-17 18:00
|
||||||
@ -256,7 +256,7 @@ Activates the vacation mode until the given time.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematicip_cloud.activate_vacation
|
action: homematicip_cloud.activate_vacation
|
||||||
data:
|
data:
|
||||||
endtime: 2019-09-17 18:00
|
endtime: 2019-09-17 18:00
|
||||||
@ -268,7 +268,7 @@ Deactivates the eco mode immediately.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematicip_cloud.deactivate_eco_mode
|
action: homematicip_cloud.deactivate_eco_mode
|
||||||
data:
|
data:
|
||||||
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
|
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
|
||||||
@ -278,7 +278,7 @@ Deactivates the vacation mode immediately.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematicip_cloud.deactivate_vacation
|
action: homematicip_cloud.deactivate_vacation
|
||||||
data:
|
data:
|
||||||
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
|
accesspoint_id: 3014xxxxxxxxxxxxxxxxxxxx
|
||||||
@ -291,7 +291,7 @@ You can get the required index from the native Homematic IP App.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematicip_cloud.set_active_climate_profile
|
action: homematicip_cloud.set_active_climate_profile
|
||||||
target:
|
target:
|
||||||
entity_id: climate.livingroom
|
entity_id: climate.livingroom
|
||||||
@ -303,7 +303,7 @@ Dump the configuration of the Homematic IP Access Point(s).
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematicip_cloud.dump_hap_config
|
action: homematicip_cloud.dump_hap_config
|
||||||
data:
|
data:
|
||||||
anonymize: True
|
anonymize: True
|
||||||
@ -313,7 +313,7 @@ Reset energy counter of measuring actuators.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematicip_cloud.reset_energy_counter
|
action: homematicip_cloud.reset_energy_counter
|
||||||
target:
|
target:
|
||||||
entity_id: switch.livingroom
|
entity_id: switch.livingroom
|
||||||
@ -323,7 +323,7 @@ Enable (or disable) Cooling mode for the entire home. Disabling Cooling mode wil
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
...
|
...
|
||||||
action:
|
actions:
|
||||||
action: homematicip_cloud.set_home_cooling_mode
|
action: homematicip_cloud.set_home_cooling_mode
|
||||||
data:
|
data:
|
||||||
cooling: True
|
cooling: True
|
||||||
|
@ -55,13 +55,13 @@ Due to the instability of the Honeywell total connect system, actions within aut
|
|||||||
```yaml
|
```yaml
|
||||||
alias: "No one home"
|
alias: "No one home"
|
||||||
description: "Everyone has left home"
|
description: "Everyone has left home"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: numeric_state
|
- platform: numeric_state
|
||||||
entity_id: zone.home
|
entity_id: zone.home
|
||||||
for:
|
for:
|
||||||
minutes: 10
|
minutes: 10
|
||||||
below: 1
|
below: 1
|
||||||
action:
|
actions:
|
||||||
- repeat:
|
- repeat:
|
||||||
sequence:
|
sequence:
|
||||||
- action: climate.set_temperature
|
- action: climate.set_temperature
|
||||||
|
@ -107,10 +107,10 @@ Example of adding a tag to your notification. This won't create new notification
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Push/update notification of sensor state with tag"
|
- alias: "Push/update notification of sensor state with tag"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.sensor
|
entity_id: sensor.sensor
|
||||||
action:
|
actions:
|
||||||
action: notify.html5
|
action: notify.html5
|
||||||
data:
|
data:
|
||||||
message: "Last known sensor state is {{ states('sensor.sensor') }}."
|
message: "Last known sensor state is {{ states('sensor.sensor') }}."
|
||||||
@ -207,7 +207,7 @@ notification is received on the device.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "HTML5 push notification received and displayed on device"
|
- alias: "HTML5 push notification received and displayed on device"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: html5_notification.received
|
event_type: html5_notification.received
|
||||||
```
|
```
|
||||||
@ -218,7 +218,7 @@ You will receive an event named `html5_notification.clicked` when the notificati
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "HTML5 push notification clicked"
|
- alias: "HTML5 push notification clicked"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: html5_notification.clicked
|
event_type: html5_notification.clicked
|
||||||
```
|
```
|
||||||
@ -227,7 +227,7 @@ or
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "HTML5 push notification action button clicked"
|
- alias: "HTML5 push notification action button clicked"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: html5_notification.clicked
|
event_type: html5_notification.clicked
|
||||||
event_data:
|
event_data:
|
||||||
@ -240,7 +240,7 @@ You will receive an event named `html5_notification.closed` when the notificatio
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "HTML5 push notification clicked"
|
- alias: "HTML5 push notification clicked"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: html5_notification.closed
|
event_type: html5_notification.closed
|
||||||
```
|
```
|
||||||
|
@ -69,10 +69,10 @@ Set mode for the humidifier device. This action is only available if the device
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time
|
- platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: humidifier.set_mode
|
- action: humidifier.set_mode
|
||||||
target:
|
target:
|
||||||
entity_id: humidifier.bedroom
|
entity_id: humidifier.bedroom
|
||||||
@ -93,10 +93,10 @@ Set target humidity of the humidifier device
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time
|
- platform: time
|
||||||
at: "07:15:00"
|
at: "07:15:00"
|
||||||
action:
|
actions:
|
||||||
- action: humidifier.set_humidity
|
- action: humidifier.set_humidity
|
||||||
target:
|
target:
|
||||||
entity_id: humidifier.bedroom
|
entity_id: humidifier.bedroom
|
||||||
|
@ -224,10 +224,10 @@ Velocity controls the speed of the shade. The default speed from Hunter Douglas
|
|||||||
|
|
||||||
``` yaml
|
``` yaml
|
||||||
alias: "Blinds closed at night"
|
alias: "Blinds closed at night"
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: "18:00:00"
|
at: "18:00:00"
|
||||||
action:
|
actions:
|
||||||
- action: scene.turn_on
|
- action: scene.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: scene.10877
|
entity_id: scene.10877
|
||||||
@ -241,10 +241,10 @@ This automation is not recommended for battery-powered shades.
|
|||||||
alias: Force Update
|
alias: Force Update
|
||||||
description: 'Update the position of defined shades'
|
description: 'Update the position of defined shades'
|
||||||
mode: single
|
mode: single
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time_pattern
|
- platform: time_pattern
|
||||||
hours: '1'
|
hours: '1'
|
||||||
action:
|
actions:
|
||||||
- action: homeassistant.update_entity
|
- action: homeassistant.update_entity
|
||||||
target:
|
target:
|
||||||
entity_id:
|
entity_id:
|
||||||
|
@ -113,11 +113,11 @@ To start Hyperion with an effect, use the following automation:
|
|||||||
automation:
|
automation:
|
||||||
- id: one
|
- id: one
|
||||||
alias: "Turn Hyperion effect on when light goes on"
|
alias: "Turn Hyperion effect on when light goes on"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: light.hyperion
|
entity_id: light.hyperion
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.hyperion
|
entity_id: light.hyperion
|
||||||
@ -129,7 +129,7 @@ To have the lights playing an effect when pausing, idle or turn off a media play
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Set hyperion effect after playback"
|
- alias: "Set hyperion effect after playback"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: media_player.plex
|
entity_id: media_player.plex
|
||||||
to: "off"
|
to: "off"
|
||||||
@ -139,7 +139,7 @@ To have the lights playing an effect when pausing, idle or turn off a media play
|
|||||||
- platform: state
|
- platform: state
|
||||||
entity_id: media_player.plex.plex
|
entity_id: media_player.plex.plex
|
||||||
to: "idle"
|
to: "idle"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.hyperion
|
entity_id: light.hyperion
|
||||||
@ -151,11 +151,11 @@ To capture the screen on a USB capture device, when playing something on a media
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Set hyperion when playback starts"
|
- alias: "Set hyperion when playback starts"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: media_player.plex
|
entity_id: media_player.plex
|
||||||
to: "playing"
|
to: "playing"
|
||||||
action:
|
actions:
|
||||||
- action: switch.turn_on
|
- action: switch.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: switch.[instance]_component_usb_capture
|
entity_id: switch.[instance]_component_usb_capture
|
||||||
@ -165,17 +165,17 @@ To toggle the LED device together with the light entity in order to turn light o
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Turn LED device on when Hyperion light is activated"
|
- alias: "Turn LED device on when Hyperion light is activated"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id:
|
entity_id:
|
||||||
- light.hyperion
|
- light.hyperion
|
||||||
from: "off"
|
from: "off"
|
||||||
to: "on"
|
to: "on"
|
||||||
condition:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: switch.[instance]_component_led_device
|
entity_id: switch.[instance]_component_led_device
|
||||||
state: "off"
|
state: "off"
|
||||||
action:
|
actions:
|
||||||
- action: switch.turn_on
|
- action: switch.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: switch.[instance]_component_led_device
|
entity_id: switch.[instance]_component_led_device
|
||||||
|
@ -92,7 +92,7 @@ To get the Estimated distance sensor to work, in most cases, it has to be calibr
|
|||||||
```yaml
|
```yaml
|
||||||
alias: "The black trash can has left the building"
|
alias: "The black trash can has left the building"
|
||||||
mode: single
|
mode: single
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.black_trash_bin_estimated_distance
|
entity_id: sensor.black_trash_bin_estimated_distance
|
||||||
to: "unavailable"
|
to: "unavailable"
|
||||||
@ -107,7 +107,7 @@ trigger:
|
|||||||
minutes: 5
|
minutes: 5
|
||||||
seconds: 0
|
seconds: 0
|
||||||
above: 20
|
above: 20
|
||||||
action:
|
actions:
|
||||||
- action: notify.notify
|
- action: notify.notify
|
||||||
data:
|
data:
|
||||||
message: "The black trash can has left the building"
|
message: "The black trash can has left the building"
|
||||||
|
@ -38,13 +38,13 @@ You then need to consume that incoming information with the following automation
|
|||||||
automation:
|
automation:
|
||||||
- id: this_is_the_automation_id
|
- id: this_is_the_automation_id
|
||||||
alias: "The optional automation alias"
|
alias: "The optional automation alias"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: ifttt_webhook_received
|
event_type: ifttt_webhook_received
|
||||||
event_data:
|
event_data:
|
||||||
action: call_service # the same action 'name' you used in the Body section of the IFTTT recipe
|
action: call_service # the same action 'name' you used in the Body section of the IFTTT recipe
|
||||||
condition: []
|
conditions:
|
||||||
action:
|
actions:
|
||||||
- action: '{{ trigger.event.data.service }}'
|
- action: '{{ trigger.event.data.service }}'
|
||||||
target:
|
target:
|
||||||
entity_id: '{{ trigger.event.data.entity_id }}'
|
entity_id: '{{ trigger.event.data.entity_id }}'
|
||||||
@ -143,10 +143,10 @@ Add the *Then That* action. The below example sends a notification to the IFTTT
|
|||||||
# Example configuration.yaml Automation entry
|
# Example configuration.yaml Automation entry
|
||||||
automation:
|
automation:
|
||||||
alias: "Startup Notification"
|
alias: "Startup Notification"
|
||||||
trigger:
|
triggers:
|
||||||
platform: homeassistant
|
platform: homeassistant
|
||||||
event: start
|
event: start
|
||||||
action:
|
actions:
|
||||||
action: ifttt.trigger
|
action: ifttt.trigger
|
||||||
data: {"event":"TestHA_Trigger", "value1":"Hello World!"}
|
data: {"event":"TestHA_Trigger", "value1":"Hello World!"}
|
||||||
```
|
```
|
||||||
@ -161,10 +161,10 @@ IFTTT can also be used in scripts and with templates. Here is the above automati
|
|||||||
# Example configuration.yaml Automation entry
|
# Example configuration.yaml Automation entry
|
||||||
automation:
|
automation:
|
||||||
alias: "Startup Notification"
|
alias: "Startup Notification"
|
||||||
trigger:
|
triggers:
|
||||||
platform: homeassistant
|
platform: homeassistant
|
||||||
event: start
|
event: start
|
||||||
action:
|
actions:
|
||||||
action: script.ifttt_notify
|
action: script.ifttt_notify
|
||||||
data:
|
data:
|
||||||
value1: "HA Status:"
|
value1: "HA Status:"
|
||||||
|
@ -34,7 +34,7 @@ The `found_plate` event is triggered after OpenALPR has found a new license plat
|
|||||||
# Example configuration.yaml automation entry
|
# Example configuration.yaml automation entry
|
||||||
automation:
|
automation:
|
||||||
- alias: "Open garage door"
|
- alias: "Open garage door"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: image_processing.found_plate
|
event_type: image_processing.found_plate
|
||||||
event_data:
|
event_data:
|
||||||
@ -55,7 +55,7 @@ The `detect_face` event is triggered after a Face entity has found a face.
|
|||||||
# Example configuration.yaml automation entry
|
# Example configuration.yaml automation entry
|
||||||
automation:
|
automation:
|
||||||
- alias: "Known person in front of my door"
|
- alias: "Known person in front of my door"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: image_processing.detect_face
|
event_type: image_processing.detect_face
|
||||||
event_data:
|
event_data:
|
||||||
@ -78,11 +78,11 @@ sensor:
|
|||||||
...
|
...
|
||||||
automation:
|
automation:
|
||||||
- alias: "Scan for faces when motion detected"
|
- alias: "Scan for faces when motion detected"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.door_motion_sensor
|
entity_id: sensor.door_motion_sensor
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- action: image_processing.scan
|
- action: image_processing.scan
|
||||||
target:
|
target:
|
||||||
entity_id: image_processing.door
|
entity_id: image_processing.door
|
||||||
|
@ -145,7 +145,7 @@ Increasing the default maximum message size (2048 bytes) could have a negative i
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
template:
|
template:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: "imap_content"
|
event_type: "imap_content"
|
||||||
id: "custom_event"
|
id: "custom_event"
|
||||||
@ -196,15 +196,15 @@ The example below filters the event trigger by `entry_id`, fetches the message a
|
|||||||
```yaml
|
```yaml
|
||||||
alias: imap fetch and seen example
|
alias: imap fetch and seen example
|
||||||
description: Fetch and mark an incoming message as seen
|
description: Fetch and mark an incoming message as seen
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: imap_content
|
event_type: imap_content
|
||||||
event_data:
|
event_data:
|
||||||
entry_id: 91fadb3617c5a3ea692aeb62d92aa869
|
entry_id: 91fadb3617c5a3ea692aeb62d92aa869
|
||||||
condition:
|
conditions:
|
||||||
- condition: template
|
- condition: template
|
||||||
value_template: "{{ trigger.event.data['sender'] == 'info@example.com' }}"
|
value_template: "{{ trigger.event.data['sender'] == 'info@example.com' }}"
|
||||||
action:
|
actions:
|
||||||
- action: imap.fetch
|
- action: imap.fetch
|
||||||
data:
|
data:
|
||||||
entry: 91fadb3617c5a3ea692aeb62d92aa869
|
entry: 91fadb3617c5a3ea692aeb62d92aa869
|
||||||
@ -231,7 +231,7 @@ The following example shows the usage of the IMAP email content sensor to scan t
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
template:
|
template:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: "imap_content"
|
event_type: "imap_content"
|
||||||
id: "custom_event"
|
id: "custom_event"
|
||||||
@ -269,7 +269,7 @@ Below is the template sensor which extracts the information from the body of the
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
template:
|
template:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: "imap_content"
|
event_type: "imap_content"
|
||||||
id: "custom_event"
|
id: "custom_event"
|
||||||
@ -318,7 +318,7 @@ The example below will only set the state to the subject of the email of templat
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
template:
|
template:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: "imap_content"
|
event_type: "imap_content"
|
||||||
id: "custom_event"
|
id: "custom_event"
|
||||||
|
@ -48,11 +48,11 @@ To send an alert if the CV pressure is too low or too high, consider the followi
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Low CV Pressure Alert"
|
- alias: "Low CV Pressure Alert"
|
||||||
trigger:
|
triggers:
|
||||||
platform: numeric_state
|
platform: numeric_state
|
||||||
entity_id: sensor.cv_pressure
|
entity_id: sensor.cv_pressure
|
||||||
below: 1.0
|
below: 1.0
|
||||||
action:
|
actions:
|
||||||
- action: notify.pushbullet_notifier
|
- action: notify.pushbullet_notifier
|
||||||
data:
|
data:
|
||||||
title: "Warning: Low CH Pressure"
|
title: "Warning: Low CH Pressure"
|
||||||
|
@ -88,15 +88,15 @@ will only occur if the `input_boolean` is on.
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
alias: "Arriving home"
|
alias: "Arriving home"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: binary_sensor.motion_garage
|
entity_id: binary_sensor.motion_garage
|
||||||
to: "on"
|
to: "on"
|
||||||
condition:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: input_boolean.notify_home
|
entity_id: input_boolean.notify_home
|
||||||
state: "on"
|
state: "on"
|
||||||
action:
|
actions:
|
||||||
- action: notify.pushbullet
|
- action: notify.pushbullet
|
||||||
data:
|
data:
|
||||||
title: ""
|
title: ""
|
||||||
|
@ -67,10 +67,10 @@ Because the state of a input button entity in Home Assistant is a timestamp, it
|
|||||||
means we can use it in our automations. For example:
|
means we can use it in our automations. For example:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: input_button.my_button
|
entity_id: input_button.my_button
|
||||||
action:
|
actions:
|
||||||
- action: notify.frenck
|
- action: notify.frenck
|
||||||
data:
|
data:
|
||||||
message: "My button has been pressed!"
|
message: "My button has been pressed!"
|
||||||
|
@ -117,10 +117,10 @@ automation:
|
|||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
# Turns on bedroom light at the time specified.
|
# Turns on bedroom light at the time specified.
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
platform: time
|
platform: time
|
||||||
at: input_datetime.bedroom_alarm_clock_time
|
at: input_datetime.bedroom_alarm_clock_time
|
||||||
action:
|
actions:
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.bedroom
|
entity_id: light.bedroom
|
||||||
|
@ -127,10 +127,10 @@ input_number:
|
|||||||
step: 1
|
step: 1
|
||||||
automation:
|
automation:
|
||||||
- alias: "Bedroom Light - Adjust Brightness"
|
- alias: "Bedroom Light - Adjust Brightness"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: input_number.bedroom_brightness
|
entity_id: input_number.bedroom_brightness
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.bedroom
|
entity_id: light.bedroom
|
||||||
@ -166,11 +166,11 @@ input_number:
|
|||||||
step: 1
|
step: 1
|
||||||
automation:
|
automation:
|
||||||
- alias: "Bedroom Light - Custom"
|
- alias: "Bedroom Light - Custom"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: input_select.scene_bedroom
|
entity_id: input_select.scene_bedroom
|
||||||
to: CUSTOM
|
to: CUSTOM
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.bedroom
|
entity_id: light.bedroom
|
||||||
@ -199,10 +199,10 @@ input_number:
|
|||||||
# It sets the value slider on the GUI. This slides also had its own automation when the value is changed.
|
# It sets the value slider on the GUI. This slides also had its own automation when the value is changed.
|
||||||
automation:
|
automation:
|
||||||
- alias: "Set temp slider"
|
- alias: "Set temp slider"
|
||||||
trigger:
|
triggers:
|
||||||
platform: mqtt
|
platform: mqtt
|
||||||
topic: "setTemperature"
|
topic: "setTemperature"
|
||||||
action:
|
actions:
|
||||||
action: input_number.set_value
|
action: input_number.set_value
|
||||||
target:
|
target:
|
||||||
entity_id: input_number.target_temp
|
entity_id: input_number.target_temp
|
||||||
@ -212,10 +212,10 @@ automation:
|
|||||||
# This second automation script runs when the target temperature slider is moved.
|
# This second automation script runs when the target temperature slider is moved.
|
||||||
# It publishes its value to the same MQTT topic it is also subscribed to.
|
# It publishes its value to the same MQTT topic it is also subscribed to.
|
||||||
- alias: "Temp slider moved"
|
- alias: "Temp slider moved"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: input_number.target_temp
|
entity_id: input_number.target_temp
|
||||||
action:
|
actions:
|
||||||
action: mqtt.publish
|
action: mqtt.publish
|
||||||
data:
|
data:
|
||||||
topic: "setTemperature"
|
topic: "setTemperature"
|
||||||
@ -250,11 +250,11 @@ input_number:
|
|||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: "turn something off after x time after turning it on"
|
- alias: "turn something off after x time after turning it on"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: switch.something
|
entity_id: switch.something
|
||||||
to: "on"
|
to: "on"
|
||||||
action:
|
actions:
|
||||||
- delay: "00:{{ states('input_number.minutes') | int }}:{{ states('input_number.seconds') | int }}"
|
- delay: "00:{{ states('input_number.minutes') | int }}:{{ states('input_number.seconds') | int }}"
|
||||||
- action: switch.turn_off
|
- action: switch.turn_off
|
||||||
target:
|
target:
|
||||||
|
@ -135,10 +135,10 @@ The following example shows the usage of the `input_select.select_option` action
|
|||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
automation:
|
automation:
|
||||||
- alias: "example automation"
|
- alias: "example automation"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: MY_CUSTOM_EVENT
|
event_type: MY_CUSTOM_EVENT
|
||||||
action:
|
actions:
|
||||||
- action: input_select.select_option
|
- action: input_select.select_option
|
||||||
target:
|
target:
|
||||||
entity_id: input_select.who_cooks
|
entity_id: input_select.who_cooks
|
||||||
@ -152,10 +152,10 @@ To dynamically set the `input_select` options you can call `input_select.set_opt
|
|||||||
# Example configuration.yaml entry
|
# Example configuration.yaml entry
|
||||||
automation:
|
automation:
|
||||||
- alias: "example automation"
|
- alias: "example automation"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: MY_CUSTOM_EVENT
|
event_type: MY_CUSTOM_EVENT
|
||||||
action:
|
actions:
|
||||||
- action: input_select.set_options
|
- action: input_select.set_options
|
||||||
target:
|
target:
|
||||||
entity_id: input_select.who_cooks
|
entity_id: input_select.who_cooks
|
||||||
@ -185,11 +185,11 @@ input_select:
|
|||||||
# This automation script runs when a value is received via MQTT on retained topic: thermostatMode
|
# This automation script runs when a value is received via MQTT on retained topic: thermostatMode
|
||||||
# It sets the value selector on the GUI. This selector also had its own automation when the value is changed.
|
# It sets the value selector on the GUI. This selector also had its own automation when the value is changed.
|
||||||
- alias: "Set Thermostat Mode Selector"
|
- alias: "Set Thermostat Mode Selector"
|
||||||
trigger:
|
triggers:
|
||||||
platform: mqtt
|
platform: mqtt
|
||||||
topic: "thermostatMode"
|
topic: "thermostatMode"
|
||||||
# entity_id: input_select.thermostat_mode
|
# entity_id: input_select.thermostat_mode
|
||||||
action:
|
actions:
|
||||||
action: input_select.select_option
|
action: input_select.select_option
|
||||||
target:
|
target:
|
||||||
entity_id: input_select.thermostat_mode
|
entity_id: input_select.thermostat_mode
|
||||||
@ -199,10 +199,10 @@ input_select:
|
|||||||
# This automation script runs when the thermostat mode selector is changed.
|
# This automation script runs when the thermostat mode selector is changed.
|
||||||
# It publishes its value to the same MQTT topic it is also subscribed to.
|
# It publishes its value to the same MQTT topic it is also subscribed to.
|
||||||
- alias: "Set Thermostat Mode"
|
- alias: "Set Thermostat Mode"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: input_select.thermostat_mode
|
entity_id: input_select.thermostat_mode
|
||||||
action:
|
actions:
|
||||||
action: mqtt.publish
|
action: mqtt.publish
|
||||||
data:
|
data:
|
||||||
topic: "thermostatMode"
|
topic: "thermostatMode"
|
||||||
|
@ -129,10 +129,10 @@ input_text:
|
|||||||
|
|
||||||
automation:
|
automation:
|
||||||
- alias: "Bedroom Light - Custom"
|
- alias: "Bedroom Light - Custom"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: input_select.scene_bedroom
|
entity_id: input_select.scene_bedroom
|
||||||
action:
|
actions:
|
||||||
- action: input_text.set_value
|
- action: input_text.set_value
|
||||||
target:
|
target:
|
||||||
entity_id: input_text.bedroom
|
entity_id: input_text.bedroom
|
||||||
|
@ -134,7 +134,7 @@ automation:
|
|||||||
# Trigger an Insteon scene 25
|
# Trigger an Insteon scene 25
|
||||||
- id: trigger_scene_25_on
|
- id: trigger_scene_25_on
|
||||||
alias: "Turn on scene 25"
|
alias: "Turn on scene 25"
|
||||||
action:
|
actions:
|
||||||
- action: insteon.scene_on
|
- action: insteon.scene_on
|
||||||
group: 25
|
group: 25
|
||||||
```
|
```
|
||||||
@ -157,17 +157,17 @@ automation:
|
|||||||
# 4 or 8 button remote with button c pressed
|
# 4 or 8 button remote with button c pressed
|
||||||
- id: light_on
|
- id: light_on
|
||||||
alias: "Turn a light on"
|
alias: "Turn a light on"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: insteon.button_on
|
event_type: insteon.button_on
|
||||||
event_data:
|
event_data:
|
||||||
address: 1a2b3c
|
address: 1a2b3c
|
||||||
button: c
|
button: c
|
||||||
condition:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: light.some_light
|
entity_id: light.some_light
|
||||||
state: "off"
|
state: "off"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.some_light
|
entity_id: light.some_light
|
||||||
@ -175,16 +175,16 @@ automation:
|
|||||||
# single button remote
|
# single button remote
|
||||||
- id: light_off
|
- id: light_off
|
||||||
alias: "Turn a light off"
|
alias: "Turn a light off"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: insteon.button_on
|
event_type: insteon.button_on
|
||||||
event_data:
|
event_data:
|
||||||
address: 1a2b3c
|
address: 1a2b3c
|
||||||
condition:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: light.some_light
|
entity_id: light.some_light
|
||||||
state: "off"
|
state: "off"
|
||||||
action:
|
actions:
|
||||||
- action: light.turn_on
|
- action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.some_light
|
entity_id: light.some_light
|
||||||
|
@ -46,7 +46,7 @@ intent:
|
|||||||
description: List of domains that the entity supports.
|
description: List of domains that the entity supports.
|
||||||
required: false
|
required: false
|
||||||
type: list
|
type: list
|
||||||
action:
|
actions:
|
||||||
description: Defines an action to run to intents.
|
description: Defines an action to run to intents.
|
||||||
required: false
|
required: false
|
||||||
type: action
|
type: action
|
||||||
@ -109,7 +109,7 @@ conversation:
|
|||||||
|
|
||||||
intent_script:
|
intent_script:
|
||||||
EventCountToday:
|
EventCountToday:
|
||||||
action:
|
actions:
|
||||||
- action: calendar.get_events
|
- action: calendar.get_events
|
||||||
target:
|
target:
|
||||||
entity_id: calendar.my_calendar
|
entity_id: calendar.my_calendar
|
||||||
|
@ -92,7 +92,7 @@ A Home Assistant `isy994_control` event is emitted for every "control" event in
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "turn off living room on double tap lightswitch"
|
- alias: "turn off living room on double tap lightswitch"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: isy994_control
|
event_type: isy994_control
|
||||||
event_data:
|
event_data:
|
||||||
@ -102,7 +102,7 @@ automation:
|
|||||||
formatted: "On"
|
formatted: "On"
|
||||||
uom: "100"
|
uom: "100"
|
||||||
prec: "0"
|
prec: "0"
|
||||||
action:
|
actions:
|
||||||
action: light.turn_off
|
action: light.turn_off
|
||||||
target:
|
target:
|
||||||
entity_id: light.lr_track_lights_rear
|
entity_id: light.lr_track_lights_rear
|
||||||
|
@ -229,11 +229,11 @@ A typical automation might look like the example below, which turns up the light
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: kaleidescape_theater_lights_up
|
- alias: kaleidescape_theater_lights_up
|
||||||
trigger:
|
triggers:
|
||||||
- platform: state
|
- platform: state
|
||||||
entity_id: sensor.kaleidescape_theater_media_location
|
entity_id: sensor.kaleidescape_theater_media_location
|
||||||
from: content
|
from: content
|
||||||
action:
|
actions:
|
||||||
- action: scene.turn_on
|
- action: scene.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: scene.theater_lights
|
entity_id: scene.theater_lights
|
||||||
|
@ -93,7 +93,7 @@ And an automation rule to breathe life into it:
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
alias: "Keyboard all lights on"
|
alias: "Keyboard all lights on"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: keyboard_remote_command_received
|
event_type: keyboard_remote_command_received
|
||||||
event_data:
|
event_data:
|
||||||
@ -101,7 +101,7 @@ automation:
|
|||||||
key_code: 107 # inspect log to obtain desired keycode
|
key_code: 107 # inspect log to obtain desired keycode
|
||||||
type: key_down # only trigger on key_down events (optional)
|
type: key_down # only trigger on key_down events (optional)
|
||||||
|
|
||||||
action:
|
actions:
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
target:
|
target:
|
||||||
entity_id: light.all
|
entity_id: light.all
|
||||||
@ -124,10 +124,10 @@ Here's an automation example that plays a sound through a media player whenever
|
|||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
- alias: "Keyboard Connected"
|
- alias: "Keyboard Connected"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: keyboard_remote_connected
|
event_type: keyboard_remote_connected
|
||||||
action:
|
actions:
|
||||||
- action: media_player.play_media
|
- action: media_player.play_media
|
||||||
target:
|
target:
|
||||||
entity_id: media_player.speaker
|
entity_id: media_player.speaker
|
||||||
@ -136,12 +136,12 @@ automation:
|
|||||||
media_content_type: music
|
media_content_type: music
|
||||||
|
|
||||||
- alias: "Bluetooth Keyboard Disconnected"
|
- alias: "Bluetooth Keyboard Disconnected"
|
||||||
trigger:
|
triggers:
|
||||||
platform: event
|
platform: event
|
||||||
event_type: keyboard_remote_disconnected
|
event_type: keyboard_remote_disconnected
|
||||||
event_data:
|
event_data:
|
||||||
device_name: "00:58:56:4C:C0:91"
|
device_name: "00:58:56:4C:C0:91"
|
||||||
action:
|
actions:
|
||||||
- action: media_player.play_media
|
- action: media_player.play_media
|
||||||
target:
|
target:
|
||||||
entity_id: media_player.speaker
|
entity_id: media_player.speaker
|
||||||
|
@ -211,12 +211,12 @@ Example automation using these IR codes to toggle a Sonoff plug.
|
|||||||
- id: "1583339338363"
|
- id: "1583339338363"
|
||||||
alias: "Panasonic On"
|
alias: "Panasonic On"
|
||||||
description: Turn on sonoff s20 relay
|
description: Turn on sonoff s20 relay
|
||||||
trigger:
|
triggers:
|
||||||
- entity_id: sensor.kira_wireless
|
- entity_id: sensor.kira_wireless
|
||||||
platform: state
|
platform: state
|
||||||
to: PanaOne
|
to: PanaOne
|
||||||
condition: []
|
conditions: []
|
||||||
action:
|
actions:
|
||||||
- device_id: 3628b4f34df943b3b721ead954cf3ca7
|
- device_id: 3628b4f34df943b3b721ead954cf3ca7
|
||||||
domain: switch
|
domain: switch
|
||||||
entity_id: switch.plug2_relay
|
entity_id: switch.plug2_relay
|
||||||
@ -224,12 +224,12 @@ Example automation using these IR codes to toggle a Sonoff plug.
|
|||||||
- id: "1584035716024"
|
- id: "1584035716024"
|
||||||
alias: "Panaxonic Off "
|
alias: "Panaxonic Off "
|
||||||
description: Turn off sonoff s20 relay
|
description: Turn off sonoff s20 relay
|
||||||
trigger:
|
triggers:
|
||||||
- entity_id: sensor.kira_wireless
|
- entity_id: sensor.kira_wireless
|
||||||
platform: state
|
platform: state
|
||||||
to: PanaTwo
|
to: PanaTwo
|
||||||
condition: []
|
conditions: []
|
||||||
action:
|
actions:
|
||||||
- device_id: 3628b4f34df943b3b721ead954cf3ca7
|
- device_id: 3628b4f34df943b3b721ead954cf3ca7
|
||||||
domain: switch
|
domain: switch
|
||||||
entity_id: switch.plug2_relay
|
entity_id: switch.plug2_relay
|
||||||
|
@ -243,12 +243,12 @@ Example automation configuration
|
|||||||
```yaml
|
```yaml
|
||||||
- alias: Single group address trigger
|
- alias: Single group address trigger
|
||||||
description: ''
|
description: ''
|
||||||
trigger:
|
triggers:
|
||||||
- platform: knx.telegram
|
- platform: knx.telegram
|
||||||
destination: 1/2/3
|
destination: 1/2/3
|
||||||
group_value_read: false
|
group_value_read: false
|
||||||
outgoing: false
|
outgoing: false
|
||||||
condition: "{{ trigger.value == 0 }}"
|
conditions: "{{ trigger.value == 0 }}"
|
||||||
action: []
|
action: []
|
||||||
mode: single
|
mode: single
|
||||||
```
|
```
|
||||||
@ -259,7 +259,7 @@ Example trigger data
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
variables:
|
variables:
|
||||||
trigger:
|
triggers:
|
||||||
id: "0"
|
id: "0"
|
||||||
idx: "0"
|
idx: "0"
|
||||||
alias: null
|
alias: null
|
||||||
@ -368,21 +368,21 @@ address:
|
|||||||
```yaml
|
```yaml
|
||||||
# Example automation to update a cover position after 10 seconds of movement initiation
|
# Example automation to update a cover position after 10 seconds of movement initiation
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: knx.telegram
|
- platform: knx.telegram
|
||||||
# Cover move trigger
|
# Cover move trigger
|
||||||
destination: "0/4/20"
|
destination: "0/4/20"
|
||||||
action:
|
actions:
|
||||||
- delay: 0:0:10
|
- delay: 0:0:10
|
||||||
- action: knx.read
|
- action: knx.read
|
||||||
data:
|
data:
|
||||||
# Cover position address
|
# Cover position address
|
||||||
address: "0/4/21"
|
address: "0/4/21"
|
||||||
|
|
||||||
- trigger:
|
- triggers:
|
||||||
- platform: homeassistant
|
- platform: homeassistant
|
||||||
event: start
|
event: start
|
||||||
action:
|
actions:
|
||||||
# Register the group address to trigger a knx_event
|
# Register the group address to trigger a knx_event
|
||||||
- action: knx.event_register
|
- action: knx.event_register
|
||||||
data:
|
data:
|
||||||
@ -595,7 +595,7 @@ Let's pretend you have a binary sensor with the name `Livingroom.Switch` and you
|
|||||||
```yaml
|
```yaml
|
||||||
# Example automation.yaml entry
|
# Example automation.yaml entry
|
||||||
automation:
|
automation:
|
||||||
- trigger:
|
- triggers:
|
||||||
platform: numeric_state
|
platform: numeric_state
|
||||||
entity_id: binary_sensor.livingroom_switch
|
entity_id: binary_sensor.livingroom_switch
|
||||||
attribute: counter
|
attribute: counter
|
||||||
@ -605,20 +605,20 @@ automation:
|
|||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.cover_abstell
|
entity_id: binary_sensor.cover_abstell
|
||||||
state: "on"
|
state: "on"
|
||||||
action:
|
actions:
|
||||||
- entity_id: light.hue_color_lamp_1
|
- entity_id: light.hue_color_lamp_1
|
||||||
action: light.turn_on
|
action: light.turn_on
|
||||||
- trigger:
|
- triggers:
|
||||||
platform: numeric_state
|
platform: numeric_state
|
||||||
entity_id: binary_sensor.livingroom_switch
|
entity_id: binary_sensor.livingroom_switch
|
||||||
attribute: counter
|
attribute: counter
|
||||||
above: 1
|
above: 1
|
||||||
below: 3
|
below: 3
|
||||||
condition:
|
conditions:
|
||||||
- condition: state
|
- condition: state
|
||||||
entity_id: binary_sensor.cover_abstell
|
entity_id: binary_sensor.cover_abstell
|
||||||
state: "on"
|
state: "on"
|
||||||
action:
|
actions:
|
||||||
- entity_id: light.hue_bloom_1
|
- entity_id: light.hue_bloom_1
|
||||||
action: homeassistant.turn_on
|
action: homeassistant.turn_on
|
||||||
- entity_id: light.hue_bloom_2
|
- entity_id: light.hue_bloom_2
|
||||||
|
@ -45,24 +45,24 @@ These automations can be configured through the UI (see [device triggers](/docs/
|
|||||||
automation:
|
automation:
|
||||||
- id: kodi_turn_on
|
- id: kodi_turn_on
|
||||||
alias: "Kodi: turn on"
|
alias: "Kodi: turn on"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: device
|
- platform: device
|
||||||
device_id: !secret kodi_device_id
|
device_id: !secret kodi_device_id
|
||||||
domain: kodi
|
domain: kodi
|
||||||
entity_id: media_player.kodi
|
entity_id: media_player.kodi
|
||||||
type: turn_on
|
type: turn_on
|
||||||
action:
|
actions:
|
||||||
- action: script.kodi_turn_on
|
- action: script.kodi_turn_on
|
||||||
|
|
||||||
- id: kodi_turn_off
|
- id: kodi_turn_off
|
||||||
alias: "Kodi: turn off"
|
alias: "Kodi: turn off"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: device
|
- platform: device
|
||||||
device_id: !secret kodi_device_id
|
device_id: !secret kodi_device_id
|
||||||
domain: kodi
|
domain: kodi
|
||||||
entity_id: media_player.kodi
|
entity_id: media_player.kodi
|
||||||
type: turn_off
|
type: turn_off
|
||||||
action:
|
actions:
|
||||||
- action: script.kodi_turn_off
|
- action: script.kodi_turn_off
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -434,12 +434,12 @@ A example of a automation to turn up/down the volume of a receiver using the eve
|
|||||||
alias: Kodi keypress
|
alias: Kodi keypress
|
||||||
mode: parallel
|
mode: parallel
|
||||||
max: 10
|
max: 10
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: kodi_keypress
|
event_type: kodi_keypress
|
||||||
event_data:
|
event_data:
|
||||||
entity_id: media_player.kodi_livingroom
|
entity_id: media_player.kodi_livingroom
|
||||||
action:
|
actions:
|
||||||
- choose:
|
- choose:
|
||||||
- conditions:
|
- conditions:
|
||||||
- condition: template
|
- condition: template
|
||||||
|
@ -164,12 +164,12 @@ To add a notification sound, icon, cycles, or priority override,
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- alias: "Send notification on arrival at school"
|
- alias: "Send notification on arrival at school"
|
||||||
trigger:
|
triggers:
|
||||||
platform: state
|
platform: state
|
||||||
entity_id: device_tracker.tom_mobile
|
entity_id: device_tracker.tom_mobile
|
||||||
from: "not_home"
|
from: "not_home"
|
||||||
to: "school"
|
to: "school"
|
||||||
action:
|
actions:
|
||||||
action: notify.my_lametric
|
action: notify.my_lametric
|
||||||
data:
|
data:
|
||||||
message: "Tom has arrived at school!"
|
message: "Tom has arrived at school!"
|
||||||
|
@ -76,10 +76,10 @@ If you're comfortable with YAML, this code could be used:
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
alias: "Heat Meter manual update"
|
alias: "Heat Meter manual update"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: time
|
- platform: time
|
||||||
at: "23:30:00"
|
at: "23:30:00"
|
||||||
action:
|
actions:
|
||||||
- action: homeassistant.update_entity
|
- action: homeassistant.update_entity
|
||||||
target:
|
target:
|
||||||
entity_id: sensor.heat_meter_heat_usage_gj
|
entity_id: sensor.heat_meter_heat_usage_gj
|
||||||
|
@ -162,11 +162,11 @@ Trigger on a transponder event and ensure that the received code is in the given
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: lcn_transponder
|
event_type: lcn_transponder
|
||||||
condition: "{{ trigger.event.data.code in ['aabbcc', 'ddeeff', '112233'] }}"
|
condition: "{{ trigger.event.data.code in ['aabbcc', 'ddeeff', '112233'] }}"
|
||||||
action:
|
actions:
|
||||||
...
|
...
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -245,7 +245,7 @@ receiver hardware is connected to module 7 in segment 0.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: lcn_transmitter
|
event_type: lcn_transmitter
|
||||||
event_data:
|
event_data:
|
||||||
@ -270,7 +270,7 @@ any hardware module.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: lcn_transponder
|
event_type: lcn_transponder
|
||||||
event_data:
|
event_data:
|
||||||
@ -292,7 +292,7 @@ any hardware module.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: lcn_fingerprint
|
event_type: lcn_fingerprint
|
||||||
event_data:
|
event_data:
|
||||||
@ -314,7 +314,7 @@ any hardware module.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: lcn_codelock
|
event_type: lcn_codelock
|
||||||
event_data:
|
event_data:
|
||||||
@ -337,7 +337,7 @@ key `a1`.
|
|||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
automation:
|
automation:
|
||||||
trigger:
|
triggers:
|
||||||
- platform: event
|
- platform: event
|
||||||
event_type: lcn_send_keys
|
event_type: lcn_send_keys
|
||||||
event_data:
|
event_data:
|
||||||
|
@ -39,10 +39,10 @@ wake_on_lan: # enables `wake_on_lan` integration
|
|||||||
# Enables the `lg_netcast` media player
|
# Enables the `lg_netcast` media player
|
||||||
automation:
|
automation:
|
||||||
- alias: "Turn On Living Room TV with WakeOnLan"
|
- alias: "Turn On Living Room TV with WakeOnLan"
|
||||||
trigger:
|
triggers:
|
||||||
- platform: lg_netcast.turn_on
|
- platform: lg_netcast.turn_on
|
||||||
entity_id: media_player.lg_netcast_smart_tv
|
entity_id: media_player.lg_netcast_smart_tv
|
||||||
action:
|
actions:
|
||||||
- action: wake_on_lan.send_magic_packet
|
- action: wake_on_lan.send_magic_packet
|
||||||
data:
|
data:
|
||||||
mac: AA-BB-CC-DD-EE-FF
|
mac: AA-BB-CC-DD-EE-FF
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user