diff --git a/source/_components/media_player.webostv.markdown b/source/_components/media_player.webostv.markdown index b045ccc518a5..a4afa661dadb 100644 --- a/source/_components/media_player.webostv.markdown +++ b/source/_components/media_player.webostv.markdown @@ -76,8 +76,8 @@ Avoid using `[ ]` in the `name:` of your device. Home Assistant is able to turn on a LG webOS Smart TV if you specify an action, like HDMI-CEC or WakeOnLan. -Common for webOS 3.0 and higher would be to use WakeOnLan feature. -To use this feature your TV should be connected to your network via Ethernet rather than Wireless and you should enable *LG Connect Apps* feature in *Network* settings of the TV [instructions](http://www.lg.com/uk/support/product-help/CT00008334-1437131798537-others) (or *Mobile App* in *General* settings for older models). +Common for webOS 3.0 and higher would be to use WakeOnLan feature. +To use this feature your TV should be connected to your network via Ethernet rather than Wireless and you should enable *LG Connect Apps* feature in *Network* settings of the TV [instructions](http://www.lg.com/uk/support/product-help/CT00008334-1437131798537-others) (or *Mobile App* in *General* settings for older models) (*may vary by version). On newer models (2017+), WakeOnLan may need to be enabled in the TV settings by going to Settings > General > Mobile TV On > Turn On Via WiFi [instructions](https://support.quanticapps.com/hc/en-us/articles/115005985729-How-to-turn-on-my-LG-Smart-TV-using-the-App-WebOS-). ```yaml # Example configuration.yaml entry diff --git a/source/_components/sensor.trafikverket_weatherstation.markdown b/source/_components/sensor.trafikverket_weatherstation.markdown index 272c4e09941b..5ef302c60c79 100644 --- a/source/_components/sensor.trafikverket_weatherstation.markdown +++ b/source/_components/sensor.trafikverket_weatherstation.markdown @@ -12,11 +12,12 @@ ha_category: Sensor ha_release: 0.66.0 --- -Showing weather information for air and road temperature provided by [Trafikverket](https://www.trafikverket.se/) in Sweden. +Showing weather information for air and road temperature as well as precipitation provided by [Trafikverket](https://www.trafikverket.se/) in Sweden. +Precipitation is returned as a string of text in Swedish. Potential use cases: - Get weather data in general -- You live near a weather station and want to know the current temperature at home +- You live near a weather station and want to know the current temperature or precipitation at home - Setup automations for your car heating system. If the road is frozen along the way to work, you might want the car heating system to start earlier. ##### {% linkable_title Configuration %} @@ -46,7 +47,7 @@ station: required: true type: string type: - description: Defines which temperature you want (`air` or `road`). + description: Defines which data you want (`air`, `road` or `precipitation`). required: true type: string scan_interval: @@ -83,4 +84,10 @@ sensor: station: Lanna type: air scan_interval: 600 + - platform: trafikverket_weatherstation + name: Trafikverket Precipitation WeatherStation Nöbbele + api_key: eXXcbXXXacXXXXc39XX3aXXX4aXX46XX + station: Nöbbele + type: precipitation + scan_interval: 600 ``` diff --git a/source/_docs/automation/trigger.markdown b/source/_docs/automation/trigger.markdown index edccbd457b88..e682a20c3890 100644 --- a/source/_docs/automation/trigger.markdown +++ b/source/_docs/automation/trigger.markdown @@ -159,6 +159,10 @@ automation: ``` {% endraw %} +
+Rendering templates with time (`now()`) is dangerous as trigger templates only update based on entity state changes. +
+ ### {% linkable_title Time trigger %} Time can be triggered in many ways. The most common is to specify `at` and trigger at a specific point in time each day. Alternatively, you can also match if the hour, minute or second of the current time has a specific value. You can prefix the value with a `/` to match whenever the value is divisible by that number. You cannot use `at` together with hour, minute or second. diff --git a/source/_docs/configuration/entity-registry.markdown b/source/_docs/configuration/entity-registry.markdown index b6183f7b76b9..b699bb979eb4 100644 --- a/source/_docs/configuration/entity-registry.markdown +++ b/source/_docs/configuration/entity-registry.markdown @@ -9,27 +9,18 @@ sharing: true footer: true --- --This is a new and experimental feature of Home Assistant. -
+Starting with version 0.63, Home Assistant keeps a registry of known entities. The entity registry makes sure that entities get unique identifiers and allow customizing the identifiers and names of these entities. -Starting with version 0.63, Home Assistant keeps a registry of known entities. -The entity registry makes sure that entities get unique identifiers and allow -customizing the identifiers and names of these entities. - -As this is still a very new part of Home Assistant, changes will require a -restart of Home Assistant to take effect. A config user interface will be added -in a future version. +Changes require that Home Assistant is shut down when you edit the file, otherwise Home Assistant may over-write your changes, and a restart of Home Assistant is required for your changes to take effect. Version 0.75 introduced a configuration user interface.An entity needs to have a unique ID to be registered in the entity registry. Not all integrations currently provide a unique id for their entities.
-The entity registry is stored in `-Rendering templates with time is dangerous as updates only trigger templates in sensors based on entity state changes. +Rendering templates with time (`now()`) is dangerous as updates only trigger templates in sensors based on entity state changes.
## {% linkable_title Home Assistant template extensions %} @@ -117,43 +114,51 @@ In templates, besides the normal [state object methods and properties](/topics/s ## {% linkable_title Examples %} ### {% linkable_title States %} + The next two statements result in same value if state exists. The second one will result in an error if state does not exist. +{% raw %} ```text -{% raw %}{{ states('device_tracker.paulus') }} -{{ states.device_tracker.paulus.state }}{% endraw %} +{{ states('device_tracker.paulus') }} +{{ states.device_tracker.paulus.state }} ``` +{% endraw %} ### {% linkable_title Attributes %} Print an attribute if state is defined. Both will return the same thing but the last one you can specify entity_id from a variable. +{% raw %} ```text -{% raw %}{% if states.device_tracker.paulus %} +{% if states.device_tracker.paulus %} {{ states.device_tracker.paulus.attributes.battery }} {% else %} ?? -{% endif %}{% endraw %} +{% endif %} ``` +{% endraw %} With strings +{% raw %} ```text -{% raw %}{% set tracker_name = "paulus"%} +{% set tracker_name = "paulus"%} {% if states("device_tracker." + tracker_name) != "unknown" %} {{ state_attr("device_tracker." + tracker_name, "battery")}} {% else %} ?? -{% endif %}{% endraw %} +{% endif %} ``` +{% endraw %} ### {% linkable_title Sensor states %} Print out a list of all the sensor states. +{% raw %} ```text -{% raw %}{% for state in states.sensor %} +{% for state in states.sensor %} {{ state.entity_id }}={{ state.state }}, {% endfor %} @@ -173,48 +178,58 @@ Print out a list of all the sensor states. {{ as_timestamp(states.binary_sensor.garage_door.last_changed) }} -{{ as_timestamp(now()) - as_timestamp(states.binary_sensor.garage_door.last_changed) }}{% endraw %} +{{ as_timestamp(now()) - as_timestamp(states.binary_sensor.garage_door.last_changed) }} ``` +{% endraw %} ### {% linkable_title Distance examples %} If only 1 location is passed in, Home Assistant will measure the distance from home. +{% raw %} ```text -{% raw %}Using Lat Lng coordinates: {{ distance(123.45, 123.45) }} +Using Lat Lng coordinates: {{ distance(123.45, 123.45) }} Using State: {{ distance(states.device_tracker.paulus) }} These can also be combined in any combination: {{ distance(123.45, 123.45, 'device_tracker.paulus') }} -{{ distance('device_tracker.anne_therese', 'device_tracker.paulus') }}{% endraw %} +{{ distance('device_tracker.anne_therese', 'device_tracker.paulus') }} ``` +{% endraw %} ### {% linkable_title Closest examples %} Find entities closest to the Home Assistant location: +{% raw %} ```text -{% raw %}Query all entities: {{ closest(states) }} +Query all entities: {{ closest(states) }} Query all entities of a specific domain: {{ closest('states.device_tracker') }} Query all entities in group.children: {{ closest('group.children') }} -Query all entities in group.children: {{ closest(states.group.children) }}{% endraw %} +Query all entities in group.children: {{ closest(states.group.children) }} ``` +{% endraw %} Find entities closest to a coordinate or another entity. All previous arguments still apply for 2nd argument. +{% raw %} ```text -{% raw %}Closest to a coordinate: {{ closest(23.456, 23.456, 'group.children') }} +Closest to a coordinate: {{ closest(23.456, 23.456, 'group.children') }} Closest to an entity: {{ closest('zone.school', 'group.children') }} -Closest to an entity: {{ closest(states.zone.school, 'group.children') }}{% endraw %} +Closest to an entity: {{ closest(states.zone.school, 'group.children') }} ``` +{% endraw %} ### {% linkable_title Combined %} + Since closest returns a state, we can combine it with distance too. +{% raw %} ```text -{% raw %}{{ closest(states).name }} is {{ distance(closest(states)) }} kilometers away.{% endraw %} +{{ closest(states).name }} is {{ distance(closest(states)) }} kilometers away. ``` +{% endraw %} ## {% linkable_title Processing incoming data %} @@ -238,11 +253,13 @@ This means that if the incoming values looks like the sample below: The template for `on` would be: +{% raw %} ```yaml -'{% raw %}{{value_json.on}}{% endraw %}' +'{{value_json.on}}' ``` +{% endraw %} -Nested JSON in a response is supported as well +Nested JSON in a response is supported as well: ```json { @@ -259,10 +276,11 @@ Nested JSON in a response is supported as well Just use the "Square bracket notation" to get the value. +{% raw %} ```yaml -'{% raw %}{{ value_json["values"]["temp"] }}{% endraw %}' +'{{ value_json["values"]["temp"] }}' ``` - +{% endraw %} The following overview contains a couple of options to get the needed values: @@ -294,8 +312,8 @@ The following overview contains a couple of options to get the needed values: To evaluate a response, go to the