diff --git a/_config.yml b/_config.yml index 08612e54735..1bb5a20bd4a 100644 --- a/_config.yml +++ b/_config.yml @@ -76,6 +76,8 @@ collections: output: true faq: output: true + lovelace: + output: true # ----------------------- # # 3rd Party Settings # diff --git a/source/_includes/asides/lovelace_navigation.html b/source/_includes/asides/lovelace_navigation.html new file mode 100644 index 00000000000..fd19a6462df --- /dev/null +++ b/source/_includes/asides/lovelace_navigation.html @@ -0,0 +1,22 @@ +
+ + {% assign cards = site.lovelace | sort: 'title' %} + +
+

Lovelace UI

+ +
+ +
+

Cards

+ +
+
diff --git a/source/_includes/site/sidebar.html b/source/_includes/site/sidebar.html index 6ee8aaf444b..81abe7cd946 100644 --- a/source/_includes/site/sidebar.html +++ b/source/_includes/site/sidebar.html @@ -2,8 +2,10 @@ {% assign url_parts = page.url | split: '/' %} {% if url_parts[1] == 'components' %} {% include asides/component_navigation.html | compact_newlines %} - {% elsif url_parts[1] == 'cookbook' %} + {% elsif url_parts[1] == 'cookbook' %} {% include asides/cookbook_navigation.html | compact_newlines %} + {% elsif url_parts[1] == 'lovelace' %} + {% include asides/lovelace_navigation.html | compact_newlines %} {% elsif url_parts[1] == 'developers' or url_parts[1] == 'help' %} {% include asides/help_navigation.html | compact_newlines %} {% elsif url_parts[1] == 'getting-started' %} diff --git a/source/_lovelace/glance.markdown b/source/_lovelace/glance.markdown new file mode 100644 index 00000000000..9d2511eada0 --- /dev/null +++ b/source/_lovelace/glance.markdown @@ -0,0 +1,26 @@ +--- +layout: page +title: "Glance Card" +sidebar_label: Glance +description: "The Glance card allows you to see a list of entities at a glance." +date: 2018-07-01 10:28 +00:00 +sidebar: true +comments: false +sharing: true +footer: true +--- + +A card that allows you to see see a list of entities at a glance. + +| Name | Type | Default | Description +| ---- | ---- | ------- | ----------- +| type | string | **Required** | `glance` +| entities | list | **Required** | Entity id's +| title | string | Optional | Card title + +Each entry in the list of entities is either an entity ID or an entity option object. The entity option object can have the following options: + +| Name | Type | Default | Description +| ---- | ---- | ------- | ----------- +| entity | entity id | **Required** | The ID of the entity to show. +| title | string | Optional | The title to use instead of the entity name. diff --git a/source/images/lovelace/lovelace-ui-comparison.png b/source/images/lovelace/lovelace-ui-comparison.png new file mode 100644 index 00000000000..1d79d98716b Binary files /dev/null and b/source/images/lovelace/lovelace-ui-comparison.png differ diff --git a/source/lovelace/index.markdown b/source/lovelace/index.markdown new file mode 100644 index 00000000000..f2b626a3dc3 --- /dev/null +++ b/source/lovelace/index.markdown @@ -0,0 +1,107 @@ +--- +layout: page +title: "Lovelace UI" +description: "The Lovelace UI is a powerful and configurable interface for Home Assistant." +date: 2018-07-01 10:28 +00:00 +sidebar: true +comments: false +sharing: true +footer: true +--- + +

+This is an experimental feature. Configuration might change in future versions. +

+ +Starting with Home Assistant 0.72, we're experimenting with a new way of defining your interface. We're calling it the Lovelace UI. + +The Lovelace UI is: + + - **Extremely fast**. We create the user interface when the UI configuration changes. When a state changes, we just make the UI represent the current state. + - **Extremely customizable**. We have a new file for just configuration. In the past, we declined UI specific options because they did not fit in the state machine. They will fit in a configuration file for a user interface. + - **Extremely extensible**. It's based on the web standard [custom elements](https://developer.mozilla.org/en-US/docs/Web/Web_Components/Using_custom_elements). Don't like the built-in cards? Make your own! Custom cards are treated the same as built-in cards and are configured the same way. [Check the docs.](lovelace_custom_card.md) + - **Making the backend faster**. With Lovelace, the backend will no longer need to maintain entities like groups for the sole purpose of showing them on the frontend. + +## How it works + +The old user interface relied solely on the state machine. This caused trouble as it meant that the state machine was now not only the source for device states, but also for user interface configuration. With Lovelace, we're taking a completely different approach. All user interface configuration will live in a seperate file, controlled by the user. + +

+Diagram showing how states no longer contain UI configuration. +Visual comparison of old configuration versus new configuration +

+ + + +## Trying it out + +Create a new file `/ui-lovelace.yaml` and add the following content: + +```yaml +title: My Awesome Home +views: + # View tab title. + - title: Example + # Optional unique id for direct access /lovelace/${id} + id: example + # Each view can have a different theme applied. Theme should be defined in the frontend. + theme: dark-mode + # The cards to show on this view. + cards: + # The entities card will take a list of entities and show their state. + - type: entities + # Title of the entities card + title: Example + # The entities here will be shown in the same order as specified. + entities: + - input_boolean.switch_ac_kitchen + - input_boolean.switch_ac_livingroom + - input_boolean.switch_tv + + # The filter card will filter available entities for certain criteria + # and render it as type 'entities'. + - type: entity-filter + # Filter criteria. They are all optional. + filter: + - domain: input_boolean + state: 'on' + # This config will be passed to the card rendering the filter results + card_config: + title: Input booleans that are on + + # Specify a tab icon if you want the view tab to be an icon. + - icon: mdi:home-assistant + # Title of the view. Will be used as the tooltip for tab icon + title: Second view + cards: + - type: entities + title: Lots of Kitchen AC + entities: + # It is totally possible to render duplicates. + - input_boolean.switch_ac_kitchen + - input_boolean.switch_ac_kitchen + - input_boolean.switch_ac_kitchen + - input_boolean.switch_ac_kitchen + - input_boolean.switch_ac_kitchen + - input_boolean.switch_ac_kitchen +``` + +Add to your `configuration.yaml`: + +```yaml +input_boolean: + switch_ac_kitchen: + name: AC kitchen + switch_ac_livingroom: + name: AC living room + switch_tv: + name: TV +``` + +Now restart Home Assistant, navigate to `/lovelace`. When you make changes to `ui-lovelace.yaml`, you don't have to restart Home Assistant or refresh the page. Just hit the refresh button at the top of the UI. + +## Current limitations + +This is the very very early version aimed at gathering feedback. Discussion and suggestions are welcome in the [ui-schema repository](https://github.com/home-assistant/ui-schema).