Merge branch 'current' into next

This commit is contained in:
Franck Nijhof 2020-01-28 16:00:56 +01:00
commit eb54746503
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3
2 changed files with 23 additions and 25 deletions

View File

@ -34,27 +34,19 @@ automation 2:
automation 3:
trigger:
# Multiple Entities for which you want to perform the same action.
# Multiple entities for which you want to perform the same action.
- platform: state
entity_id:
- light.bedroom_closet
to: 'on'
# Trigger when someone leaves the closet light on for 10 minutes.
for: '00:10:00'
- platform: state
entity_id:
- light.kiddos_closet
to: 'on'
for: '00:10:00'
- platform: state
entity_id:
- light.linen_closet
to: 'on'
# Trigger when someone leaves one of those lights on for 10 minutes.
for: '00:10:00'
action:
- service: light.turn_off
data_template:
# Whichever entity triggers the automation we want to turn off THAT entity, not the others.
# Turn off whichever entity triggered the automation.
entity_id: "{{ trigger.entity_id }}"
```
{% endraw %}
@ -76,12 +68,18 @@ It is possible to use `data` and `data_template` concurrently but be aware that
## Trigger State Object
Knowing how to access the [state object](/docs/configuration/state_object/) of a trigger entity could be one of the more common questions. Here are a few ways for the [`state`](#state), [`numeric_state`](#numeric_state) and [`template`](#template) triggers:
Knowing how to access the [state object](/docs/configuration/state_object/) of a trigger entity can be useful in automations. Here are a few ways to access the [`state`](#state), [`numeric_state`](#numeric_state) and [`template`](#template) triggers:
* `trigger.from_state` will return the **previous** [state object](/docs/configuration/state_object/) of the entity.
* `trigger.to_state` will return the **new** [state object](/docs/configuration/state_object/) that triggered trigger.
* `states[trigger.to_state.domain][trigger.to_state.object_id]` will return the **current** [state object](/docs/configuration/state_object/) of the entity.
<div class='note'>
Be aware that if you reference a trigger state object in an automation action, attempting to test that automation by calling the `automation.trigger` service or by clicking EXECUTE in the More Info box for the automation will not work. This is because the trigger state object doesn't exist in those contexts. One way to test automations like these is to manually change the state of the trigger entity at Developer Tools > States.
</div>
## Available Trigger Data
The following tables show the available trigger data per platform.

View File

@ -57,7 +57,7 @@ views:
default: true
{% endconfiguration %}
## Options For Visible
### Options For Visible
If you define `visible` as objects instead of a boolean to specify conditions for displaying the view tab:
@ -83,11 +83,11 @@ View config:
image: /local/lights.png
```
## Paths
## Path
You can link to one view from another view by its path. For this use cards that support navigation (`navigation_path`). Do not use special characters in paths. Do not begin a path with a number. This will cause the parser to read your path as a view index.
You can link to one view from a card in another view when using cards that support navigation (`navigation_path`). The string supplied here will be appended to the string `/lovelace/` to create the path to the view. Do not use special characters in paths. Do not begin a path with a number. This will cause the parser to read your path as a view index.
### Example
#### Example
View config:
@ -107,11 +107,11 @@ Picture card config:
navigation_path: /lovelace/living_room
```
## Icons
## Icon
If you define an icon the title will be used as a tool-tip.
### Example
#### Example
```yaml
- title: Garden
@ -122,7 +122,7 @@ If you define an icon the title will be used as a tool-tip.
You can specify the visibility of views as a whole or per-user. (Note: This is only for the display of the tabs. The url path is still accessible)
### Example
#### Example
```yaml
views:
@ -142,11 +142,11 @@ views:
...
```
## Panel mode
## Panel
This renders the first card on full width, other cards in this view will not be rendered. Good for cards like `map`, `stack` or `picture-elements`.
Setting panel true sets the view to panel mode. In this mode the first card is rendered full-width, other cards in the view will not be rendered. This mode is good when using cards like `map`, `stack` or `picture-elements`.
### Example
#### Example
```yaml
- title: Map
@ -158,18 +158,18 @@ This renders the first card on full width, other cards in this view will not be
- zone.home
```
## Themes
## Theme
Set a separate [theme](/integrations/frontend/#themes) for the view and its cards.
### Example
#### Example
```yaml
- title: Home
theme: happy
```
### Background
## Background
You can style the background of your views with a [theme](/integrations/frontend/#themes). You can use the CSS variable `lovelace-background`. For wallpapers you probably want to use the example below, more options can be found [here](https://developer.mozilla.org/en-US/docs/Web/CSS/background).