👕 Markdown style changes (#15861)

This commit is contained in:
Klaas Schoute 2020-12-09 18:48:17 +01:00 committed by GitHub
parent 46c4eb97f5
commit d99252f613
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
102 changed files with 307 additions and 168 deletions

View File

@ -156,6 +156,7 @@ than one input. For all of these situations, it is best to use the alert in
conjunction with a `Template Binary Sensor`. The following example does that. conjunction with a `Template Binary Sensor`. The following example does that.
{% raw %} {% raw %}
```yaml ```yaml
binary_sensor: binary_sensor:
- platform: template - platform: template
@ -173,6 +174,7 @@ alert:
- ryans_phone - ryans_phone
- kristens_phone - kristens_phone
``` ```
{% endraw %} {% endraw %}
This example will begin firing as soon as the entity `sensor.motion`'s `battery` This example will begin firing as soon as the entity `sensor.motion`'s `battery`
@ -219,6 +221,7 @@ The following will show for a plant how to include the problem `attribute`
of the entity. of the entity.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
alert: alert:
@ -235,6 +238,7 @@ alert:
- ryans_phone - ryans_phone
- kristens_phone - kristens_phone
``` ```
{% endraw %} {% endraw %}
The resulting message could be `Plant Officeplant needs help (moisture low)`. The resulting message could be `Plant Officeplant needs help (moisture low)`.

View File

@ -29,8 +29,10 @@ You can use [templates] for the `title`, `audio`, `text` and `display_url` confi
Here's an example configuration of a Flash briefing skill that will tell you who is at home: Here's an example configuration of a Flash briefing skill that will tell you who is at home:
{% raw %}
```yaml ```yaml
{% raw %}# Example configuration.yaml entry # Example configuration.yaml entry
alexa: alexa:
flash_briefings: flash_briefings:
password: YOUR_PASSWORD password: YOUR_PASSWORD
@ -43,9 +45,11 @@ alexa:
{%- else -%} {%- else -%}
Anne Therese is at {{ states("device_tracker.anne_therese") }} Anne Therese is at {{ states("device_tracker.anne_therese") }}
and Paulus is at {{ states("device_tracker.paulus") }} and Paulus is at {{ states("device_tracker.paulus") }}
{% endif %}{% endraw %} {% endif %}
``` ```
{% endraw %}
You can add multiple items for a feed if you want. The Amazon required UID and timestamp will be randomly generated at startup and change at every restart of Home Assistant. You can add multiple items for a feed if you want. The Amazon required UID and timestamp will be randomly generated at startup and change at every restart of Home Assistant.
Please refer to the [Amazon documentation][flash-briefing-api-docs] for more information about allowed configuration parameters and formats. Please refer to the [Amazon documentation][flash-briefing-api-docs] for more information about allowed configuration parameters and formats.

View File

@ -303,27 +303,30 @@ In the examples above, we told Alexa to say `OK` when she successfully completed
First create a file called `alexa_confirm.yaml` with something like the following in it (go on, be creative!): First create a file called `alexa_confirm.yaml` with something like the following in it (go on, be creative!):
{% raw %}
```text ```text
{% raw %} > {{ [
{{ [ "OK",
"OK", "Sure",
"Sure", "If you insist",
"If you insist", "Done",
"Done", "No worries",
"No worries", "I can do that",
"I can do that", "Leave it to me",
"Leave it to me", "Consider it done",
"Consider it done", "As you wish",
"As you wish", "By your command",
"By your command", "Affirmative",
"Affirmative", "Yes oh revered one",
"Yes oh revered one", "I will",
"I will", "As you decree, so shall it be",
"As you decree, so shall it be", "No Problem"
"No Problem" ] | random }}
] | random }} {% endraw %}
``` ```
{% endraw %}
Then, wherever you would put some simple text for a response like `OK`, replace it with a reference to the file so that: Then, wherever you would put some simple text for a response like `OK`, replace it with a reference to the file so that:
```yaml ```yaml

View File

@ -368,8 +368,6 @@ The `endpoint`, `client_id` and `client_secret` are optional, and are only requi
By default, no entity will be excluded. To limit which entities are being exposed to Alexa, you can use the `filter` parameter. Keep in mind that only [supported platforms](#supported-platforms) can be added. By default, no entity will be excluded. To limit which entities are being exposed to Alexa, you can use the `filter` parameter. Keep in mind that only [supported platforms](#supported-platforms) can be added.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
alexa: alexa:
@ -384,8 +382,6 @@ alexa:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -87,8 +87,6 @@ filter:
By default, no entity will be excluded. To limit which entities are being exposed to `Apache Kafka`, you can use the `filter` parameter. By default, no entity will be excluded. To limit which entities are being exposed to `Apache Kafka`, you can use the `filter` parameter.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
apache_kafka: apache_kafka:
@ -105,8 +103,6 @@ apache_kafka:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -119,8 +119,6 @@ Event Hubs have a retention time of at most 7 days, if you do not capture or use
By default, no entity will be excluded. To limit which entities are being exposed to `Azure Event Hub`, you can use the `filter` parameter. By default, no entity will be excluded. To limit which entities are being exposed to `Azure Event Hub`, you can use the `filter` parameter.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
azure_event_hub: azure_event_hub:
@ -138,8 +136,6 @@ azure_event_hub:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -135,6 +135,7 @@ binary_sensor:
Finally, here's an example for `template` observation platform, as seen in the configuration it requires `value_template`. Finally, here's an example for `template` observation platform, as seen in the configuration it requires `value_template`.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
binary_sensor: binary_sensor:
@ -148,6 +149,7 @@ binary_sensor:
{{is_state('device_tracker.paulus','not_home') and ((as_timestamp(now()) - as_timestamp(states.device_tracker.paulus.last_changed)) > 300)}} {{is_state('device_tracker.paulus','not_home') and ((as_timestamp(now()) - as_timestamp(states.device_tracker.paulus.last_changed)) > 300)}}
prob_given_true: 0.95 prob_given_true: 0.95
``` ```
{% endraw %} {% endraw %}
The template is re-evaluated whenever an entity ID that it references changes state. If you use non-deterministic functions like `now()` in the template it will not be continuously re-evaluated, but only when an entity ID that is referenced is updated. The template is re-evaluated whenever an entity ID that it references changes state. If you use non-deterministic functions like `now()` in the template it will not be continuously re-evaluated, but only when an entity ID that is referenced is updated.

View File

@ -49,6 +49,7 @@ binary_sensor:
resource: http://IP_ADDRESS/ENDPOINT resource: http://IP_ADDRESS/ENDPOINT
method: POST method: POST
``` ```
or a template based request: or a template based request:
```yaml ```yaml

View File

@ -228,9 +228,10 @@ binary_sensor:
### Device Tracker sensor with Latitude and Longitude Attributes ### Device Tracker sensor with Latitude and Longitude Attributes
This example shows how to combine a non-GPS (e.g., NMAP) and GPS device tracker while still including latitude and longitude attributes This example shows how to combine a non-GPS (e.g., NMAP) and GPS device tracker while still including latitude and longitude attributes
{% raw %} {% raw %}
```yaml ```yaml
binary_sensor: binary_sensor:
- platform: template - platform: template
@ -253,6 +254,7 @@ binary_sensor:
{{ state_attr('device_tracker.my_device_gps','longitude') }} {{ state_attr('device_tracker.my_device_gps','longitude') }}
{% endif %} {% endif %}
``` ```
{% endraw %} {% endraw %}
### Change the icon when state changes ### Change the icon when state changes
@ -293,6 +295,7 @@ thousands state changed events per day, templates may re-render more than desira
In the below example, re-renders are limited to once per minute: In the below example, re-renders are limited to once per minute:
{% raw %} {% raw %}
```yaml ```yaml
binary_sensor: binary_sensor:
- platform: template - platform: template
@ -300,11 +303,13 @@ binary_sensor:
has_unavailable_states: has_unavailable_states:
value_template: '{{ states | selectattr('state', 'in', ['unavailable', 'unknown', 'none']) | list | count }}' value_template: '{{ states | selectattr('state', 'in', ['unavailable', 'unknown', 'none']) | list | count }}'
``` ```
{% endraw %} {% endraw %}
In the below example, re-renders are limited to once per second: In the below example, re-renders are limited to once per second:
{% raw %} {% raw %}
```yaml ```yaml
binary_sensor: binary_sensor:
- platform: template - platform: template
@ -312,6 +317,7 @@ binary_sensor:
has_sensor_unavailable_states: has_sensor_unavailable_states:
value_template: '{{ states.sensor | selectattr('state', 'in', ['unavailable', 'unknown', 'none']) | list | count }}' value_template: '{{ states.sensor | selectattr('state', 'in', ['unavailable', 'unknown', 'none']) | list | count }}'
``` ```
{% endraw %} {% endraw %}
If the template accesses every state on the system, a rate limit of one update per minute is applied. If the template accesses all states under a specific domain, a rate limit of one update per second is applied. If the template only accesses specific states, receives update events for specifically referenced entities, or the `homeassistant.update_entity` service is used, no rate limit is applied. If the template accesses every state on the system, a rate limit of one update per minute is applied. If the template accesses all states under a specific domain, a rate limit of one update per second is applied. If the template only accesses specific states, receives update events for specifically referenced entities, or the `homeassistant.update_entity` service is used, no rate limit is applied.

View File

@ -150,6 +150,7 @@ When motion is detected, you can use the Blink Home Assistant integration to sav
Again, this example assumes your camera's name (in the blink app) is `My Camera` and your sync module name is `My Sync Module`. The file will be saved to `/tmp/videos/blink_video_{YYYMMDD_HHmmSS}.mp4` where `{YYYYMMDD_HHmmSS}` will be a timestamp create via the use of [templating](/docs/configuration/templating/). Again, this example assumes your camera's name (in the blink app) is `My Camera` and your sync module name is `My Sync Module`. The file will be saved to `/tmp/videos/blink_video_{YYYMMDD_HHmmSS}.mp4` where `{YYYYMMDD_HHmmSS}` will be a timestamp create via the use of [templating](/docs/configuration/templating/).
{% raw %} {% raw %}
```yaml ```yaml
- id: save_blink_video_on_motion - id: save_blink_video_on_motion
alias: Save Blink Video on Motion alias: Save Blink Video on Motion
@ -162,6 +163,6 @@ Again, this example assumes your camera's name (in the blink app) is `My Camera`
data: data:
name: "My Camera" name: "My Camera"
filename: "/tmp/videos/blink_video_{{ now().strftime('%Y%m%d_%H%M%S') }}.mp4" filename: "/tmp/videos/blink_video_{{ now().strftime('%Y%m%d_%H%M%S') }}.mp4"
``` ```
{% endraw %} {% endraw %}

View File

@ -217,9 +217,11 @@ By using specific text in the event title, you can set conditions to initiate pa
For example, the actions following this condition will only be executed for events named 'vacation': For example, the actions following this condition will only be executed for events named 'vacation':
{% raw %} {% raw %}
```yaml ```yaml
condition: condition:
condition: template condition: template
value_template: "{{is_state_attr('calendar.calendar_name', 'message', 'vacation') }}" value_template: "{{is_state_attr('calendar.calendar_name', 'message', 'vacation') }}"
``` ```
{% endraw %} {% endraw %}

View File

@ -83,6 +83,7 @@ The path part of `filename` must be an entry in the `allowlist_external_dirs` in
For example, the following action in an automation would take a recording from "yourcamera" and save it to /tmp with a timestamped filename. For example, the following action in an automation would take a recording from "yourcamera" and save it to /tmp with a timestamped filename.
{% raw %} {% raw %}
```yaml ```yaml
action: action:
service: camera.record service: camera.record
@ -90,6 +91,7 @@ action:
entity_id: camera.yourcamera entity_id: camera.yourcamera
filename: '/tmp/{{ entity_id.name }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4' filename: '/tmp/{{ entity_id.name }}_{{ now().strftime("%Y%m%d-%H%M%S") }}.mp4'
``` ```
{% endraw %} {% endraw %}
#### Service `snapshot` #### Service `snapshot`
@ -106,6 +108,7 @@ The path part of `filename` must be an entry in the `allowlist_external_dirs` in
For example, the following action in an automation would take a snapshot from "yourcamera" and save it to /tmp with a timestamped filename. For example, the following action in an automation would take a snapshot from "yourcamera" and save it to /tmp with a timestamped filename.
{% raw %} {% raw %}
```yaml ```yaml
action: action:
service: camera.snapshot service: camera.snapshot
@ -113,6 +116,7 @@ action:
entity_id: camera.yourcamera entity_id: camera.yourcamera
filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg' filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
``` ```
{% endraw %} {% endraw %}
#### Service `turn_off` #### Service `turn_off`

View File

@ -322,6 +322,7 @@ For all `*_state_topic`s, a template can be specified that will be used to rende
Say you receive the operation mode `"auto"` via your `mode_state_topic`, but the mode is actually called just `auto`, here's what you could do: Say you receive the operation mode `"auto"` via your `mode_state_topic`, but the mode is actually called just `auto`, here's what you could do:
{% raw %} {% raw %}
```yaml ```yaml
climate: climate:
- platform: mqtt - platform: mqtt
@ -334,11 +335,11 @@ climate:
mode_state_topic: "study/ac/mode/state" mode_state_topic: "study/ac/mode/state"
mode_state_template: "{{ value_json }}" mode_state_template: "{{ value_json }}"
``` ```
{% endraw %} {% endraw %}
This will parse the incoming `"auto"` as JSON, resulting in `auto`. Obviously, in this case you could also just set `value_template: {% raw %}"{{ value_json }}"{% endraw %}`. This will parse the incoming `"auto"` as JSON, resulting in `auto`. Obviously, in this case you could also just set `value_template: {% raw %}"{{ value_json }}"{% endraw %}`.
### Example ### Example
A full configuration example looks like the one below. A full configuration example looks like the one below.

View File

@ -39,7 +39,9 @@ You can use V_TEMP to send the current temperature from the node to Home Assista
For more information, visit the [serial API](https://www.mysensors.org/download) of MySensors. For more information, visit the [serial API](https://www.mysensors.org/download) of MySensors.
## Example sketch for MySensors 2.x ## Example sketch for MySensors 2.x
{% raw %} {% raw %}
```cpp ```cpp
/** /**
* The MySensors Arduino library handles the wireless radio link and protocol * The MySensors Arduino library handles the wireless radio link and protocol
@ -266,6 +268,7 @@ void sendHeatpumpCommand() {
heatpumpIR->send(irSender, POWER_STATE, MODE_STATE, FAN_STATE, TEMP_STATE, VDIR_AUTO, HDIR_AUTO); heatpumpIR->send(irSender, POWER_STATE, MODE_STATE, FAN_STATE, TEMP_STATE, VDIR_AUTO, HDIR_AUTO);
} }
``` ```
{% endraw %} {% endraw %}
## Example sketch for MySensors 1.x ## Example sketch for MySensors 1.x

View File

@ -60,12 +60,14 @@ Sentences can contain slots (marked with curly braces: `{name}`) and optional wo
The following configuration can handle the following sentences: The following configuration can handle the following sentences:
- Change the lights to red - Change the lights to red
- Change the lights to green - Change the lights to green
- Change the lights to blue - Change the lights to blue
- Change the lights to the color red - Change the lights to the color red
- Change the lights to the color green - Change the lights to the color green
- Change the lights to the color blue - Change the lights to the color blue
{% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
@ -73,7 +75,6 @@ conversation:
intents: intents:
ColorLight: ColorLight:
- Change the lights to [the color] {color} - Change the lights to [the color] {color}
{% raw %}
intent_script: intent_script:
ColorLight: ColorLight:
speech: speech:
@ -85,9 +86,10 @@ intent_script:
- "{% if color == 'red' %}255{% else %}0{% endif %}" - "{% if color == 'red' %}255{% else %}0{% endif %}"
- "{% if color == 'green' %}255{% else %}0{% endif %}" - "{% if color == 'green' %}255{% else %}0{% endif %}"
- "{% if color == 'blue' %}255{% else %}0{% endif %}" - "{% if color == 'blue' %}255{% else %}0{% endif %}"
{% endraw %}
``` ```
{% endraw %}
#### Service `conversation.process` #### Service `conversation.process`
| Service data attribute | Optional | Description | | Service data attribute | Optional | Description |

View File

@ -68,6 +68,7 @@ When activated, the [`alexa` integration](/integrations/alexa/) will have Home A
Download [this zip](https://github.com/home-assistant/home-assistant.io/blob/next/source/assets/HomeAssistant_APIAI.zip) and load it in your Dialogflow agent (**Settings** -> **Export and Import**) for examples intents to use with this configuration: Download [this zip](https://github.com/home-assistant/home-assistant.io/blob/next/source/assets/HomeAssistant_APIAI.zip) and load it in your Dialogflow agent (**Settings** -> **Export and Import**) for examples intents to use with this configuration:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
dialogflow: dialogflow:
@ -114,4 +115,5 @@ intent_script:
data: data:
entity_id: "switch.light_{{ Room | striptags | replace(' ', '_') }}" entity_id: "switch.light_{{ Room | striptags | replace(' ', '_') }}"
``` ```
{% endraw %} {% endraw %}

View File

@ -96,6 +96,7 @@ unit_of_measurement:
A full configuration entry could look like the sample below. A full configuration entry could look like the sample below.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -105,6 +106,7 @@ sensor:
value_template: '{{ value_json.VARIABLE }}' value_template: '{{ value_json.VARIABLE }}'
unit_of_measurement: "°C" unit_of_measurement: "°C"
``` ```
{% endraw %} {% endraw %}
### Interacting with Dweet.io ### Interacting with Dweet.io

View File

@ -82,6 +82,7 @@ The remaining lifespan of components on your Deebot vacuum will be reported as a
Here's an example of how to extract the filter's lifespan to its own sensor using a [template sensor](/integrations/template): Here's an example of how to extract the filter's lifespan to its own sensor using a [template sensor](/integrations/template):
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -92,11 +93,13 @@ sensor:
unit_of_measurement: '%' unit_of_measurement: '%'
value_template: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') }}" value_template: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') }}"
``` ```
{% endraw %} {% endraw %}
Or, if you want a simple binary sensor that becomes `On` when the filter needs to be replaced (5% or less): Or, if you want a simple binary sensor that becomes `On` when the filter needs to be replaced (5% or less):
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
binary_sensor: binary_sensor:
@ -107,6 +110,7 @@ binary_sensor:
device_class: problem device_class: problem
value_template: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') <= 5 }}" value_template: "{{ state_attr('vacuum.my_vacuum_id', 'component_filter') <= 5 }}"
``` ```
{% endraw %} {% endraw %}
### Handling Errors ### Handling Errors

View File

@ -46,6 +46,7 @@ name:
Starting with [version 2 of the firmware](https://www.edimax.com/edimax/download/download/data/edimax/global/download/), the Edimax switches can also report the current and accumulated daily power consumption in their state objects. Use a [template sensor](/integrations/template) to extract their values: Starting with [version 2 of the firmware](https://www.edimax.com/edimax/download/download/data/edimax/global/download/), the Edimax switches can also report the current and accumulated daily power consumption in their state objects. Use a [template sensor](/integrations/template) to extract their values:
{% raw %} {% raw %}
```yaml ```yaml
- platform: template - platform: template
sensors: sensors:
@ -59,6 +60,7 @@ Starting with [version 2 of the firmware](https://www.edimax.com/edimax/download
unit_of_measurement: 'kWh' unit_of_measurement: 'kWh'
value_template: "{{ state_attr('switch.edimax_smart_plug', 'today_energy_kwh') | replace('None', 0) }}" value_template: "{{ state_attr('switch.edimax_smart_plug', 'today_energy_kwh') | replace('None', 0) }}"
``` ```
{% endraw %} {% endraw %}
Note that if the smart plug is off, these states report the string `None`. By using a `replace()` in the template, these sensors report purely numerical values. Note that if the smart plug is off, these states report the string `None`. By using a `replace()` in the template, these sensors report purely numerical values.

View File

@ -60,6 +60,7 @@ entities:
A full configuration sample looks like the one below. A full configuration sample looks like the one below.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
emulated_kasa: emulated_kasa:
@ -90,4 +91,5 @@ emulated_kasa:
name: UPS Power name: UPS Power
power: "{{ float(states('sensor.ups_kw')) * 1000 }}" power: "{{ float(states('sensor.ups_kw')) * 1000 }}"
``` ```
{% endraw %} {% endraw %}

View File

@ -157,6 +157,7 @@ scan_interval:
If you would like to have alerts announced via a text-to-speech service, you can use a script similar to the following: If you would like to have alerts announced via a text-to-speech service, you can use a script similar to the following:
{% raw %} {% raw %}
```yaml ```yaml
weather_alert_tts: weather_alert_tts:
sequence: sequence:
@ -164,6 +165,7 @@ weather_alert_tts:
data: data:
message: "{{ states('sensor.warnings') }} in effect." message: "{{ states('sensor.warnings') }} in effect."
``` ```
{% endraw %} {% endraw %}
## Camera ## Camera

View File

@ -96,6 +96,7 @@ source:
Use the `image_processing.detect_face` events to trigger automations, and breakout the `trigger.event.data` using a [template](/docs/automation/templating/). The following example automation sends a notification when Ringo Star is recognized: Use the `image_processing.detect_face` events to trigger automations, and breakout the `trigger.event.data` using a [template](/docs/automation/templating/). The following example automation sends a notification when Ringo Star is recognized:
{% raw %} {% raw %}
```yaml ```yaml
- id: '12345' - id: '12345'
alias: Ringo Starr recognised alias: Ringo Starr recognised
@ -110,6 +111,7 @@ Use the `image_processing.detect_face` events to trigger automations, and breako
message: Ringo_Starr recognised with probability {{ trigger.event.data.confidence }} message: Ringo_Starr recognised with probability {{ trigger.event.data.confidence }}
title: Door-cam notification title: Door-cam notification
``` ```
{% endraw %} {% endraw %}
## Service `facebox.teach_face` ## Service `facebox.teach_face`
@ -125,6 +127,7 @@ The service `facebox.teach_face` can be used to teach Facebox faces.
A valid service data example: A valid service data example:
{% raw %} {% raw %}
```yaml ```yaml
{ {
"entity_id": "image_processing.facebox_local_file", "entity_id": "image_processing.facebox_local_file",
@ -132,11 +135,13 @@ A valid service data example:
"file_path": "/images/superman_1.jpeg" "file_path": "/images/superman_1.jpeg"
} }
``` ```
{% endraw %} {% endraw %}
You can use an automation to receive a notification when you train a face: You can use an automation to receive a notification when you train a face:
{% raw %} {% raw %}
```yaml ```yaml
- id: '1533703568569' - id: '1533703568569'
alias: Face taught alias: Face taught
@ -153,6 +158,7 @@ You can use an automation to receive a notification when you train a face:
with file {{ trigger.event.data.service_data.file_path }}' with file {{ trigger.event.data.service_data.file_path }}'
title: Face taught notification title: Face taught notification
``` ```
{% endraw %} {% endraw %}
Any errors on teaching will be reported in the logs. If you enable [system_log](/integrations/system_log/) events: Any errors on teaching will be reported in the logs. If you enable [system_log](/integrations/system_log/) events:
@ -165,6 +171,7 @@ system_log:
you can create an automation to receive notifications on Facebox errors: you can create an automation to receive notifications on Facebox errors:
{% raw %} {% raw %}
```yaml ```yaml
- id: '1533703568577' - id: '1533703568577'
alias: Facebox error alias: Facebox error
@ -180,4 +187,5 @@ you can create an automation to receive notifications on Facebox errors:
message: '{{ trigger.event.data.message }}' message: '{{ trigger.event.data.message }}'
title: Facebox error title: Facebox error
``` ```
{% endraw %} {% endraw %}

View File

@ -16,7 +16,6 @@ To find out the configuration for your bank, check their website or call their h
For each account you have with the bank, a separate sensor is created. If you have several accounts with a bank, you can select which ones you want to have, and you can also give the accounts a name. For each account you have with the bank, a separate sensor is created. If you have several accounts with a bank, you can select which ones you want to have, and you can also give the accounts a name.
{% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -26,7 +25,6 @@ sensor:
pin: YOUR_PIN pin: YOUR_PIN
url: URL_FOR_YOUR_BANK url: URL_FOR_YOUR_BANK
``` ```
{% endraw %}
{% configuration %} {% configuration %}
name: name:

View File

@ -22,12 +22,10 @@ Configured folders must be added to [allowlist_external_dirs](/docs/configuratio
To enable the Folder Watcher integration in your installation, add the following to your `configuration.yaml` file: To enable the Folder Watcher integration in your installation, add the following to your `configuration.yaml` file:
{% raw %}
```yaml ```yaml
folder_watcher: folder_watcher:
- folder: /config - folder: /config
``` ```
{% endraw %}
{% configuration %} {% configuration %}
folder: folder:
@ -45,7 +43,6 @@ patterns:
Pattern matching using [fnmatch](https://docs.python.org/3.6/library/fnmatch.html) can be used to limit filesystem monitoring to only files which match the configured patterns. The following example shows the configuration required to only monitor filetypes `.yaml` and `.txt`. Pattern matching using [fnmatch](https://docs.python.org/3.6/library/fnmatch.html) can be used to limit filesystem monitoring to only files which match the configured patterns. The following example shows the configuration required to only monitor filetypes `.yaml` and `.txt`.
{% raw %}
```yaml ```yaml
folder_watcher: folder_watcher:
- folder: /config - folder: /config
@ -53,13 +50,13 @@ folder_watcher:
- '*.yaml' - '*.yaml'
- '*.txt' - '*.txt'
``` ```
{% endraw %}
## Automations ## Automations
Automations can be triggered on filesystem event data using a template. The following automation will send a notification with the name and folder of new files added to that folder: Automations can be triggered on filesystem event data using a template. The following automation will send a notification with the name and folder of new files added to that folder:
{% raw %} {% raw %}
```yaml ```yaml
#Send notification for new image (including the image itself) #Send notification for new image (including the image itself)
automation: automation:
@ -77,4 +74,5 @@ automation:
    data:     data:
      file: "{{ trigger.event.data.path }}"       file: "{{ trigger.event.data.path }}"
``` ```
{% endraw %} {% endraw %}

View File

@ -86,6 +86,7 @@ sensor:
This example shows how to send notifications whenever the sensor's state changes. You will get notified both when you receive a call and also when a call is placed. This example shows how to send notifications whenever the sensor's state changes. You will get notified both when you receive a call and also when a call is placed.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry. # Example configuration.yaml entry.
automation: automation:
@ -108,4 +109,5 @@ automation:
Talking to {{ state_attr('sensor.phone', 'with_name') }} ({{ state_attr('sensor.phone', 'with') }}) Talking to {{ state_attr('sensor.phone', 'with_name') }} ({{ state_attr('sensor.phone', 'with') }})
{% endif %} {% endif %}
``` ```
{% endraw %} {% endraw %}

View File

@ -68,6 +68,7 @@ covers:
</p> </p>
{% raw %} {% raw %}
```yaml ```yaml
# Related configuration.yaml entry # Related configuration.yaml entry
cover: cover:
@ -107,6 +108,7 @@ customize:
sensor.garage_door_wifi_signal_strength: sensor.garage_door_wifi_signal_strength:
icon: mdi:wifi icon: mdi:wifi
``` ```
{% endraw %} {% endraw %}
Some of the Garadget sensors can create a lot of clutter in the logbook. Use this section of code in your `configuration.yaml` to exclude those entries. Some of the Garadget sensors can create a lot of clutter in the logbook. Use this section of code in your `configuration.yaml` to exclude those entries.

View File

@ -77,6 +77,7 @@ There are three `Sensor` entities that will indicate the number of **Errors**, *
Each such entity has a state attribute that will contain a list of any such issues which can be used in automations, etc. For example: Each such entity has a state attribute that will contain a list of any such issues which can be used in automations, etc. For example:
{% raw %} {% raw %}
```yaml ```yaml
- alias: GeniusHub Error Alerts - alias: GeniusHub Error Alerts
trigger: trigger:
@ -91,11 +92,13 @@ Each such entity has a state attribute that will contain a list of any such issu
Genius Hub has the following {{ states('sensor.geniushub_errors') }} errors: Genius Hub has the following {{ states('sensor.geniushub_errors') }} errors:
{{ state_attr('sensor.geniushub_errors', 'error_list') }} {{ state_attr('sensor.geniushub_errors', 'error_list') }}
``` ```
{% endraw %} {% endraw %}
This alert may be useful to see if the CH is being turned on whilst you're on a holiday! This alert may be useful to see if the CH is being turned on whilst you're on a holiday!
{% raw %} {% raw %}
```yaml ```yaml
- alias: GeniusHub CH State Change Alert - alias: GeniusHub CH State Change Alert
trigger: trigger:
@ -109,6 +112,7 @@ This alert may be useful to see if the CH is being turned on whilst you're on a
{{ trigger.to_state.attributes.friendly_name }} has changed {{ trigger.to_state.attributes.friendly_name }} has changed
from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}. from {{ trigger.from_state.state }} to {{ trigger.to_state.state }}.
``` ```
{% endraw %} {% endraw %}
## State Attributes ## State Attributes
@ -146,17 +150,21 @@ Many zone/device properties are available via the corresponding entity's state a
This data can be accessed in automations, etc. via a value template. For example: This data can be accessed in automations, etc. via a value template. For example:
{% raw %} {% raw %}
```yaml ```yaml
value_template: "{{ state_attr('water_heater.genius_zone_2', 'status').override.setpoint }}" value_template: "{{ state_attr('water_heater.genius_zone_2', 'status').override.setpoint }}"
``` ```
{% endraw %} {% endraw %}
In the specific case of **Radiator** zones with room sensors: In the specific case of **Radiator** zones with room sensors:
{% raw %} {% raw %}
```yaml ```yaml
value_template: "{{ state_attr('climate.genius_zone_12', 'status').occupied }}" value_template: "{{ state_attr('climate.genius_zone_12', 'status').occupied }}"
``` ```
{% endraw %} {% endraw %}
## Configuration ## Configuration

View File

@ -34,6 +34,7 @@ Conditions can be used to further filter entities, for example by inspecting the
The following example automation creates a notification on the screen when a fire classified as 'Bush Fire' is reported within a predefined bush fire alert zone: The following example automation creates a notification on the screen when a fire classified as 'Bush Fire' is reported within a predefined bush fire alert zone:
{% raw %} {% raw %}
```yaml ```yaml
geo_location: geo_location:
- platform: nsw_rural_fire_service_feed - platform: nsw_rural_fire_service_feed
@ -65,4 +66,5 @@ automation:
message: "{{ trigger.to_state.name }} - {{ trigger.to_state.attributes.status }}" message: "{{ trigger.to_state.name }} - {{ trigger.to_state.attributes.status }}"
title: "Bush Fire Alert" title: "Bush Fire Alert"
``` ```
{% endraw %} {% endraw %}

View File

@ -87,8 +87,6 @@ filter:
By default, no entity will be excluded. To limit which entities are being exposed to `Google Pub/Sub`, you can use the `filter` parameter. By default, no entity will be excluded. To limit which entities are being exposed to `Google Pub/Sub`, you can use the `filter` parameter.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
google_pubsub: google_pubsub:
@ -105,8 +103,6 @@ google_pubsub:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -203,6 +203,7 @@ Force synchronization between the Harmony device and the Harmony cloud.
Template sensors can be utilized to display current activity in the frontend. Template sensors can be utilized to display current activity in the frontend.
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: template - platform: template
@ -214,11 +215,13 @@ sensor:
value_template: '{{ state_attr("remote.bedroom", "current_activity") }}' value_template: '{{ state_attr("remote.bedroom", "current_activity") }}'
friendly_name: 'bedroom' friendly_name: 'bedroom'
``` ```
{% endraw %} {% endraw %}
The example below shows how to control an `input_boolean` switch using the Harmony remote's current activity. The switch will turn on when the remote's state changes and the Kodi activity is started and off when the remote's state changes and the current activity is "PowerOff". The example below shows how to control an `input_boolean` switch using the Harmony remote's current activity. The switch will turn on when the remote's state changes and the Kodi activity is started and off when the remote's state changes and the current activity is "PowerOff".
{% raw %} {% raw %}
```yaml ```yaml
automation: automation:
- alias: "Watch TV started from harmony hub" - alias: "Watch TV started from harmony hub"
@ -242,4 +245,5 @@ automation:
service: input_boolean.turn_off service: input_boolean.turn_off
entity_id: input_boolean.notify entity_id: input_boolean.notify
``` ```
{% endraw %} {% endraw %}

View File

@ -25,6 +25,7 @@ Examples of what you can track:
To enable the history statistics sensor, add the following lines to your `configuration.yaml`: To enable the history statistics sensor, add the following lines to your `configuration.yaml`:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -36,6 +37,7 @@ sensor:
start: '{{ now().replace(hour=0, minute=0, second=0) }}' start: '{{ now().replace(hour=0, minute=0, second=0) }}'
end: '{{ now() }}' end: '{{ now() }}'
``` ```
{% endraw %} {% endraw %}
{% configuration %} {% configuration %}
@ -131,30 +133,36 @@ Here are some examples of periods you could work with, and what to write in your
**Today**: starts at 00:00 of the current day and ends right now. **Today**: starts at 00:00 of the current day and ends right now.
{% raw %} {% raw %}
```yaml ```yaml
start: '{{ now().replace(hour=0, minute=0, second=0) }}' start: '{{ now().replace(hour=0, minute=0, second=0) }}'
end: '{{ now() }}' end: '{{ now() }}'
``` ```
{% endraw %} {% endraw %}
**Yesterday**: ends today at 00:00, lasts 24 hours. **Yesterday**: ends today at 00:00, lasts 24 hours.
{% raw %} {% raw %}
```yaml ```yaml
end: '{{ now().replace(hour=0, minute=0, second=0) }}' end: '{{ now().replace(hour=0, minute=0, second=0) }}'
duration: duration:
hours: 24 hours: 24
``` ```
{% endraw %} {% endraw %}
**This morning (6AM - 11AM)**: starts today at 6, lasts 5 hours. **This morning (6AM - 11AM)**: starts today at 6, lasts 5 hours.
{% raw %} {% raw %}
```yaml ```yaml
start: '{{ now().replace(hour=6, minute=0, second=0) }}' start: '{{ now().replace(hour=6, minute=0, second=0) }}'
duration: duration:
hours: 5 hours: 5
``` ```
{% endraw %} {% endraw %}
**Current week**: starts last Monday at 00:00, ends right now. **Current week**: starts last Monday at 00:00, ends right now.
@ -162,29 +170,35 @@ Here are some examples of periods you could work with, and what to write in your
Here, last Monday is _today_ as a timestamp, minus 86400 times the current weekday (86400 is the number of seconds in one day, the weekday is 0 on Monday, 6 on Sunday). Here, last Monday is _today_ as a timestamp, minus 86400 times the current weekday (86400 is the number of seconds in one day, the weekday is 0 on Monday, 6 on Sunday).
{% raw %} {% raw %}
```yaml ```yaml
start: '{{ as_timestamp( now().replace(hour=0, minute=0, second=0) ) - now().weekday() * 86400 }}' start: '{{ as_timestamp( now().replace(hour=0, minute=0, second=0) ) - now().weekday() * 86400 }}'
end: '{{ now() }}' end: '{{ now() }}'
``` ```
{% endraw %} {% endraw %}
**Last 30 days**: ends today at 00:00, lasts 30 days. Easy one. **Last 30 days**: ends today at 00:00, lasts 30 days. Easy one.
{% raw %} {% raw %}
```yaml ```yaml
end: '{{ now().replace(hour=0, minute=0, second=0) }}' end: '{{ now().replace(hour=0, minute=0, second=0) }}'
duration: duration:
days: 30 days: 30
``` ```
{% endraw %} {% endraw %}
**All your history** starts at timestamp = 0, and ends right now. **All your history** starts at timestamp = 0, and ends right now.
{% raw %} {% raw %}
```yaml ```yaml
start: '{{ 0 }}' start: '{{ 0 }}'
end: '{{ now() }}' end: '{{ now() }}'
``` ```
{% endraw %} {% endraw %}
<div class='note'> <div class='note'>

View File

@ -328,8 +328,6 @@ Please remember that you can only have a single `automation` entry. Add the auto
</div> </div>
{% raw %}
```yaml ```yaml
# Example for Z-Wave # Example for Z-Wave
homekit: homekit:
@ -348,12 +346,8 @@ automation:
- service: homekit.start - service: homekit.start
``` ```
{% endraw %}
For a general delay where your integration doesn't generate an event, you can also do: For a general delay where your integration doesn't generate an event, you can also do:
{% raw %}
```yaml ```yaml
# Example using a delay after the start of Home Assistant # Example using a delay after the start of Home Assistant
homekit: homekit:
@ -369,8 +363,6 @@ automation:
- service: homekit.start - service: homekit.start
``` ```
{% endraw %}
In some cases it might be desirable to check that all entities are available before starting `HomeKit`. This can be accomplished by adding an additional `binary_sensor` as follows: In some cases it might be desirable to check that all entities are available before starting `HomeKit`. This can be accomplished by adding an additional `binary_sensor` as follows:
{% raw %} {% raw %}
@ -406,8 +398,6 @@ automation:
By default, no entity will be excluded. To limit which entities are being exposed to `HomeKit`, you can use the `filter` parameter. Keep in mind only [supported components](#supported-components) can be added. By default, no entity will be excluded. To limit which entities are being exposed to `HomeKit`, you can use the `filter` parameter. Keep in mind only [supported components](#supported-components) can be added.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
homekit: homekit:
@ -421,8 +411,6 @@ homekit:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -428,28 +428,30 @@ When the connection to your Homematic CCU or Homegear is lost, Home Assistant wi
- If you have a sensor which you know will be updated frequently (e.g., an outdoor temperature sensor, voltage sensor or light sensor) you could set up a helper binary sensor and an automation like this: - If you have a sensor which you know will be updated frequently (e.g., an outdoor temperature sensor, voltage sensor or light sensor) you could set up a helper binary sensor and an automation like this:
{% raw %} {% raw %}
```yaml
binary_sensor:
- platform: template
sensors:
homematic_up:
friendly_name: "Homematic is sending updates"
entity_id:
- sensor.office_voltage
- sensor.time
value_template: >-
{{as_timestamp(now()) - as_timestamp(states.sensor.office_voltage.last_changed) < 600}}
automation: ```yaml
- alias: Homematic Reconnect binary_sensor:
trigger: - platform: template
platform: state sensors:
entity_id: binary_sensor.homematic_up homematic_up:
to: "off" friendly_name: "Homematic is sending updates"
action: entity_id:
# Reconnect, if sensor has not been updated for over 3 hours - sensor.office_voltage
service: homematic.reconnect - sensor.time
``` value_template: >-
{{as_timestamp(now()) - as_timestamp(states.sensor.office_voltage.last_changed) < 600}}
automation:
- alias: Homematic Reconnect
trigger:
platform: state
entity_id: binary_sensor.homematic_up
to: "off"
action:
# Reconnect, if sensor has not been updated for over 3 hours
service: homematic.reconnect
```
{% endraw %} {% endraw %}
The important part is the `sensor.time` entity (from time_date component). This will update the binary sensor on every change of the sensor and every minute. If the Homematic sensor does not send any updates anymore, the `sensor.time` will set the binary sensor to `off` 10 minutes after the last sensor update. This will trigger the automation. The important part is the `sensor.time` entity (from time_date component). This will update the binary sensor on every change of the sensor and every minute. If the Homematic sensor does not send any updates anymore, the `sensor.time` will set the binary sensor to `off` 10 minutes after the last sensor update. This will trigger the automation.
@ -553,6 +555,7 @@ Only the `data` part of the event payload is processed. This part can specify or
It is possible to provide a template in order to compute the value: It is possible to provide a template in order to compute the value:
{% raw %} {% raw %}
```json ```json
{ {
"data": { "data": {
@ -560,11 +563,13 @@ It is possible to provide a template in order to compute the value:
} }
} }
``` ```
{% endraw %} {% endraw %}
You can also specify the event payload using a group notification (instead of specifying the value for the notify itself): You can also specify the event payload using a group notification (instead of specifying the value for the notify itself):
{% raw %} {% raw %}
```yaml ```yaml
notify: notify:
- name: my_hm - name: my_hm
@ -587,6 +592,7 @@ alert:
notifiers: notifiers:
- group_hm - group_hm
``` ```
{% endraw %} {% endraw %}
Please note that the first `data` element belongs to the service `my_hm`, while the second one belongs to the event payload. Please note that the first `data` element belongs to the service `my_hm`, while the second one belongs to the event payload.

View File

@ -167,6 +167,7 @@ data:
Example of adding a tag to your notification. This won't create new notification if there already exists one with the same tag. Example of adding a tag to your notification. This won't create new notification if there already exists one with the same tag.
{% raw %} {% raw %}
```yaml ```yaml
- alias: Push/update notification of sensor state with tag - alias: Push/update notification of sensor state with tag
trigger: trigger:
@ -180,6 +181,7 @@ Example of adding a tag to your notification. This won't create new notification
data: data:
tag: 'notification-about-sensor' tag: 'notification-about-sensor'
``` ```
{% endraw %} {% endraw %}
#### Targets #### Targets

View File

@ -32,6 +32,7 @@ For example, set the body of the IFTTT webhook to:
You then need to consume that incoming information with the following automation: You then need to consume that incoming information with the following automation:
{% raw %} {% raw %}
```yaml ```yaml
automation: automation:
- id: this_is_the_automation_id - id: this_is_the_automation_id
@ -47,6 +48,7 @@ automation:
entity_id: '{{ trigger.event.data.entity_id }}' entity_id: '{{ trigger.event.data.entity_id }}'
service: '{{ trigger.event.data.service }}' service: '{{ trigger.event.data.service }}'
``` ```
{% endraw %} {% endraw %}
## Sending events to IFTTT ## Sending events to IFTTT
@ -59,7 +61,6 @@ ifttt:
`key` is your API key which can be obtained by viewing the **Settings** of the [Webhooks applet](https://ifttt.com/services/maker_webhooks/settings). It's the last part of the URL (e.g., https://maker.ifttt.com/use/MYAPIKEY) you will find under **My Applets** > **Webhooks** > **Settings**. `key` is your API key which can be obtained by viewing the **Settings** of the [Webhooks applet](https://ifttt.com/services/maker_webhooks/settings). It's the last part of the URL (e.g., https://maker.ifttt.com/use/MYAPIKEY) you will find under **My Applets** > **Webhooks** > **Settings**.
<p class='img'> <p class='img'>
<img src='/images/integrations/ifttt/finding_key.png' /> <img src='/images/integrations/ifttt/finding_key.png' />
Property screen of the Maker Channel Property screen of the Maker Channel
@ -83,7 +84,6 @@ ifttt:
YOUR_KEY_NAME2: YOUR_API_KEY2 YOUR_KEY_NAME2: YOUR_API_KEY2
``` ```
### Testing your trigger ### Testing your trigger
You can use **Developer Tools** to test your [Webhooks](https://ifttt.com/maker_webhooks) trigger. To do this, open the Home Assistant sidebar, click on Developer Tools, and then the **Services** tab. Fill in the following values: You can use **Developer Tools** to test your [Webhooks](https://ifttt.com/maker_webhooks) trigger. To do this, open the Home Assistant sidebar, click on Developer Tools, and then the **Services** tab. Fill in the following values:
@ -125,6 +125,7 @@ You need to setup a unique trigger for each event you sent to IFTTT.
</p> </p>
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml Automation entry # Example configuration.yaml Automation entry
automation: automation:
@ -136,11 +137,13 @@ automation:
service: ifttt.trigger service: ifttt.trigger
data: {"event":"TestHA_Trigger", "value1":"Hello World!"} data: {"event":"TestHA_Trigger", "value1":"Hello World!"}
``` ```
{% endraw %} {% endraw %}
IFTTT can also be used in scripts and with templates. Here is the above automation broken into an automation and script using variables and templates. IFTTT can also be used in scripts and with templates. Here is the above automation broken into an automation and script using variables and templates.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml Automation entry # Example configuration.yaml Automation entry
automation: automation:
@ -155,9 +158,11 @@ automation:
value2: "{{ trigger.event.data.entity_id.split('_')[1] }} is " value2: "{{ trigger.event.data.entity_id.split('_')[1] }} is "
value3: "{{ trigger.event.data.to_state.state }}" value3: "{{ trigger.event.data.to_state.state }}"
``` ```
{% endraw %} {% endraw %}
{% raw %} {% raw %}
```yaml ```yaml
#Example Script to send TestHA_Trigger to IFTTT but with some other data (homeassistant UP). #Example Script to send TestHA_Trigger to IFTTT but with some other data (homeassistant UP).
ifttt_notify: ifttt_notify:
@ -165,4 +170,5 @@ ifttt_notify:
- service: ifttt.trigger - service: ifttt.trigger
data: {"event":"TestHA_Trigger", "value1":"{{ value1 }}", "value2":"{{ value2 }}", "value3":"{{ value3 }}"} data: {"event":"TestHA_Trigger", "value1":"{{ value1 }}", "value2":"{{ value2 }}", "value3":"{{ value3 }}"}
``` ```
{% endraw %} {% endraw %}

View File

@ -78,6 +78,7 @@ value_template:
The following example shows the usage of the IMAP email content sensor to scan the subject of an email for text, in this case, an email from the APC SmartConnect service which tells whether the UPS is running on battery or not. The following example shows the usage of the IMAP email content sensor to scan the subject of an email for text, in this case, an email from the APC SmartConnect service which tells whether the UPS is running on battery or not.
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: imap_email_content - platform: imap_email_content
@ -95,6 +96,7 @@ sensor:
power_on power_on
{% endif %} {% endif %}
``` ```
{% endraw %} {% endraw %}
The same template structure can scan the date, body or sender for matching text before setting the state of the sensor. The same template structure can scan the date, body or sender for matching text before setting the state of the sensor.
@ -115,6 +117,7 @@ To view your account for details about your energy use, please click here.
Below is the template sensor which extracts the information from the body of the email in our IMAP email sensor (named sensor.energy_email) into 3 sensors for the energy use, daily cost, and billing cycle total. Below is the template sensor which extracts the information from the body of the email in our IMAP email sensor (named sensor.energy_email) into 3 sensors for the energy use, daily cost, and billing cycle total.
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: template - platform: template
@ -138,6 +141,7 @@ sensor:
{{ state_attr('sensor.energy_email', 'body') {{ state_attr('sensor.energy_email', 'body')
|regex_findall_index("\ days:\* \$([0-9.]+)") }} |regex_findall_index("\ days:\* \$([0-9.]+)") }}
``` ```
{% endraw %} {% endraw %}
By making small changes to the regular expressions defined above, a similar structure can parse other types of data out of the body of other emails. By making small changes to the regular expressions defined above, a similar structure can parse other types of data out of the body of other emails.

View File

@ -34,6 +34,7 @@ Any room thermostats (there can be 0, 1 or 2) are represented as **Climate** dev
To send an alert if the CV pressure is too low or too high, consider the following example: To send an alert if the CV pressure is too low or too high, consider the following example:
{% raw %} {% raw %}
```yaml ```yaml
- alias: Low CV Pressure Alert - alias: Low CV Pressure Alert
trigger: trigger:
@ -48,6 +49,7 @@ To send an alert if the CV pressure is too low or too high, consider the followi
{{ trigger.to_state.attributes.friendly_name }} {{ trigger.to_state.attributes.friendly_name }}
is low, {{ trigger.to_state.state }} bar. is low, {{ trigger.to_state.state }} bar.
``` ```
{% endraw %} {% endraw %}
Other properties are available via each device's attributes. Other properties are available via each device's attributes.

View File

@ -208,8 +208,6 @@ component_config_glob:
By default, no entity will be excluded. To limit which entities are being exposed to `InfluxDB`, you can use the `include` and `exclude` parameters. By default, no entity will be excluded. To limit which entities are being exposed to `InfluxDB`, you can use the `include` and `exclude` parameters.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
influxdb: influxdb:
@ -224,8 +222,6 @@ influxdb:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -112,7 +112,6 @@ To set both the date and time in the same call, use `date` and `time` together,
The following example shows the usage of the `input_datetime` as a trigger in an The following example shows the usage of the `input_datetime` as a trigger in an
automation: automation:
{% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
# Turns on bedroom light at the time specified. # Turns on bedroom light at the time specified.
@ -124,13 +123,13 @@ automation:
service: light.turn_on service: light.turn_on
entity_id: light.bedroom entity_id: light.bedroom
``` ```
{% endraw %}
To dynamically set the `input_datetime` you can call To dynamically set the `input_datetime` you can call
`input_datetime.set_datetime`. The values for `date`, `time` and/or `datetime` must be in a certain format for the call to be successful. (See service description above.) `input_datetime.set_datetime`. The values for `date`, `time` and/or `datetime` must be in a certain format for the call to be successful. (See service description above.)
If you have a `datetime` object you can use its `timestamp` method. Of if you have a timestamp you can just use it directly. If you have a `datetime` object you can use its `timestamp` method. Of if you have a timestamp you can just use it directly.
{% raw %} {% raw %}
```yaml ```yaml
# Sets time to 05:30:00 # Sets time to 05:30:00
- service: input_datetime.set_datetime - service: input_datetime.set_datetime
@ -170,4 +169,5 @@ If you have a `datetime` object you can use its `timestamp` method. Of if you ha
entity_id: input_datetime.XXX entity_id: input_datetime.XXX
timestamp: "{{ now().timestamp() }}" timestamp: "{{ now().timestamp() }}"
``` ```
{% endraw %} {% endraw %}

View File

@ -114,6 +114,7 @@ scene:
Here's an example of `input_number` being used as a trigger in an automation. Here's an example of `input_number` being used as a trigger in an automation.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry using 'input_number' as a trigger in an automation # Example configuration.yaml entry using 'input_number' as a trigger in an automation
input_number: input_number:
@ -134,11 +135,13 @@ automation:
entity_id: light.bedroom entity_id: light.bedroom
brightness: "{{ trigger.to_state.state | int }}" brightness: "{{ trigger.to_state.state | int }}"
``` ```
{% endraw %} {% endraw %}
Another code example using `input_number`, this time being used in an action in an automation. Another code example using `input_number`, this time being used in an action in an automation.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry using 'input_number' in an action in an automation # Example configuration.yaml entry using 'input_number' in an action in an automation
input_select: input_select:
@ -171,11 +174,13 @@ automation:
entity_id: light.bedroom entity_id: light.bedroom
brightness: "{{ states('input_number.bedroom_brightness') | int }}" brightness: "{{ states('input_number.bedroom_brightness') | int }}"
``` ```
{% endraw %} {% endraw %}
Example of `input_number` being used in a bidirectional manner, both being set by and controlled by an MQTT action in an automation. Example of `input_number` being used in a bidirectional manner, both being set by and controlled by an MQTT action in an automation.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry using 'input_number' in an action in an automation # Example configuration.yaml entry using 'input_number' in an action in an automation
input_number: input_number:
@ -213,11 +218,13 @@ automation:
retain: true retain: true
payload: "{{ states('input_number.target_temp') | int }}" payload: "{{ states('input_number.target_temp') | int }}"
``` ```
{% endraw %} {% endraw %}
Here's an example of `input_number` being used as a delay in an automation. Here's an example of `input_number` being used as a delay in an automation.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry using 'input_number' as a delay in an automation # Example configuration.yaml entry using 'input_number' as a delay in an automation
input_number: input_number:
@ -248,4 +255,5 @@ automation:
- service: switch.turn_off - service: switch.turn_off
entity_id: switch.something entity_id: switch.something
``` ```
{% endraw %} {% endraw %}

View File

@ -149,6 +149,7 @@ automation:
Example of `input_select` being used in a bidirectional manner, both being set by and controlled by an MQTT action in an automation. Example of `input_select` being used in a bidirectional manner, both being set by and controlled by an MQTT action in an automation.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry using 'input_select' in an action in an automation # Example configuration.yaml entry using 'input_select' in an action in an automation
@ -190,4 +191,5 @@ input_select:
retain: true retain: true
payload: "{{ states('input_select.thermostat_mode') }}" payload: "{{ states('input_select.thermostat_mode') }}"
``` ```
{% endraw %} {% endraw %}

View File

@ -108,6 +108,7 @@ scene:
Here's an example using `input_text` in an action in an automation. Here's an example using `input_text` in an action in an automation.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry using 'input_text' in an action in an automation # Example configuration.yaml entry using 'input_text' in an action in an automation
input_select: input_select:
@ -136,4 +137,5 @@ automation:
entity_id: input_text.bedroom entity_id: input_text.bedroom
value: "{{ states('input_select.scene_bedroom') }}" value: "{{ states('input_select.scene_bedroom') }}"
``` ```
{% endraw %} {% endraw %}

View File

@ -53,6 +53,7 @@ The [generic camera platform](/integrations/mjpeg) offers
the possibility to show the location of the ISS on OpenStreetMap. the possibility to show the location of the ISS on OpenStreetMap.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
- platform: iss - platform: iss
@ -64,4 +65,5 @@ camera:
still_image_url: http://staticmap.openstreetmap.de/staticmap.php?center={{ state_attr('binary_sensor.iss', 'lat') }},{{ state_attr('binary_sensor.iss', 'long') }}&zoom=4&size=865x512&maptype=mapnik&markers={{ state_attr('binary_sensor.iss', 'lat') }},{{ state_attr('binary_sensor.iss', 'long') }},lightblue still_image_url: http://staticmap.openstreetmap.de/staticmap.php?center={{ state_attr('binary_sensor.iss', 'lat') }},{{ state_attr('binary_sensor.iss', 'long') }}&zoom=4&size=865x512&maptype=mapnik&markers={{ state_attr('binary_sensor.iss', 'lat') }},{{ state_attr('binary_sensor.iss', 'long') }},lightblue
limit_refetch_to_url_change: true limit_refetch_to_url_change: true
``` ```
{% endraw %} {% endraw %}

View File

@ -223,6 +223,7 @@ This example and the following requires to have the [script.json-cec](https://gi
#### Simple script to turn on the PVR in some channel as a time function #### Simple script to turn on the PVR in some channel as a time function
{% raw %} {% raw %}
```yaml ```yaml
script: script:
play_kodi_pvr: play_kodi_pvr:
@ -252,11 +253,13 @@ script:
10 10
{% endif %} {% endif %}
``` ```
{% endraw %} {% endraw %}
#### Simple script to play a smart playlist #### Simple script to play a smart playlist
{% raw %} {% raw %}
```yaml ```yaml
script: script:
play_kodi_smp: play_kodi_smp:
@ -272,6 +275,7 @@ script:
media_content_type: DIRECTORY media_content_type: DIRECTORY
media_content_id: special://profile/playlists/video/feuerwehrmann_sam.xsp media_content_id: special://profile/playlists/video/feuerwehrmann_sam.xsp
``` ```
{% endraw %} {% endraw %}
#### Trigger a Kodi video library update #### Trigger a Kodi video library update

View File

@ -98,7 +98,6 @@ sensor:
To setup a LaCrosse sensor with multiple sensors, add the following to your `configuration.yaml` file: To setup a LaCrosse sensor with multiple sensors, add the following to your `configuration.yaml` file:
{% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -119,4 +118,3 @@ sensor:
type: battery type: battery
id: 72 id: 72
``` ```
{% endraw %}

View File

@ -163,8 +163,6 @@ Therefore, an optional filtering mechanism has been implemented to prevent incon
### Typical configuration ### Typical configuration
{% raw %}
```yaml ```yaml
life360: life360:
# MPH, assuming imperial units. # MPH, assuming imperial units.
@ -184,12 +182,8 @@ life360:
error_threshold: 3 error_threshold: 3
``` ```
{% endraw %}
### Circle and Member Filtering Example ### Circle and Member Filtering Example
{% raw %}
```yaml ```yaml
life360: life360:
# Only track Members that are in these Circles. # Only track Members that are in these Circles.
@ -200,12 +194,8 @@ life360:
exclude: John Doe exclude: John Doe
``` ```
{% endraw %}
### Entering accounts in configuration ### Entering accounts in configuration
{% raw %}
```yaml ```yaml
life360: life360:
accounts: accounts:
@ -213,8 +203,6 @@ life360:
password: LIFE360_PASSWORD password: LIFE360_PASSWORD
``` ```
{% endraw %}
### Example overdue update automations ### Example overdue update automations
{% raw %} {% raw %}

View File

@ -315,6 +315,7 @@ In this section you will find some real-life examples of how to use this sensor.
To enable a light with brightness and RGB support in your installation, add the following to your `configuration.yaml` file: To enable a light with brightness and RGB support in your installation, add the following to your `configuration.yaml` file:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
light: light:
@ -334,6 +335,7 @@ light:
payload_off: "OFF" payload_off: "OFF"
optimistic: false optimistic: false
``` ```
{% endraw %} {% endraw %}
### Brightness and no RGB support ### Brightness and no RGB support

View File

@ -66,8 +66,6 @@ include:
By default, no entity will be excluded. To limit which entities are being exposed to `Logbook`, you can use the `include` and `exclude` parameters. By default, no entity will be excluded. To limit which entities are being exposed to `Logbook`, you can use the `include` and `exclude` parameters.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
logbook: logbook:
@ -82,8 +80,6 @@ logbook:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -209,6 +209,7 @@ automation:
Sending a Notification when the Alarm is Armed (Away/Home), Disarmed and in Pending Status Sending a Notification when the Alarm is Armed (Away/Home), Disarmed and in Pending Status
{% raw %} {% raw %}
```yaml ```yaml
- alias: 'Send notification when alarm is Disarmed' - alias: 'Send notification when alarm is Disarmed'
trigger: trigger:
@ -220,9 +221,7 @@ Sending a Notification when the Alarm is Armed (Away/Home), Disarmed and in Pend
data: data:
message: "ALARM! The alarm is Disarmed at {{ states('sensor.date_time') }}" message: "ALARM! The alarm is Disarmed at {{ states('sensor.date_time') }}"
``` ```
{% endraw %}
{% raw %}
```yaml ```yaml
- alias: 'Send notification when alarm is in pending status' - alias: 'Send notification when alarm is in pending status'
trigger: trigger:
@ -234,9 +233,7 @@ Sending a Notification when the Alarm is Armed (Away/Home), Disarmed and in Pend
data: data:
message: "ALARM! The alarm is in pending status at {{ states('sensor.date_time') }}" message: "ALARM! The alarm is in pending status at {{ states('sensor.date_time') }}"
``` ```
{% endraw %}
{% raw %}
```yaml ```yaml
- alias: 'Send notification when alarm is Armed in Away mode' - alias: 'Send notification when alarm is Armed in Away mode'
trigger: trigger:
@ -248,9 +245,7 @@ Sending a Notification when the Alarm is Armed (Away/Home), Disarmed and in Pend
data: data:
message: "ALARM! The alarm is armed in Away mode {{ states('sensor.date_time') }}" message: "ALARM! The alarm is armed in Away mode {{ states('sensor.date_time') }}"
``` ```
{% endraw %}
{% raw %}
```yaml ```yaml
- alias: 'Send notification when alarm is Armed in Home mode' - alias: 'Send notification when alarm is Armed in Home mode'
trigger: trigger:
@ -264,4 +259,5 @@ Sending a Notification when the Alarm is Armed (Away/Home), Disarmed and in Pend
message: > message: >
ALARM! The alarm is armed in Home mode {{ states('sensor.date_time') }} ALARM! The alarm is armed in Home mode {{ states('sensor.date_time') }}
``` ```
{% endraw %} {% endraw %}

View File

@ -91,6 +91,7 @@ If the command is a word command, the `data` field contains a list of the comman
This example also uses the [matrix `notify` platform](#notifications). This example also uses the [matrix `notify` platform](#notifications).
{% raw %} {% raw %}
```yaml ```yaml
# The Matrix component # The Matrix component
matrix: matrix:
@ -135,6 +136,7 @@ automation:
data: data:
message: "Hello {{trigger.event.data.args['name']}}" message: "Hello {{trigger.event.data.args['name']}}"
``` ```
{% endraw %} {% endraw %}
This configuration will: This configuration will:

View File

@ -56,6 +56,7 @@ If the STB is on the same network segment as Home Assistant, it can determine wh
The `play_media` function can be used in scripts to change channels: The `play_media` function can be used in scripts to change channels:
{% raw %} {% raw %}
```yaml ```yaml
# Example play_media script to change channel # Example play_media script to change channel
# #
@ -67,11 +68,13 @@ change_channel:
media_content_id: "{{ channel_number }}" media_content_id: "{{ channel_number }}"
media_content_type: "channel" media_content_type: "channel"
``` ```
{% endraw %} {% endraw %}
The `play_media` function can also be used to trigger actions on the set-up-box such opening the videoclub: The `play_media` function can also be used to trigger actions on the set-up-box such opening the videoclub:
{% raw %} {% raw %}
```yaml ```yaml
# Example play_media script to trigger an action # Example play_media script to trigger an action
# #
@ -83,6 +86,7 @@ press_button:
media_content_id: "{{ action }}" media_content_id: "{{ action }}"
media_content_type: "mediaroom" media_content_type: "mediaroom"
``` ```
{% endraw %} {% endraw %}
Check [here](https://github.com/dgomes/pymediaroom) for the list of possible media_content_id's Check [here](https://github.com/dgomes/pymediaroom) for the list of possible media_content_id's

View File

@ -86,6 +86,7 @@ Example automation
Below you find an example of an automation. Below you find an example of an automation.
{% raw %} {% raw %}
```yaml ```yaml
automation: automation:
- alias: Alert me about weather warnings - alias: Alert me about weather warnings
@ -99,6 +100,7 @@ automation:
title: "{{state_attr('binary_sensor.meteoalarm', 'headline')}}" title: "{{state_attr('binary_sensor.meteoalarm', 'headline')}}"
message: "{{state_attr('binary_sensor.meteoalarm', 'description')}} is effective on {{state_attr('binary_sensor.meteoalarm', 'effective')}}" message: "{{state_attr('binary_sensor.meteoalarm', 'description')}} is effective on {{state_attr('binary_sensor.meteoalarm', 'effective')}}"
``` ```
{% endraw %} {% endraw %}
<div class='note warning'> <div class='note warning'>

View File

@ -17,12 +17,14 @@ The `min_max` sensor platform consumes the state from other sensors to determine
This sensor is an alternative to the [template sensor](/integrations/template)'s `value_template:` to get the average or the median of multiple sensors. This sensor is an alternative to the [template sensor](/integrations/template)'s `value_template:` to get the average or the median of multiple sensors.
{% raw %} {% raw %}
```yaml ```yaml
{{ ((float(states('sensor.kitchen_temperature')) + {{ ((float(states('sensor.kitchen_temperature')) +
float(states('sensor.living_room_temperature')) + float(states('sensor.living_room_temperature')) +
float(states('sensor.office_temperature'))) / 3) | round(2) float(states('sensor.office_temperature'))) / 3) | round(2)
}} }}
``` ```
{% endraw %} {% endraw %}
Sensors with an unknown state will be ignored in the calculation. If the unit of measurement of the sensors differs, the `min_max` sensor will go to an error state where the value is `UNKNOWN` and unit of measurement is `ERR`. Sensors with an unknown state will be ignored in the calculation. If the unit of measurement of the sensors differs, the `min_max` sensor will go to an error state where the value is `UNKNOWN` and unit of measurement is `ERR`.

View File

@ -81,6 +81,7 @@ listen:
Automations can be triggered on new files created on the Minio server using the `data_template`. Automations can be triggered on new files created on the Minio server using the `data_template`.
{% raw %} {% raw %}
```yaml ```yaml
#Automatically upload new local files #Automatically upload new local files
automation: automation:
@ -115,6 +116,7 @@ automation:
key: "{{trigger.event.data.key}}" key: "{{trigger.event.data.key}}"
file_path: "/tmp/{{ trigger.event.data.file_name }}" file_path: "/tmp/{{ trigger.event.data.file_name }}"
``` ```
{% endraw %} {% endraw %}
## Platform Services ## Platform Services

View File

@ -66,6 +66,7 @@ Depending on what's plugged into your USB ports, the name found above may change
Some example automations: Some example automations:
{% raw %} {% raw %}
```yaml ```yaml
automation: automation:
- alias: Notify CallerID - alias: Notify CallerID
@ -97,4 +98,5 @@ automation:
data: data:
message: 'Call from {{ state_attr('sensor.modem_callerid', 'cid_name') }}' message: 'Call from {{ state_attr('sensor.modem_callerid', 'cid_name') }}'
``` ```
{% endraw %} {% endraw %}

View File

@ -77,8 +77,6 @@ include:
By default, no entity will be excluded. To limit which entities are being exposed to `MQTT Statestream`, you can use the `include` and `exclude` parameters. By default, no entity will be excluded. To limit which entities are being exposed to `MQTT Statestream`, you can use the `include` and `exclude` parameters.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
mqtt_statestream: mqtt_statestream:
@ -94,8 +92,6 @@ mqtt_statestream:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -111,8 +111,6 @@ You can find the available event types at the [official Netatmo API documentatio
Example: Example:
{% raw %}
```yaml ```yaml
# Example automation for webhooks based Netatmo events # Example automation for webhooks based Netatmo events
- alias: Netatmo event example - alias: Netatmo event example
@ -127,8 +125,6 @@ Example:
service: counter.increment service: counter.increment
``` ```
{% endraw %}
Example: Example:
{% raw %} {% raw %}

View File

@ -49,10 +49,12 @@ services:
An example on how to use it in an automation: An example on how to use it in an automation:
{% raw %} {% raw %}
```yaml ```yaml
action: action:
service: notify.NAME_OF_NOTIFIER_GROUP service: notify.NAME_OF_NOTIFIER_GROUP
data: data:
message: "The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!" message: "The sun is {% if is_state('sun.sun', 'above_horizon') %}up{% else %}down{% endif %}!"
``` ```
{% endraw %} {% endraw %}

View File

@ -44,6 +44,7 @@ Possible events are:
The event includes the name, category, and status of the downloaded nzb. The event includes the name, category, and status of the downloaded nzb.
Example automation to send a Telegram message on a completed download: Example automation to send a Telegram message on a completed download:
{% raw %} {% raw %}
```yaml ```yaml

View File

@ -107,7 +107,9 @@ automation:
``` ```
Update the UV index data every 20 minutes while the sun is at least 10 degrees above the horizon: Update the UV index data every 20 minutes while the sun is at least 10 degrees above the horizon:
{% raw %} {% raw %}
```yaml ```yaml
automation: automation:
- alias: Update OpenUV every 20 minutes while the sun is at least 10 degrees above the horizon - alias: Update OpenUV every 20 minutes while the sun is at least 10 degrees above the horizon
@ -122,9 +124,11 @@ automation:
action: action:
service: openuv.update_uv_index_data service: openuv.update_uv_index_data
``` ```
{% endraw %} {% endraw %}
Update the protection window once a day: Update the protection window once a day:
```yaml ```yaml
automation: automation:
- alias: Update OpenUV protection window once a day - alias: Update OpenUV protection window once a day

View File

@ -238,7 +238,9 @@ Refresh a Plex library to scan for new and updated media.
Scan for new controllable Plex clients. This may be necessary in scripts or automations which control a Plex `media_player` entity, but where the underlying device must be turned on first. Scan for new controllable Plex clients. This may be necessary in scripts or automations which control a Plex `media_player` entity, but where the underlying device must be turned on first.
Example script: Example script:
{% raw %} {% raw %}
```yaml ```yaml
play_plex_on_tv: play_plex_on_tv:
sequence: sequence:
@ -258,6 +260,7 @@ play_plex_on_tv:
media_content_id: '{"library_name": "Movies", "title": "Zoolander"}' media_content_id: '{"library_name": "Movies", "title": "Zoolander"}'
media_content_type: movie media_content_type: movie
``` ```
{% endraw %} {% endraw %}
## Notes ## Notes

View File

@ -93,7 +93,6 @@ The binary sensors **button_press**, **sound** and **tamper** are switched `On`
The following example show how to implement an automation for the **button_press** binary sensor. The following example show how to implement an automation for the **button_press** binary sensor.
{% raw %}
```yaml ```yaml
# Example configuration.yaml Automation entry # Example configuration.yaml Automation entry
automation: automation:
@ -108,13 +107,13 @@ automation:
title: Point button press title: Point button press
message: Point button was pressed. message: Point button was pressed.
``` ```
{% endraw %}
### Webhook events ### Webhook events
The events shown as [binary sensors](#binary-sensor) are sent to Home Assistant as webhooks with the `event_type` set to `point_webhook_received`. Below is an example of how to use such a webhook do note the `trigger.event.data.event.device_id` which translates to the id of the Point device that sent the event. The events shown as [binary sensors](#binary-sensor) are sent to Home Assistant as webhooks with the `event_type` set to `point_webhook_received`. Below is an example of how to use such a webhook do note the `trigger.event.data.event.device_id` which translates to the id of the Point device that sent the event.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml Automation entry # Example configuration.yaml Automation entry
automation: automation:
@ -132,6 +131,7 @@ automation:
title: Point button press (webhook) title: Point button press (webhook)
message: "Button press on Point {{ trigger.event.data.event.device_id }}" message: "Button press on Point {{ trigger.event.data.event.device_id }}"
``` ```
{% endraw %} {% endraw %}
## Sensor ## Sensor

View File

@ -98,8 +98,6 @@ component_config_glob:
By default, no entity will be excluded. To limit which entities are being exposed to `Prometheus`, you can use the `filter` parameter. By default, no entity will be excluded. To limit which entities are being exposed to `Prometheus`, you can use the `filter` parameter.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
prometheus: prometheus:
@ -113,8 +111,6 @@ prometheus:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -112,8 +112,6 @@ recorder:
By default, no entity will be excluded. To limit which entities are being exposed to `Recorder`, you can use the `include` and `exclude` parameters. By default, no entity will be excluded. To limit which entities are being exposed to `Recorder`, you can use the `include` and `exclude` parameters.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
recorder: recorder:
@ -128,8 +126,6 @@ recorder:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -105,8 +105,8 @@ Here's an example for an automation that creates a new task whenever `sensor.mys
- service: remember_the_milk.myaccount_complete_task - service: remember_the_milk.myaccount_complete_task
data: data:
id: "{{trigger.entity_id}}" id: "{{trigger.entity_id}}"
``` ```
{% endraw %} {% endraw %}
## Disclaimer ## Disclaimer

View File

@ -244,6 +244,7 @@ sensor:
[JSON Test](https://www.jsontest.com/) returns the current time, date and milliseconds since epoch from [http://date.jsontest.com/](http://date.jsontest.com/). [JSON Test](https://www.jsontest.com/) returns the current time, date and milliseconds since epoch from [http://date.jsontest.com/](http://date.jsontest.com/).
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: rest - platform: rest
@ -262,6 +263,7 @@ sensor:
friendly_name: 'milliseconds' friendly_name: 'milliseconds'
value_template: '{{ states.sensor.json_time.attributes["milliseconds_since_epoch"] }}' value_template: '{{ states.sensor.json_time.attributes["milliseconds_since_epoch"] }}'
``` ```
{% endraw %} {% endraw %}
[JSONPlaceholder](https://jsonplaceholder.typicode.com/) provides sample JSON data for testing. In the below example, JSONPath locates the attributes in the JSON document. [JSONPath Online Evaluator](https://jsonpath.com/) provides a tool to test your JSONPath. If the endpoint returns XML, it will be converted to JSON using `xmltodict` before searching for attributes. You may find the [XMLtoDict debug tool](https://xmltodict-debugger.glitch.me/) helpful for testing how your XML converts to JSON. [JSONPlaceholder](https://jsonplaceholder.typicode.com/) provides sample JSON data for testing. In the below example, JSONPath locates the attributes in the JSON document. [JSONPath Online Evaluator](https://jsonpath.com/) provides a tool to test your JSONPath. If the endpoint returns XML, it will be converted to JSON using `xmltodict` before searching for attributes. You may find the [XMLtoDict debug tool](https://xmltodict-debugger.glitch.me/) helpful for testing how your XML converts to JSON.
@ -287,6 +289,7 @@ sensor:
This sample fetches a weather report from [OpenWeatherMap](https://openweathermap.org/), maps the resulting data into attributes of the RESTful sensor and then creates a set of [template](/integrations/template) sensors that monitor the attributes and present the values in a usable form. This sample fetches a weather report from [OpenWeatherMap](https://openweathermap.org/), maps the resulting data into attributes of the RESTful sensor and then creates a set of [template](/integrations/template) sensors that monitor the attributes and present the values in a usable form.
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: rest - platform: rest
@ -318,11 +321,13 @@ sensor:
unit_of_measurement: "%" unit_of_measurement: "%"
entity_id: sensor.owm_report entity_id: sensor.owm_report
``` ```
{% endraw %} {% endraw %}
This configuration shows how to extract multiple values from a dictionary with `json_attributes` and `template`. This avoids flooding the REST service by only requesting the result once, then creating multiple attributes from that single result using templates. By default, the sensor state would be set to the full JSON — here, that would exceed the 255-character maximum allowed length for the state, so we override that default by using `value_template` to set a static value of `OK`. This configuration shows how to extract multiple values from a dictionary with `json_attributes` and `template`. This avoids flooding the REST service by only requesting the result once, then creating multiple attributes from that single result using templates. By default, the sensor state would be set to the full JSON — here, that would exceed the 255-character maximum allowed length for the state, so we override that default by using `value_template` to set a static value of `OK`.
{% raw %} {% raw %}
```json ```json
{ {
"bedroom1": { "bedroom1": {
@ -345,9 +350,11 @@ This configuration shows how to extract multiple values from a dictionary with `
} }
} }
``` ```
{% endraw %} {% endraw %}
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: rest - platform: rest
@ -377,6 +384,7 @@ sensor:
device_class: temperature device_class: temperature
unit_of_measurement: '°C' unit_of_measurement: '°C'
``` ```
{% endraw %} {% endraw %}
The below example allows shows how to extract multiple values from a dictionary with `json_attributes` and `json_attributes_path` from the XML of a Steamist Steambath Wi-Fi interface and use them to create a switch and multiple sensors without having to poll the endpoint numerous times. The below example allows shows how to extract multiple values from a dictionary with `json_attributes` and `json_attributes_path` from the XML of a Steamist Steambath Wi-Fi interface and use them to create a switch and multiple sensors without having to poll the endpoint numerous times.

View File

@ -96,6 +96,7 @@ The commands can be dynamic, using templates to insert values of other entities.
In this example, uses [templates](/docs/configuration/templating/) for dynamic parameters. In this example, uses [templates](/docs/configuration/templating/) for dynamic parameters.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
rest_command: rest_command:
@ -110,6 +111,7 @@ rest_command:
content_type: 'application/json; charset=utf-8' content_type: 'application/json; charset=utf-8'
verify_ssl: true verify_ssl: true
``` ```
{% endraw %} {% endraw %}
### How to test your new REST command ### How to test your new REST command
@ -122,6 +124,7 @@ Call the new service from [developer tools](/docs/tools/dev-tools/) in the sideb
"emoji":":plex:" "emoji":":plex:"
} }
``` ```
### Using a REST command as an action in an automation ### Using a REST command as an action in an automation
```yaml ```yaml

View File

@ -283,7 +283,7 @@ automation:
- `rfxtrx.send`: Send a custom event using the RFXtrx device. - `rfxtrx.send`: Send a custom event using the RFXtrx device.
#### Service: Send ### Service: Send
Simulate a button being pressed: Simulate a button being pressed:
@ -295,7 +295,6 @@ action:
event: 0b1111e003af16aa10000060 event: 0b1111e003af16aa10000060
``` ```
## Generate codes ## Generate codes
If you need to generate codes for switches and lights, you can use a template (useful, for example, COCO switches). If you need to generate codes for switches and lights, you can use a template (useful, for example, COCO switches).
@ -303,7 +302,7 @@ If you need to generate codes for switches and lights, you can use a template (u
- Go to home-assistant-IP:8123/dev-template - Go to home-assistant-IP:8123/dev-template
- Use the following codes to generate an event: - Use the following codes to generate an event:
*Switch: ARC* ### Switch: ARC
{% raw %} {% raw %}
@ -313,7 +312,7 @@ If you need to generate codes for switches and lights, you can use a template (u
{% endraw %} {% endraw %}
*Light: ARC* ### Light: ARC
{% raw %} {% raw %}
@ -323,8 +322,8 @@ If you need to generate codes for switches and lights, you can use a template (u
{% endraw %} {% endraw %}
### Light: Lightwave RF
*Light: Lightwave RF*
{% raw %} {% raw %}
```yaml ```yaml
@ -333,7 +332,6 @@ If you need to generate codes for switches and lights, you can use a template (u
{% endraw %} {% endraw %}
- Use this code to add a new switch in the options menu. - Use this code to add a new switch in the options menu.
- Launch your Home Assistant and go to the website. - Launch your Home Assistant and go to the website.
- Enable learning mode on your switch (i.e., push learn button or plug it in a wall socket) - Enable learning mode on your switch (i.e., push learn button or plug it in a wall socket)

View File

@ -59,6 +59,7 @@ downloader:
Then you can use the following automation, with the entities from your system, which will save the video file under `<config>/downloads/ring_<camera_name>/`: Then you can use the following automation, with the entities from your system, which will save the video file under `<config>/downloads/ring_<camera_name>/`:
{% raw %} {% raw %}
```yaml ```yaml
automation: automation:
alias: 'Save the video when the doorbell is pushed' alias: 'Save the video when the doorbell is pushed'
@ -73,6 +74,7 @@ automation:
subdir: "{{state_attr('camera.front_door', 'friendly_name')}}" subdir: "{{state_attr('camera.front_door', 'friendly_name')}}"
filename: "{{state_attr('camera.front_door', 'friendly_name')}}" filename: "{{state_attr('camera.front_door', 'friendly_name')}}"
``` ```
{% endraw %} {% endraw %}
If you want to use `python_script`, enable it your `configuration.yaml` file first: If you want to use `python_script`, enable it your `configuration.yaml` file first:

View File

@ -85,6 +85,7 @@ In this section you find some real-life examples of how to use this sensor. Ther
The current release Home Assistant is published on [https://www.home-assistant.io/](/) The current release Home Assistant is published on [https://www.home-assistant.io/](/)
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
# Example configuration.yaml entry # Example configuration.yaml entry
@ -94,6 +95,7 @@ sensor:
select: ".current-version h1" select: ".current-version h1"
value_template: '{{ value.split(":")[1] }}' value_template: '{{ value.split(":")[1] }}'
``` ```
{% endraw %} {% endraw %}
### Available implementations ### Available implementations
@ -101,6 +103,7 @@ sensor:
Get the counter for all our implementations from the [Component overview](/integrations/) page. Get the counter for all our implementations from the [Component overview](/integrations/) page.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -110,6 +113,7 @@ sensor:
select: 'a[href="#all"]' select: 'a[href="#all"]'
value_template: '{{ value.split("(")[1].split(")")[0] }}' value_template: '{{ value.split("(")[1].split(")")[0] }}'
``` ```
{% endraw %} {% endraw %}
### Get a value out of a tag ### Get a value out of a tag
@ -160,6 +164,7 @@ sensor:
This example tries to retrieve the price for electricity. This example tries to retrieve the price for electricity.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -170,6 +175,7 @@ sensor:
value_template: '{{ ((value.split(" ")[0]) | replace (",", ".")) }}' value_template: '{{ ((value.split(" ")[0]) | replace (",", ".")) }}'
unit_of_measurement: "öre/kWh" unit_of_measurement: "öre/kWh"
``` ```
{% endraw %} {% endraw %}
### BOM Weather ### BOM Weather
@ -177,6 +183,7 @@ sensor:
The Australian Bureau of Meteorology website returns an error if the User Agent header is not sent. The Australian Bureau of Meteorology website returns an error if the User Agent header is not sent.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -190,4 +197,5 @@ sensor:
headers: headers:
User-Agent: Mozilla/5.0 User-Agent: Mozilla/5.0
``` ```
{% endraw %} {% endraw %}

View File

@ -233,6 +233,7 @@ Following is an example of the calling script not waiting. It performs some othe
This technique can also be used for the calling script to wait for the called script, but _not_ be aborted if the called script aborts due to errors. This technique can also be used for the calling script to wait for the called script, but _not_ be aborted if the called script aborts due to errors.
{% raw %} {% raw %}
```yaml ```yaml
script: script:
script_1: script_1:
@ -247,4 +248,5 @@ script:
sequence: sequence:
# Do some things at the same time as the first script... # Do some things at the same time as the first script...
``` ```
{% endraw %} {% endraw %}

View File

@ -250,7 +250,6 @@ home/bathroom/analog/brightness 290.00
The configuration will look like the example below: The configuration will look like the example below:
{% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -258,4 +257,3 @@ sensor:
name: "Brightness" name: "Brightness"
state_topic: "home/bathroom/analog/brightness" state_topic: "home/bathroom/analog/brightness"
``` ```
{% endraw %}

View File

@ -84,9 +84,11 @@ value_template:
### TMP36 ### TMP36
{% raw %} {% raw %}
```yaml ```yaml
"{{ (((states('sensor.serial_sensor') | float * 5 / 1024 ) - 0.5) * 100) | round(1) }}" "{{ (((states('sensor.serial_sensor') | float * 5 / 1024 ) - 0.5) * 100) | round(1) }}"
``` ```
{% endraw %} {% endraw %}
## Examples ## Examples
@ -127,6 +129,7 @@ $,24.3,51,12.8,1029.76,0.0,0.00,*
To parse this into individual sensors, split using the comma delimiter and then create a template sensor for each item of interest. To parse this into individual sensors, split using the comma delimiter and then create a template sensor for each item of interest.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -149,6 +152,7 @@ sensor:
unit_of_measurement: "mbar" unit_of_measurement: "mbar"
value_template: "{{ states('sensor.serial_sensor').split(',')[4] | float }}" value_template: "{{ states('sensor.serial_sensor').split(',')[4] | float }}"
``` ```
{% endraw %} {% endraw %}
### Digispark USB Development Board ### Digispark USB Development Board

View File

@ -58,6 +58,7 @@ show_delivered:
Use the following templated Markdown card to list all packages in transit along their status: Use the following templated Markdown card to list all packages in transit along their status:
{% raw %} {% raw %}
```yaml ```yaml
type: markdown type: markdown
title: Packages in transit title: Packages in transit
@ -69,4 +70,5 @@ content: >-
{% endfor %} {% endfor %}
``` ```
{% endraw %} {% endraw %}

View File

@ -38,7 +38,6 @@ Any service data passed into the service call to activate the shell command will
`stdout` and `stderr` output from the command are both captured and will be logged by setting the [log level](/integrations/logger/) to debug. `stdout` and `stderr` output from the command are both captured and will be logged by setting the [log level](/integrations/logger/) to debug.
```yaml ```yaml
# Apply value of a GUI slider to the shell_command # Apply value of a GUI slider to the shell_command
automation: automation:
- alias: run_set_ac - alias: run_set_ac

View File

@ -145,6 +145,7 @@ In Home Assistant, we trigger actions based on intents produced by Snips using t
Note: If your Snips action is prefixed with a username (e.g., `john:playmusic` or `john__playmusic`), the Snips integration in Home Assistant will try and strip off the username. Bear this in mind if you get the error `Received unknown intent` even when what you see on the MQTT bus looks correct. Internally the Snips integration is trying to match the non-username version of the intent (i.e., just `playmusic`). Note: If your Snips action is prefixed with a username (e.g., `john:playmusic` or `john__playmusic`), the Snips integration in Home Assistant will try and strip off the username. Bear this in mind if you get the error `Received unknown intent` even when what you see on the MQTT bus looks correct. Internally the Snips integration is trying to match the non-username version of the intent (i.e., just `playmusic`).
{% raw %} {% raw %}
```yaml ```yaml
snips: snips:
@ -156,6 +157,7 @@ intent_script:
entity_id: 'light.{{ objectLocation | replace(" ","_") }}' entity_id: 'light.{{ objectLocation | replace(" ","_") }}'
color_name: '{{ objectColor }}' color_name: '{{ objectColor }}'
``` ```
{% endraw %} {% endraw %}
In the `data` block, we have access to special variables, corresponding to the slot names for the intent. In the present case, the `ActivateLightColor` has two slots, `objectLocation` and `objectColor`. In the `data` block, we have access to special variables, corresponding to the slot names for the intent. In the present case, the `ActivateLightColor` has two slots, `objectLocation` and `objectColor`.
@ -169,6 +171,7 @@ In the above example, the slots are plain strings. However, Snips has a duration
In this example if we had an intent triggered with 'Set a timer for five minutes', `duration:` would equal 300 and `duration_raw:` would be set to 'five minutes'. The duration can be easily used to trigger Home Assistant events and the `duration_raw:` could be used to send a human readable response or alert. In this example if we had an intent triggered with 'Set a timer for five minutes', `duration:` would equal 300 and `duration_raw:` would be set to 'five minutes'. The duration can be easily used to trigger Home Assistant events and the `duration_raw:` could be used to send a human readable response or alert.
{% raw %} {% raw %}
```yaml ```yaml
SetTimer: SetTimer:
speech: speech:
@ -184,6 +187,7 @@ SetTimer:
duration_raw: "{{ raw_value }}" duration_raw: "{{ raw_value }}"
probability: "{{ probability }}" probability: "{{ probability }}"
``` ```
{% endraw %} {% endraw %}
### Sending TTS Notifications ### Sending TTS Notifications
@ -288,6 +292,7 @@ So now you can open and close your garage door, let's check the weather. Add the
Then add this to your configuration file. Then add this to your configuration file.
{% raw %} {% raw %}
```yaml ```yaml
intent_script: intent_script:
searchWeatherForecast: searchWeatherForecast:
@ -301,4 +306,5 @@ intent_script:
{{ states('sensor.dark_sky_weather_daily_high_temperature') | round(0)}} {{ states('sensor.dark_sky_weather_daily_high_temperature') | round(0)}}
and {{ states('sensor.dark_sky_weather_hourly_summary') }} and {{ states('sensor.dark_sky_weather_hourly_summary') }}
``` ```
{% endraw %} {% endraw %}

View File

@ -225,6 +225,7 @@ According to the most common SNMP standard, the uptime of a device is accessible
To create a sensor that displays the uptime for your printer in minutes, you can use this configuration: To create a sensor that displays the uptime for your printer in minutes, you can use this configuration:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -236,6 +237,7 @@ sensor:
unit_of_measurement: 'minutes' unit_of_measurement: 'minutes'
value_template: '{{((value | int) / 6000) | int}}' value_template: '{{((value | int) / 6000) | int}}'
``` ```
{% endraw %} {% endraw %}
The `accept_errors` option will allow the sensor to work even if the printer is not on when Home Assistant is first started: the sensor will just display a `-` instead of a minute count. The `accept_errors` option will allow the sensor to work even if the printer is not on when Home Assistant is first started: the sensor will just display a `-` instead of a minute count.

View File

@ -24,14 +24,12 @@ There are 2 options in configuring the SolarEdge integration:
- Via the Home Assistant user interface where it will let you enter the port string to connect to the Velbus bus. - Via the Home Assistant user interface where it will let you enter the port string to connect to the Velbus bus.
- Via the Home Assistant `configuration.yaml` file. - Via the Home Assistant `configuration.yaml` file.
{% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
solaredge: solaredge:
api_key: API_KEY api_key: API_KEY
site_id: SITE_ID site_id: SITE_ID
``` ```
{% endraw %}
{% configuration %} {% configuration %}
api_key: api_key:
@ -54,6 +52,7 @@ name:
In case you would like to convert the values for example to kWh instead of the default Wh, you can use the [template platform](/integrations/template). In case you would like to convert the values for example to kWh instead of the default Wh, you can use the [template platform](/integrations/template).
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry for template platform # Example configuration.yaml entry for template platform
sensor: sensor:
@ -62,4 +61,5 @@ sensor:
solaredge_energy_this_year_template: solaredge_energy_this_year_template:
value_template: "{{ (states('sensor.solaredge_energy_this_year') | float / 1000) | round(2) }}" value_template: "{{ (states('sensor.solaredge_energy_this_year') | float / 1000) | round(2) }}"
``` ```
{% endraw %} {% endraw %}

View File

@ -64,6 +64,7 @@ sensor:
In case you would like to convert the values for example to kWh instead of the default Wh, you can use the [template platform](/integrations/template). In case you would like to convert the values for example to kWh instead of the default Wh, you can use the [template platform](/integrations/template).
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry for sensor template platform # Example configuration.yaml entry for sensor template platform
sensor: sensor:
@ -74,4 +75,5 @@ sensor:
unit_of_measurement: 'KWh' unit_of_measurement: 'KWh'
icon_template: "mdi:solar-power" icon_template: "mdi:solar-power"
``` ```
{% endraw %} {% endraw %}

View File

@ -62,6 +62,7 @@ sensor:
In case you would like to convert the values, for example, to Wh instead of the default kWh, you can use the [template platform](/integrations/template/). In case you would like to convert the values, for example, to Wh instead of the default kWh, you can use the [template platform](/integrations/template/).
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry for sensor template platform # Example configuration.yaml entry for sensor template platform
sensor: sensor:
@ -70,6 +71,7 @@ sensor:
solarlog_yield_day_template: solarlog_yield_day_template:
value_template: "{{ (states('sensor.solarlog_yield_day') | float * 1000) | round(0) }}" value_template: "{{ (states('sensor.solarlog_yield_day') | float * 1000) | round(0) }}"
``` ```
{% endraw %} {% endraw %}
## Sensors ## Sensors

View File

@ -41,6 +41,7 @@ port:
If you would like to convert the values from multiple panels or view the total power the house is using, you can use the [template platform](/integrations/template). If you would like to convert the values from multiple panels or view the total power the house is using, you can use the [template platform](/integrations/template).
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry for template platform # Example configuration.yaml entry for template platform
sensors: sensors:
@ -55,6 +56,7 @@ sensors:
unit_of_measurement: 'W' unit_of_measurement: 'W'
value_template: "{{ (states('sensor.power_now') | float) - (states('sensor.exported_power') | float) }}" value_template: "{{ (states('sensor.power_now') | float) - (states('sensor.exported_power') | float) }}"
``` ```
{% endraw %} {% endraw %}
### Note ### Note

View File

@ -101,6 +101,7 @@ speedtestdotnet:
### Using as a trigger in an automation ### Using as a trigger in an automation
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
automation: automation:
@ -118,6 +119,7 @@ automation:
action: action:
- service: shell_command.red - service: shell_command.red
``` ```
{% endraw %} {% endraw %}
## Notes ## Notes

View File

@ -87,8 +87,6 @@ filter:
By default, no entity will be excluded. To limit which entities are being exposed to `Splunk`, you can use the `filter` parameter. By default, no entity will be excluded. To limit which entities are being exposed to `Splunk`, you can use the `filter` parameter.
{% raw %}
```yaml ```yaml
# Example filter to include specified domains and exclude specified entities # Example filter to include specified domains and exclude specified entities
splunk: splunk:
@ -103,8 +101,6 @@ splunk:
- light.kitchen_light - light.kitchen_light
``` ```
{% endraw %}
Filters are applied as follows: Filters are applied as follows:
1. No includes or excludes - pass all entities 1. No includes or excludes - pass all entities

View File

@ -86,7 +86,6 @@ The query will look like this:
SELECT * FROM states WHERE entity_id = 'sensor.temperature_in' ORDER BY state_id DESC LIMIT 1; SELECT * FROM states WHERE entity_id = 'sensor.temperature_in' ORDER BY state_id DESC LIMIT 1;
``` ```
{% raw %}
```yaml ```yaml
# Example configuration.yaml # Example configuration.yaml
sensor: sensor:
@ -96,7 +95,6 @@ sensor:
query: "SELECT * FROM states WHERE entity_id = 'sensor.temperature_in' ORDER BY state_id DESC LIMIT 1;" query: "SELECT * FROM states WHERE entity_id = 'sensor.temperature_in' ORDER BY state_id DESC LIMIT 1;"
column: 'state' column: 'state'
``` ```
{% endraw %}
Note that the SQL sensor state corresponds to the last row of the SQL result set. Note that the SQL sensor state corresponds to the last row of the SQL result set.
@ -113,6 +111,7 @@ SELECT * FROM states WHERE entity_id = 'binary_sensor.xyz789' GROUP BY state ORD
#### Postgres #### Postgres
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: sql - platform: sql
@ -123,6 +122,7 @@ sensor:
column: "db_size" column: "db_size"
unit_of_measurement: MB unit_of_measurement: MB
``` ```
{% endraw %} {% endraw %}
#### MariaDB/MySQL #### MariaDB/MySQL
@ -130,6 +130,7 @@ sensor:
Change `table_schema="hass"` to the name that you use as the database name, to ensure that your sensor will work properly. Change `table_schema="hass"` to the name that you use as the database name, to ensure that your sensor will work properly.
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: sql - platform: sql
@ -140,6 +141,7 @@ sensor:
column: 'value' column: 'value'
unit_of_measurement: kB unit_of_measurement: kB
``` ```
{% endraw %} {% endraw %}
#### SQLite #### SQLite
@ -147,6 +149,7 @@ sensor:
If you are using the `recorder` integration then you don't need to specify the location of the database. For all other cases, add `db_url: sqlite:////path/to/database.db`. If you are using the `recorder` integration then you don't need to specify the location of the database. For all other cases, add `db_url: sqlite:////path/to/database.db`.
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: sql - platform: sql
@ -156,4 +159,5 @@ sensor:
column: 'size' column: 'size'
unit_of_measurement: 'MiB' unit_of_measurement: 'MiB'
``` ```
{% endraw %} {% endraw %}

View File

@ -215,7 +215,6 @@ mosquitto_pub -h 127.0.0.1 -t home/bathroom/gpio/13 -m "1"
The configuration will look like the example below: The configuration will look like the example below:
{% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
switch: switch:
@ -226,4 +225,3 @@ switch:
payload_on: "1" payload_on: "1"
payload_off: "0" payload_off: "0"
``` ```
{% endraw %}

View File

@ -104,6 +104,7 @@ automation:
This automation will create a persistent notification whenever an error or warning is logged that has the word "service" in the message: This automation will create a persistent notification whenever an error or warning is logged that has the word "service" in the message:
{% raw %} {% raw %}
```yaml ```yaml
automation: automation:
- alias: Create notifications for "service" errors - alias: Create notifications for "service" errors
@ -119,13 +120,13 @@ automation:
title: Something bad happened title: Something bad happened
message: '{{ trigger.event.data.message }}' message: '{{ trigger.event.data.message }}'
``` ```
{% endraw %} {% endraw %}
### Writing to log ### Writing to log
This automation will create a new log entry when the door is opened: This automation will create a new log entry when the door is opened:
{% raw %}
```yaml ```yaml
automation: automation:
- alias: Log door opened - alias: Log door opened
@ -139,5 +140,4 @@ automation:
data: data:
message: 'Door opened!' message: 'Door opened!'
level: info level: info
``` ```
{% endraw %}

View File

@ -13,6 +13,7 @@ The `telnet` switch platform allows you to control devices with telnet commands.
To enable this switch, add the following lines to your `configuration.yaml` file: To enable this switch, add the following lines to your `configuration.yaml` file:
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
switch: switch:
@ -27,6 +28,7 @@ switch:
value_template: '{{ value == "PWR=01" }}' value_template: '{{ value == "PWR=01" }}'
timeout: 0.9 timeout: 0.9
``` ```
{% endraw %} {% endraw %}
{% configuration %} {% configuration %}

View File

@ -289,6 +289,7 @@ sensor:
This example shows how to add custom attributes. This example shows how to add custom attributes.
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: template - platform: template

View File

@ -53,7 +53,6 @@ This section includes some examples of how to use this sensor.
This will show only Probe 1 with min and max data. This will show only Probe 1 with min and max data.
{% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -65,13 +64,11 @@ sensor:
- probe1_min - probe1_min
- probe1_max - probe1_max
``` ```
{% endraw %}
### Ignore a Device ### Ignore a Device
This will exclude a device from creating sensors. You would replace `"00:00:00:00:00:00"` with your device's serial number. This will exclude a device from creating sensors. You would replace `"00:00:00:00:00:00"` with your device's serial number.
{% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -81,7 +78,6 @@ sensor:
exclude: exclude:
- "00:00:00:00:00:00" - "00:00:00:00:00:00"
``` ```
{% endraw %}
### Notify when Probe 1 goes above a certain temperature ### Notify when Probe 1 goes above a certain temperature
@ -89,6 +85,7 @@ This will use an automation to trigger a notification when Probe 1 goes above a
By default, your smoke is named "My Smoke" in the app. If you have changed it you will need to change the sensor name from `my_smoke_probe_1` to `your_name_probe_1`. By default, your smoke is named "My Smoke" in the app. If you have changed it you will need to change the sensor name from `my_smoke_probe_1` to `your_name_probe_1`.
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
sensor: sensor:
@ -125,4 +122,5 @@ automation:
{{- ' '+states("sensor.my_smoke_probe_1") -}} {{- ' '+states("sensor.my_smoke_probe_1") -}}
{{- state_attr('sensor.my_smoke_probe_1','unit_of_measurement') }} {{- state_attr('sensor.my_smoke_probe_1','unit_of_measurement') }}
``` ```
{% endraw %} {% endraw %}

View File

@ -19,9 +19,11 @@ If the sensor is configured with no hysteresis and the sensor value is equal to
It's an alternative to the template binary sensor's `value_template:` to get the abnormal/too high/too low states. It's an alternative to the template binary sensor's `value_template:` to get the abnormal/too high/too low states.
{% raw %} {% raw %}
```yaml ```yaml
{{ states('sensor.furnace') > 2.5 }} {{ states('sensor.furnace') > 2.5 }}
``` ```
{% endraw %} {% endraw %}
## Configuration ## Configuration

View File

@ -65,6 +65,6 @@ sensor:
friendly_name: "Date and time" friendly_name: "Date and time"
value_template: "{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%A %B %-m, %I:%M %p') }}" value_template: "{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%A %B %-m, %I:%M %p') }}"
icon_template: mdi:calendar-clock icon_template: mdi:calendar-clock
``` ```
{% endraw %} {% endraw %}

View File

@ -145,6 +145,7 @@ In order to get the power consumption readings from a TP-Link HS110 device, you'
In the example below, change all of the `my_tp_switch`'s to match your device's entity ID (without the domain). For example, if your entity is `switch.whale_heater` then replace `my_tp_switch` with `whale_heater`: In the example below, change all of the `my_tp_switch`'s to match your device's entity ID (without the domain). For example, if your entity is `switch.whale_heater` then replace `my_tp_switch` with `whale_heater`:
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: template - platform: template
@ -170,4 +171,5 @@ sensor:
value_template: "{{ state_attr('switch.my_tp_switch','today_energy_kwh') | float }}" value_template: "{{ state_attr('switch.my_tp_switch','today_energy_kwh') | float }}"
unit_of_measurement: 'kWh' unit_of_measurement: 'kWh'
``` ```
{% endraw %} {% endraw %}

View File

@ -93,6 +93,7 @@ Inside of the event, there is the name of the torrent that is started or complet
Example of configuration of an automation with completed torrents: Example of configuration of an automation with completed torrents:
{% raw %} {% raw %}
```yaml ```yaml
- alias: Completed Torrent - alias: Completed Torrent
trigger: trigger:
@ -104,6 +105,7 @@ Example of configuration of an automation with completed torrents:
title: "Torrent completed!" title: "Torrent completed!"
message: "{{trigger.event.data.name}}" message: "{{trigger.event.data.name}}"
``` ```
{% endraw %} {% endraw %}
## Services ## Services
@ -135,6 +137,7 @@ Removes a torrent from the client.
All `*_torrents` sensors e.g. `sensor.transmission_total_torrents` or `sensor.transmission_started_torrents` have a state attribute `torrent_info` that contains information about the torrents that are currently in a corresponding state. You can see this information in **Developer Tools** -> **States** -> `sensor.transmission_total_torrents` -> **Attributes**, or by adding a [Markdown card](/lovelace/markdown/) to Lovelace with the following code: All `*_torrents` sensors e.g. `sensor.transmission_total_torrents` or `sensor.transmission_started_torrents` have a state attribute `torrent_info` that contains information about the torrents that are currently in a corresponding state. You can see this information in **Developer Tools** -> **States** -> `sensor.transmission_total_torrents` -> **Attributes**, or by adding a [Markdown card](/lovelace/markdown/) to Lovelace with the following code:
{% raw %} {% raw %}
```yaml ```yaml
content: > content: >
{% set payload = state_attr('sensor.transmission_total_torrents', 'torrent_info') %} {% set payload = state_attr('sensor.transmission_total_torrents', 'torrent_info') %}
@ -144,4 +147,5 @@ content: >
{{ name|truncate(20) }} is {{ data.percent_done }}% complete, {{ data.eta }} remaining {% endfor %} {{ name|truncate(20) }} is {{ data.percent_done }}% complete, {{ data.eta }} remaining {% endfor %}
type: markdown type: markdown
``` ```
{% endraw %} {% endraw %}

View File

@ -84,6 +84,7 @@ sensor:
The sensor returns n/a if no stop event is found within the next 24h. A `template` sensor can help building a more meaningful string. The sensor returns n/a if no stop event is found within the next 24h. A `template` sensor can help building a more meaningful string.
{% raw %} {% raw %}
```yaml ```yaml
# Sample template sensor # Sample template sensor
- platform: template - platform: template
@ -97,4 +98,5 @@ The sensor returns n/a if no stop event is found within the next 24h. A `templat
{{ state_attr('sensor.bus', 'route') }} in {{ state_attr('sensor.bus', 'due') }}m ({{ state_attr('sensor.bus', 'delay') }}) {{ state_attr('sensor.bus', 'route') }} in {{ state_attr('sensor.bus', 'due') }}m ({{ state_attr('sensor.bus', 'delay') }})
{% endif %} {% endif %}
``` ```
{% endraw %} {% endraw %}

View File

@ -193,6 +193,7 @@ utility_meter:
Additionally, you can add template sensors to compute daily and monthly total usage. Additionally, you can add template sensors to compute daily and monthly total usage.
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: template - platform: template
@ -206,4 +207,5 @@ sensor:
unit_of_measurement: kWh unit_of_measurement: kWh
value_template: "{{ states('sensor.monthly_energy_offpeak')|float + states('sensor.monthly_energy_peak')|float }}" value_template: "{{ states('sensor.monthly_energy_offpeak')|float + states('sensor.monthly_energy_peak')|float }}"
``` ```
{% endraw %} {% endraw %}

View File

@ -203,6 +203,7 @@ unique_id:
### Legacy configuration example ### Legacy configuration example
{% raw %} {% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
vacuum: vacuum:
@ -241,6 +242,7 @@ vacuum:
- max - max
send_command_topic: 'vacuum/send_command' send_command_topic: 'vacuum/send_command'
``` ```
{% endraw %} {% endraw %}
### Legacy MQTT Protocol ### Legacy MQTT Protocol
@ -441,7 +443,6 @@ unique_id:
### State configuration example ### State configuration example
{% raw %}
```yaml ```yaml
# Example configuration.yaml entry # Example configuration.yaml entry
vacuum: vacuum:
@ -469,7 +470,6 @@ vacuum:
- max - max
send_command_topic: 'vacuum/send_command' send_command_topic: 'vacuum/send_command'
``` ```
{% endraw %}
### State MQTT Protocol ### State MQTT Protocol

View File

@ -177,6 +177,7 @@ vacuum:
This example shows how to add custom attributes. This example shows how to add custom attributes.
{% raw %} {% raw %}
```yaml ```yaml
vacuum: vacuum:
- platform: template - platform: template
@ -195,4 +196,5 @@ vacuum:
Charging Charging
{% endif %} {% endif %}
``` ```
{% endraw %} {% endraw %}

View File

@ -44,6 +44,7 @@ name:
For convenient switching of ventilation profiles in the GUI, consider using an [input_select](../input_select) hooked to an automation, for example: For convenient switching of ventilation profiles in the GUI, consider using an [input_select](../input_select) hooked to an automation, for example:
{% raw %} {% raw %}
```yaml ```yaml
input_select: input_select:
ventilation_profile: ventilation_profile:
@ -65,11 +66,13 @@ automation:
data: data:
profile: "{{ states('input_select.ventilation_profile') }}" profile: "{{ states('input_select.ventilation_profile') }}"
``` ```
{% endraw %} {% endraw %}
In order to also update the input select in case some external event changes the Vallox profile (web interface, mechanical switch, reboot, etc...) you can use the following automation: In order to also update the input select in case some external event changes the Vallox profile (web interface, mechanical switch, reboot, etc...) you can use the following automation:
{% raw %} {% raw %}
```yaml ```yaml
automation: automation:
- alias: Update Vallox input_select - alias: Update Vallox input_select
@ -83,6 +86,7 @@ automation:
entity_id: input_select.ventilation_profile entity_id: input_select.ventilation_profile
option: "{{ states('sensor.vallox_current_profile') }}" option: "{{ states('sensor.vallox_current_profile') }}"
``` ```
{% endraw %} {% endraw %}
## Fan Services ## Fan Services

View File

@ -89,6 +89,7 @@ too,
but it will not as Home Assistant is not ready when the sensor gets initialized. but it will not as Home Assistant is not ready when the sensor gets initialized.
{% raw %} {% raw %}
```yaml ```yaml
sensor: sensor:
- platform: rest - platform: rest
@ -96,4 +97,5 @@ sensor:
name: Current Version name: Current Version
value_template: '{{ value_json.version }}' value_template: '{{ value_json.version }}'
``` ```
{% endraw %} {% endraw %}

View File

@ -151,6 +151,7 @@ The path part of `filename` must be an entry in the `allowlist_external_dirs` in
For example, the following action is an automation that would take a snapshot from "front_door_camera" and save it to /tmp with a timestamped filename. For example, the following action is an automation that would take a snapshot from "front_door_camera" and save it to /tmp with a timestamped filename.
{% raw %} {% raw %}
```yaml ```yaml
action: action:
service: camera.snapshot service: camera.snapshot
@ -158,4 +159,5 @@ action:
entity_id: camera.front_door_camera entity_id: camera.front_door_camera
filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg' filename: '/tmp/yourcamera_{{ now().strftime("%Y%m%d-%H%M%S") }}.jpg'
``` ```
{% endraw %} {% endraw %}

Some files were not shown because too many files have changed in this diff Show More