Skip to content

Commit

Permalink
Collection of Markdown/YAML cleanups (home-assistant#16817)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Mar 3, 2021
1 parent 38d2297 commit fad2a45
Show file tree
Hide file tree
Showing 19 changed files with 446 additions and 396 deletions.
2 changes: 1 addition & 1 deletion source/_docs/authentication/multi-factor-auth.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ message:
homeassistant:
auth_mfa_modules:
- type: totp
name: Authenticator app
name: "Authenticator app"
- type: notify
message: "I almost forget, to get into my clubhouse, you need to say {}"
```
Expand Down
31 changes: 16 additions & 15 deletions source/_docs/automation/action.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,24 @@ You can also call the service to activate [a scene](/integrations/scene/) which
automation:
# Change the light in the kitchen and living room to 150 brightness and color red.
trigger:
platform: sun
event: sunset
- platform: sun
event: sunset
action:
service: light.turn_on
data:
brightness: 150
rgb_color: [255, 0, 0]
entity_id:
- light.kitchen
- light.living_room
- service: light.turn_on
target:
entity_id:
- light.kitchen
- light.living_room
data:
brightness: 150
rgb_color: [255, 0, 0]

automation 2:
# Notify me on my mobile phone of an event
trigger:
platform: sun
event: sunset
offset: -00:30
- platform: sun
event: sunset
offset: -00:30
variables:
notification_service: notify.paulus_iphone
action:
Expand All @@ -47,9 +48,9 @@ Conditions can also be part of an action. You can combine multiple service calls
automation:
- alias: "Office at evening"
trigger:
platform: state
entity_id: sensor.office_occupancy
to: "on"
- platform: state
entity_id: sensor.office_occupancy
to: "on"
action:
- service: notify.notify
data:
Expand Down
2 changes: 1 addition & 1 deletion source/_docs/automation/basics.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ We can break up this automation into the following three parts:
(action) Turn the lights on in the living room
```

The first part is the [trigger](/docs/automation/trigger/) of the automation rule. Triggers describe events that should trigger the automation rule. In this case, it is a person arriving home, which can be observed in Home Assistant by observing the state of Paulus changing from 'not_home' to 'home'.
The first part is the [trigger](/docs/automation/trigger/) of the automation rule. Triggers describe events that should trigger the automation rule. In this case, it is a person arriving home, which can be observed in Home Assistant by observing the state of Paulus changing from `not_home` to `home`.

The second part is the [condition](/docs/automation/condition/). Conditions are optional tests that can limit an automation rule to only work in your specific use cases. A condition will test against the current state of the system. This includes the current time, devices, people and other things like the sun. In this case, we only want to act when the sun has set.

Expand Down
30 changes: 15 additions & 15 deletions source/_docs/automation/condition.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ Example of using condition:
automation:
- alias: "Enciende Despacho"
trigger:
platform: state
entity_id: sensor.mini_despacho
to: "on"
- platform: state
entity_id: sensor.mini_despacho
to: "on"
condition:
condition: or
conditions:
- condition: numeric_state
entity_id: sun.sun
attribute: elevation
below: 4
- condition: numeric_state
entity_id: sensor.sensorluz_7_0
below: 10
- condition: or
conditions:
- condition: numeric_state
entity_id: sun.sun
attribute: elevation
below: 4
- condition: numeric_state
entity_id: sensor.sensorluz_7_0
below: 10
action:
- service: scene.turn_on
target:
Expand All @@ -44,9 +44,9 @@ The `condition` option of an automation, also accepts a single condition templat
automation:
- alias: "Enciende Despacho"
trigger:
platform: state
entity_id: sensor.mini_despacho
to: "on"
- platform: state
entity_id: sensor.mini_despacho
to: "on"
condition: "{{ state_attr('sun.sun', 'elevation') < 4 }}"
action:
- service: scene.turn_on
Expand Down
18 changes: 9 additions & 9 deletions source/_docs/automation/templating.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -127,19 +127,19 @@ The following tables show the available trigger data per platform.
# Example configuration.yaml entries
automation:
trigger:
platform: state
entity_id: device_tracker.paulus
- platform: state
entity_id: device_tracker.paulus
action:
service: notify.notify
data:
message: >
Paulus just changed from {{ trigger.from_state.state }}
to {{ trigger.to_state.state }}
- service: notify.notify
data:
message: >
Paulus just changed from {{ trigger.from_state.state }}
to {{ trigger.to_state.state }}
automation 2:
trigger:
platform: mqtt
topic: /notify/+
- platform: mqtt
topic: "/notify/+"
action:
service: >
notify.{{ trigger.topic.split('/')[-1] }}
Expand Down
Loading

0 comments on commit fad2a45

Please sign in to comment.