Update link (#2722)

This commit is contained in:
Fabian Affolter 2017-05-28 19:39:40 +02:00 committed by GitHub
parent ba42dad3c7
commit c87e55eec1
27 changed files with 87 additions and 82 deletions

View File

@ -29,9 +29,9 @@ To enable this platform, add the following lines to your `configuration.yaml`:
```yaml
# Example configuration.yaml entry
alarm_control_panel:
platform: mqtt
state_topic: "home/alarm"
command_topic: "home/alarm/set"
- platform: mqtt
state_topic: "home/alarm"
command_topic: "home/alarm/set"
```
Configuration variables:

View File

@ -42,16 +42,16 @@ To use this integration you should define a conversation (intent) in Api.ai, con
- Select name, language (if you are planning to use it with Google Actions check [here](https://support.google.com/assistant/answer/7108196?hl=en) supported languages) and time zone
- Click "Save"
- Go to "Fullfiment" (in the left menu)
- Enable Webhook and set your HA url with the apiai endpoint. Eg.: ``https://myhome.duckdns.org/api/apiai?api_password=HA_PASSWORD``
- Enable Webhook and set your Home Assistant URL with the Api.ai endpoint. Eg.: ``https://myhome.duckdns.org/api/apiai?api_password=HA_PASSWORD``
- Click "Save"
- Create a new intent
- Below "User says" write one phrase that you, the user, will tell Api.ai. Eg.: Which is the temperature at home?
- In "Action" set some key (this will be the bind with HA config), eg.: GetTemperature
- In "Response" set "Cannot connect to HA or it is taking to long" (fall back response)
- In "Action" set some key (this will be the bind with Home Assistant configuration), eg.: GetTemperature
- In "Response" set "Cannot connect to Home Assistant or it is taking to long" (fall back response)
- At the end of the page, click on "Fulfillment" and check "Use webhook"
- Click "Save"
- On the top right, where is written "Try it now...", write, or say, the phrase you have previously defined and hit enter
- Api.ai has send a request to your HA server
- Api.ai has send a request to your Home Assistant server
Take a look to "Integrations", in the left menu, to configure third parties.
@ -85,7 +85,7 @@ apiai:
Inside an intent we can define this variables:
- **speech** (*Optional*): Text or template to return to Api.ai
- **action** (*Optional*): Script definition
- **async_action** (*Optional*): If HA should execute the action asynchronously (returning response to Api.ai without waiting the action to finish). Should be set to `True` if Api.ai is returning the "Cannot connect to HA or it is taking to long" message, but then you will not be able to use values based on the result of the action. Defaults to `False`.
- **async_action** (*Optional*): If Home Assistant should execute the action asynchronously (returning response to Api.ai without waiting the action to finish). Should be set to `True` if Api.ai is returning the "Cannot connect to Home Assistant or it is taking to long" message, but then you will not be able to use values based on the result of the action. Defaults to `False`.
## {% linkable_title Examples %}

View File

@ -32,7 +32,7 @@ Configuration variables:
- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend.
- **payload_on** (*Optional*): The payload that represents enabled state. Default is "ON".
- **payload_off** (*Optional*): The payload that represents disabled state. Default is "OFF".
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
## {% linkable_title Examples %}
@ -71,12 +71,12 @@ An alternative solution could look like this:
```yaml
binary_sensor:
platform: command_line
name: Printer
command: ping -W 1 -c 1 192.168.1.10 > /dev/null 2>&1 && echo success || echo fail
device_class: connectivity
payload_on: "success"
payload_off: "fail"
- platform: command_line
name: Printer
command: ping -W 1 -c 1 192.168.1.10 > /dev/null 2>&1 && echo success || echo fail
device_class: connectivity
payload_on: "success"
payload_off: "fail"
```
Consider to use the [`ping` sensor ](/components/binary_sensor.ping/) as an alternative to the samples above.

View File

@ -33,7 +33,7 @@ Configuration variables:
- **payload_on** (*Optional*): The payload that represents on state. Default is "ON".
- **payload_off** (*Optional*): The payload that represents state. Default is "OFF".
- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
For a quick check you can use the commandline tools shipped with `mosquitto` to send MQTT messages. Set the state of a sensor manually:

View File

@ -16,7 +16,7 @@ ha_iot_class: "Local Polling"
The `rest` binary sensor platform is consuming a given endpoint which is exposed by a [RESTful API](https://en.wikipedia.org/wiki/Representational_state_transfer) of a device, an application, or a web service. The binary sensor has support for GET and POST requests.
The JSON messages can contain different values like `1`, `"1"`, `TRUE`, `true`, `on`, or `open`. If the value is nested then use a [template](/topics/templating/).
The JSON messages can contain different values like `1`, `"1"`, `TRUE`, `true`, `on`, or `open`. If the value is nested then use a [template](/docs/configuration/templating/#processing-incoming-data).
```json
{
@ -53,7 +53,7 @@ Configuration variables:
- **method** (*Optional*): The method of the request. Default is GET.
- **name** (*Optional*): Name of the REST binary sensor.
- **device_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value.
- **payload** (*Optional*): The payload to send with a POST request. Usually formed as a dictionary.
- **verify_ssl** (*Optional*): Verify the certification of the endpoint. Default to True.
- **authentication** (*Optional*): Type of the HTTP authentication. `basic` or `digest`.

View File

@ -36,6 +36,6 @@ Configuration options for the a TCP Sensor:
- **payload** (*Required*): What to send to the host in order to get the response we're interested in.
- **value_on** (*Required*): The value returned when the device is "on".
- **timeout** (*Optional*): How long in seconds to wait for a response from the service before giving up and disconnecting. Defaults to 10.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value. By default it's assumed that the entire response is the value.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value. By default it's assumed that the entire response is the value.
- **buffer_size** (*Optional*): The size of the receive buffer in bytes. Set this to a larger value if you expect to receive a response larger than the default. Defaults to 1024.

View File

@ -33,8 +33,8 @@ Configuration variables:
- **name** (*Optional*): This parameter allows you to override the name of your camera.
- **username** (*Optional*): The username for accessing your camera.
- **password** (*Optional*): The password for accessing your camera.
- **authentication** (*Optional*): `basic` (default) or `digest` auth for requests.
- **limit_refetch_to_url_change** (*Optional*): true/false value (default: false). Limits refetching of the remote image to when the url changes. Only relevant if using a template to fetch the remote image.
- **authentication** (*Optional*): Type for authenticating the requests `basic` (default) or `digest`.
- **limit_refetch_to_url_change** (*Optional*): True/false value (default: false). Limits refetching of the remote image to when the url changes. Only relevant if using a template to fetch the remote image.
<p class='img'>
<a href='/cookbook/google_maps_card/'>

View File

@ -30,4 +30,3 @@ Configuration variables:
- **topic** (*Required*): MQTT topic to subscribe to.
- **name** (*Optional*): Name of the camera

View File

@ -45,7 +45,7 @@ Configuration variables:
- **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is `true` if no state topic defined, else `false`.
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is `0`. Will also be used when publishing messages.
- **retain** (*Optional*): If the published message should have the retain flag on or not. Default is `false`.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
- **tilt_command_topic** (*Optional*): The MQTT topic to publish commands to control the cover tilt.
- **tilt_status_topic** (*Optional*): The MQTT topic subscribed to receive tilt status update values.
- **tilt_min** (*Optional*): The minimum tilt value. Default is `0`

View File

@ -32,8 +32,10 @@ Configuration variables:
- **qos** (*Optional*): The QoS level of the topic.
This platform receives JSON formatted payloads containing GPS information, for example:
```json
{"longitude": 1.0,"gps_accuracy": 60,"latitude": 2.0,"battery_level": 99.9}
```
Where `longitude` is the longitude, `latitude` is the latitude, `gps_accuracy` is the accuracy in meters, `battery_level` is the current battery level of the device sending the update.
`longitude` and `latitude` are required keys, `gps_accuracy` and `battery_level` are optional.

View File

@ -38,7 +38,7 @@ Configuration variables:
- **state_topic** (*Optional*): The MQTT topic subscribed to receive state updates.
- **payload_on** (*Optional*): The payload that represents the running state. Default is "ON".
- **payload_off** (*Optional*): The payload that represents the stop state. Default is "OFF".
- **state_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the state.
- **state_value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the state.
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
- **optimistic** (*Optional*): Flag that defines if lock works in optimistic mode. Default is `true` if no state topic defined, else `false`.
- **retain** (*Optional*): If the published message should have the retain flag on or not.
@ -46,13 +46,13 @@ Configuration variables:
- **oscillation_command_topic** (*Optional*): The MQTT topic to publish commands to change the oscillation state.
- **payload_oscillation_on** (*Optional*): The payload that represents the oscillation on state. Default is "oscillate_on".
- **payload_oscillation_off** (*Optional*): The payload that presents the oscillation off state. Default is "oscillate_off".
- **oscillation_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the oscillation.
- **oscillation_value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the oscillation.
- **speed_state_topic** (*Optional*): The MQTT topic subscribed to receive speed state updates.
- **speed_command_topic** (*Optional*): The MQTT topic to publish commands to change speed state.
- **payload_low_speed** (*Optional*): The payload that represents the fan's low speed.
- **payload_medium_speed** (*Optional*): The payload that represents the fan's medium speed.
- **payload_high_speed** (*Optional*): The payload that represents the fan's high speed.
- **speed_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the speed payload.
- **speed_value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the speed payload.
- **speeds** array (*Optional*): Valid entries for the list are `off`, `low`, `medium`, and `high`.
<p class='note warning'>

View File

@ -32,13 +32,13 @@ Configuration variables:
- **brightness_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's brightness.
- **brightness_scale** (*Optional*): Defines the maximum brightness value (i.e. 100%) of the MQTT device (defaults to 255).
- **brightness_state_topic** (*Optional*): The MQTT topic subscribed to receive brightness state updates.
- **brightness_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the brightness value.
- **color_temp_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's color temperature state. The color temperature command slider has a range of 157 to 500 mireds (micro reciprocal degrees).
- **brightness_value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the brightness value.
- **color_temp_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's color temperature state. The color temperature command slider has a range of 157 to 500 mireds (micro reciprocal degrees).
- **color_temp_state_topic** (*Optional*): The MQTT topic subscribed to receive color temperature state updates.
- **color_temp_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the color temperature value.
- **effect_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's effect state.
- **effect_state_topic** (*Optional*): The MQTT topic subscribed to receive effect state updates.
- **effect_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the effect value.
- **effect_value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the effect value.
- **effect_list** (*Optional*): The list of effects the light supports.
- **name** (*Optional*): The name of the switch. Default is 'MQTT Switch'.
- **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is true if no state topic defined, else false.
@ -48,15 +48,15 @@ Configuration variables:
- **retain** (*Optional*): If the published message should have the retain flag on or not.
- **rgb_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's RGB state.
- **rgb_state_topic** (*Optional*): The MQTT topic subscribed to receive RGB state updates.
- **rgb_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the RGB value.
- **rgb_value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the RGB value.
- **state_topic** (*Optional*): The MQTT topic subscribed to receive state updates.
- **state_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the state value.
- **state_value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the state value.
- **white_value_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's white value.
- **white_value_state_topic** (*Optional*): The MQTT topic subscribed to receive white value updates.
- **white_value_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the white value.
- **white_value_value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the white value.
- **xy_command_topic** (*Optional*): The MQTT topic to publish commands to change the light's XY state.
- **xy_state_topic** (*Optional*): The MQTT topic subscribed to receive XY state updates.
- **xy_value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the XY value.
- **xy_value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the XY value.
<p class='note warning'>
Make sure that your topics match exact. `some-topic/` and `some-topic` are different topics.
@ -114,16 +114,16 @@ To enable a light with brightness (no RGB version) in your installation, add the
```yaml
# Example configuration.yml entry
light:
platform: mqtt
name: "Office light"
state_topic: "office/rgb1/light/status"
command_topic: "office/rgb1/light/switch"
brightness_state_topic: 'office/rgb1/light/brightness'
brightness_command_topic: 'office/rgb1/light/brightness/set'
qos: 0
payload_on: "ON"
payload_off: "OFF"
optimistic: false
- platform: mqtt
name: "Office light"
state_topic: "office/rgb1/light/status"
command_topic: "office/rgb1/light/switch"
brightness_state_topic: 'office/rgb1/light/brightness'
brightness_command_topic: 'office/rgb1/light/brightness/set'
qos: 0
payload_on: "ON"
payload_off: "OFF"
optimistic: false
```
### {% linkable_title Implementations %}

View File

@ -39,16 +39,16 @@ Configuration variables:
- **effect_list** (*Optional*): List of possible effects.
- **command_topic** (*Required*): The MQTT topic to publish commands to change the light's state.
- **state_topic** (*Optional*): The MQTT topic subscribed to receive state updates.
- **command_on_template** (*Required*): The template for *on* state changes. Available variables: `state`, `brightness`, `red`, `green`, `blue`, `flash`, `transition` and `effect`.
- **command_off_template** (*Required*): The template for *off* state changes. Available variables: `state` and `transition`.
- **state_template** (*Optional*): Template to extract state from the state payload value.
- **brightness_template** (*Optional*): Template to extract brightness from the state payload value.
- **red_template** (*Optional*): Template to extract red color from the state payload value.
- **green_template** (*Optional*): Template to extract green color from the state payload value.
- **blue_template** (*Optional*): Template to extract blue color from the state payload value.
- **color_temp_template** (*Optional*): Template to extract color temperature from the state payload value.
- **effect_template** (*Optional*): Template to extract effect from the state payload value.
- **white_value_template** (*Optional*): Template to extract white value from the state payload value.
- **command_on_template** (*Required*): The [template](/docs/configuration/templating/#processing-incoming-data) for *on* state changes. Available variables: `state`, `brightness`, `red`, `green`, `blue`, `flash`, `transition` and `effect`.
- **command_off_template** (*Required*): The [template](/docs/configuration/templating/#processing-incoming-data) for *off* state changes. Available variables: `state` and `transition`.
- **state_template** (*Optional*): [Template](/docs/configuration/templating/#processing-incoming-data) to extract state from the state payload value.
- **brightness_template** (*Optional*): [Template](/docs/configuration/templating/#processing-incoming-data) to extract brightness from the state payload value.
- **red_template** (*Optional*): [Template](/docs/configuration/templating/#processing-incoming-data) to extract red color from the state payload value.
- **green_template** (*Optional*): [Template](/docs/configuration/templating/#processing-incoming-data) to extract green color from the state payload value.
- **blue_template** (*Optional*): [Template](/docs/configuration/templating/#processing-incoming-data) to extract blue color from the state payload value.
- **color_temp_template** (*Optional*): [Template](/docs/configuration/templating/#processing-incoming-data) to extract color temperature from the state payload value.
- **effect_template** (*Optional*): [Template](/docs/configuration/templating/#processing-incoming-data) to extract effect from the state payload value.
- **white_value_template** (*Optional*): [Template](/docs/configuration/templating/#processing-incoming-data) to extract white value from the state payload value.
- **optimistic** (*Optional*): Flag that defines if the light works in optimistic mode. Default is true if no state topic or state template is defined, else false.
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.

View File

@ -40,7 +40,7 @@ Configuration variables:
- **optimistic** (*Optional*): Flag that defines if lock works in optimistic mode. Default is `true` if no `state_topic` defined, else `false`.
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
- **retain** (*Optional*): If the published message should have the retain flag on or not.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
<p class='note warning'>
Make sure that your topic match exact. `some-topic/` and `some-topic` are different topics.
@ -57,16 +57,16 @@ The example below shows a full configuration for a MQTT lock.
```yaml
# Example configuration.yml entry
lock:
platform: mqtt
name: Frontdoor
state_topic: "home-assistant/frontdoor/"
command_topic: "home-assistant/frontdoor/set"
payload_lock: "LOCK"
payload_unlock: "UNLOCK"
optimistic: false
qos: 1
retain: true
value_template: '{% raw %}{{ value.x }}{% endraw %}'
- platform: mqtt
name: Frontdoor
state_topic: "home-assistant/frontdoor/"
command_topic: "home-assistant/frontdoor/set"
payload_lock: "LOCK"
payload_unlock: "UNLOCK"
optimistic: false
qos: 1
retain: true
value_template: '{% raw %}{{ value.x }}{% endraw %}'
```
Keep an eye on retaining messages to keep the state as you don't want to unlock your door by accident when you restart something.

View File

@ -20,7 +20,7 @@ The MQTT notification support is different than the other [notification](/compon
```
<p class='img'>
<img src='/images/screenshots/mqtt-notify.png' />
<img src='/images/screenshots/mqtt-notify.png' />
</p>
Using the [REST API](/developers/rest_api/#post-apiservicesltdomainltservice) to send a message to a given topic.

View File

@ -39,12 +39,12 @@ Configuration variables:
- **[variable]** (*Required*): Name of the variable to monitor.
- **name** (*Optional*): The name to use for the frontend.
- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
- **pins** array (*Optional*): List of pins to monitor. Analog pins need a leading **A** for the pin number.
- **[pin]** (*Required*): Pin number to use.
- **name** (*Required*): The name of the variable you wish to monitor.
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
The variables in the `monitored_variables` array must be available in the response of the device. As a starting point you could use the one of the example sketches (eg. [Ethernet](https://raw.githubusercontent.com/marcoschwartz/aREST/master/examples/Ethernet/Ethernet.ino) for an Arduino with Ethernet shield). In those sketches are two variables (`temperature` and `humidity`) available which will act as endpoints.

View File

@ -30,8 +30,8 @@ Configuration variables:
- **command** (*Required*): The action to take to get the value.
- **name** (*Optional*): Name of the command sensor.
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **scan_interval** (*Optional*): Defines number of seconds for polling interval
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
- **scan_interval** (*Optional*): Defines number of seconds for polling interval.
## {% linkable_title Examples %}

View File

@ -35,7 +35,7 @@ sensor:
- **include_only_feed_id** (*Optional*): Positive integer list of Emoncms feed IDs. Only the feeds with feed IDs specified here will be displayed. Can not be specified if `exclude_feed_id` is specified.
- **exclude_feed_id** (*Optional*): Positive integer list of Emoncms feed IDs. All the feeds will be displayed as sensors except the ones listed here. Can not be specified if `include_only_feed_id` is specified.
- **sensor_names** (*Optional*): Dictionary of names for the sensors created that are created based on feed ID. The dictionary consists of `feedid: name` pairs. Sensors for feeds with their feed ID mentioned here will get the chosen name instead of the default name
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to alter the feed value.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to alter the feed value.
- **scan_interval** (*Optional*): Defines the update interval of the sensor in seconds.
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of for all the sensors. default is "W".

View File

@ -30,7 +30,7 @@ Configuration variables:
- **file_path** (*Required*): path to file that stores the sensor data.
- **name** (*Optional*): Name of the sensor to use in the frontend. Defaults to `File`.
- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
## {% linkable_title Examples %}

View File

@ -50,11 +50,10 @@ Configuration variables:
- **duration**: Duration of the measure
<p class='note'>
You have to provide **exactly 2** of `start`, `end` and `duration`.
You have to provide **exactly 2** of `start`, `end` and `duration`.
<br/>
You can use [template extensions](/topics/templating/#home-assistant-template-extensions) such as `now()` or `as_timestamp()` to handle dynamic dates, as shown in the examples below.
You can use [template extensions](/topics/templating/#home-assistant-template-extensions) such as `now()` or `as_timestamp()` to handle dynamic dates, as shown in the examples below.
</p>
## {% linkable_title Sensor type %}
@ -102,12 +101,14 @@ duration:
Here are some examples of periods you could work with, and what to write in your `configuration.yaml`:
**Today**: starts at 00:00 of the current day and ends right now.
```yaml
start: '{% raw %}{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}{% endraw %}'
end: '{% raw %}{{ now() }}{% endraw %}'
```
**Yesterday**: ends today at 00:00, lasts 24 hours.
```yaml
end: '{% raw %}{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}{% endraw %}'
duration:
@ -115,6 +116,7 @@ Here are some examples of periods you could work with, and what to write in your
```
**This morning (6AM - 11AM)**: starts today at 6, lasts 5 hours.
```yaml
start: '{% raw %}{{ now().replace(hour=6).replace(minute=0).replace(second=0) }}{% endraw %}'
duration:
@ -130,6 +132,7 @@ Here, last Monday is _today_ as a timestamp, minus 86400 times the current weekd
```
**Last 30 days**: ends today at 00:00, lasts 30 days. Easy one.
```yaml
end: '{% raw %}{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}{% endraw %}'
duration:
@ -137,11 +140,12 @@ Here, last Monday is _today_ as a timestamp, minus 86400 times the current weekd
```
**All your history** starts at timestamp = 0, and ends right now.
```yaml
start: '{% raw %}{{ 0 }}{% endraw %}'
end: '{% raw %}{{ now() }}{% endraw %}'
```
<p class='note'>
If you want to check if your period is right, just click on your component, the `from` and `to` attributes will show the start and end of the period, nicely formatted.
If you want to check if your period is right, just click on your component, the `from` and `to` attributes will show the start and end of the period, nicely formatted.
</p>

View File

@ -40,7 +40,7 @@ Configuration variables for the server:
- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.
- **measurement** (*Required*): Defines the measurement name in InfluxDB (the from clause of the query).
- **where** (*Required*): Defines the data selection clause (the where clause of the query).
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
- **database** (*Optional*): Name of the database to use. Defaults to `home_assistant`.
- **group_function** (*Optional*): The group function to be used. Defaults to `mean`.
- **field** (*Optional*): The field name to select. Defaults to value.

View File

@ -32,7 +32,7 @@ Configuration variables:
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0.
- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.
- **expire_after** (*Optional*): Defines the number of seconds after the value expires if it's not updated. Default is 0 (=never expire).
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
## {% linkable_title Examples %}

View File

@ -39,7 +39,7 @@ Configuration variables:
- **resource** (*Required*): The resource or endpoint that contains the value.
- **method** (*Optional*): The method of the request. Default is `GET`.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value.
- **payload** (*Optional*): The payload to send with a POST request. Depends on the service, but usually formed as JSON.
- **name** (*Optional*): Name of the REST sensor.
- **unit_of_measurement** (*Optional*): Defines the unit of measurement of the sensor, if any.

View File

@ -32,7 +32,7 @@ Configuration options for the a TCP Sensor:
- **port** (*Required*): The port to connect to the host on.
- **payload** (*Required*): What to send to the host in order to get the response we're interested in.
- **timeout** (*Optional*): How long in seconds to wait for a response from the service before giving up and disconnecting. Defaults to `10`
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract the value. By default it's assumed that the entire response is the value.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value. By default it's assumed that the entire response is the value.
- **unit_of_measurement** (*Optional*): The unit of measurement to use for the value.
- **buffer_size** (*Optional*): The size of the receive buffer in bytes. Set this to a larger value if you expect to receive a response larger than the default. Defaults to `1024`.

View File

@ -35,7 +35,7 @@ Configuration variables:
- **sensors** array (*Required*): List of your sensors.
- **friendly_name** (*Optional*): Name to use in the Frontend.
- **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any.
- **value_template** (*Required*): Defines a [template](/topics/templating/) to extract a value from the event bus.
- **value_template** (*Required*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the event bus.
- **icon_template** (*Optional*): Defines a [template](/topics/templating/) for the icon of the sensor.
- **entity_id** (*Optional*): Add a list of entity IDs so the sensor only reacts to state changes of these entities. This will reduce the number of times the sensor will try to update it's state.

View File

@ -40,7 +40,7 @@ Configuration variables:
- **optimistic** (*Optional*): Flag that defines if switch works in optimistic mode. Default is `true` if no `state_topic` defined, else `false`.
- **qos** (*Optional*): The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages.
- **retain** (*Optional*): If the published message should have the retain flag on or not.
- **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload.
- **value_template** (*Optional*): Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload.
<p class='note warning'>
Make sure that your topic match exact. `some-topic/` and `some-topic` are different topics.

View File

@ -30,7 +30,7 @@ Configuration variables:
- **name** (*Optional*): Name of the REST switch.
- **body_on** (*Optional*): The body of the POST request that commands the switch to become enabled. Default is "ON". This value can be a [template](/topics/templating/).
- **body_off** (*Optional*): The body of the POST request that commands the switch to become disabled. Default is "OFF". This value can also be a [template](/topics/templating/).
- **is_on_template** (*Optional*): A [template](/topics/templating/) that determines the state of the switch from the value returned by the GET request on the resource URL. This template should compute to a boolean (True or False). If the value is valid JSON, it will be available in the template as the variable `value_json`. See [this example](/docs/configuration/templating/#processing-incoming-data) in the template documentation. Default is equivalent to `'{% raw %}{{ value_json == body_on }}{% endraw %}'`. This means that by default, the state of the switch is on if and only if the response to the GET request matches .
- **is_on_template** (*Optional*): A [template](/docs/configuration/templating/#processing-incoming-data) that determines the state of the switch from the value returned by the GET request on the resource URL. This template should compute to a boolean (True or False). If the value is valid JSON, it will be available in the template as the variable `value_json`. Default is equivalent to `'{% raw %}{{ value_json == body_on }}{% endraw %}'`. This means that by default, the state of the switch is on if and only if the response to the GET request matches .
<p class='note warning'>
Make sure that the URL matches exactly your endpoint or resource.