Fabian Affolter 481320128f Re-organisation Documentation and Getting started (#2055)
* Split MQTT documentation

* Add more details

* Move content to /docs

* Enable sidebar

* Move content to /docs

* Enable sidebar

* Move content

* Update links

* Remove wizard stuff

* Enable sidebar

* Minor changes

* Move MQTT parts to /docs

* update links

* Update links and sync content

* Fix link

* Enable sidebar

* Remove navigation

* Remove navigation and other minor updates

* Update links

* Add overview page

* Make title linkable

* Update

* Plit content

* Update links

* Rearrange content

* New getting-started section

* Add icons for docs

* Update for new structure

* Update for new structure

* Add docs navigation

* Add docs overview page

* Remove ecosystem navigation

* Add docs and remove other collections

* Move ecosystem to docs

* Remove duplicate files

* Re-add ecosystem overview

* Move to ecosystem

* Fix permission

* Update navigation

* Remove collection

* Move overview to right folder

* Move mqtt to upper level

* Move notebook to ecosystem

* Remove un-used files

* Add one more rectangle for iOS

* Move two parts back from docs and rename Run step

* Remove colon

* update getting-started section

* Add redirect

* Update

* Update navigation
2017-02-23 11:09:41 +01:00

3.0 KiB

layout, title, description, date, sidebar, comments, sharing, footer, redirect_from
layout title description date sidebar comments sharing footer redirect_from
page YAML Details about YAML to configure Home Assistant. 2015-03-23 12:50 true false true true /getting-started/yaml/

Home Assistant uses the YAML syntax for configuration. YAML might take a while to get used to but is really powerful in allowing you to express complex configurations.

For each component that you want to use in Home Assistant, you add code in your configuration.yaml file to specify its settings. The following example entry specifies that you want to use the notify component with the pushbullet platform.

notify:
  platform: pushbullet
  api_key: "o.1234abcd"
  name: pushbullet
  • A component provides the core logic for some functionality (like notify provides sending notifications).
  • A platform makes the connection to a specific software or hardware platform (like pushbullet works with the service from pushbullet.com).

The basics of YAML syntax are block collections and mappings containing key-value pairs. Each item in a collection starts with a - while mappings have the format key: value. If you specify duplicate keys, the last value for a key is used.

Note that indentation is an important part of specifying relationships using YAML. Things that are indented are nested "inside" things that are one level higher. So in the above example, platform: pushbullet is a property of (nested inside) the notify component. Getting the right indentation can be tricky if you're not using an editor with a fixed width font. Tabs are not allowed to be used for indentation. Convention is to use 2 spaces for each level of indentation. You can use YAMLLint to check if your YAML-syntax is correct before loading it into Home Assistant which will save you some time. Please pay attention on not putting in private data, as it is a 3rd-party website not maintained by Home Assistant.

Text following a # are comments and are ignored by the system.

The next example shows an input_select component that uses a block collection for the options values. The other properties (like name) are specified using mappings. Note that the second line just has threat: with no value on the same line. Here threat is the name of the input_select and the values for it are everything nested below it.

input_select:
  threat:
    name: Threat level
# A collection is used for options
    options:
     - 0
     - 1
     - 2
     - 3
    initial: 0

The following example shows nesting a collection of mappings in a mapping. In Home Assistant, this would create two sensors that each use the MQTT platform but have different values for their state_topic (one of the properties used for MQTT sensors).

sensor:
  - platform: mqtt
    state_topic: sensor/topic
  - platform: mqtt
    state_topic: sensor2/topic