Skip to content

Commit

Permalink
Merge branch 'current' into next
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Mar 2, 2020
2 parents 1e1d8ab + 5b31189 commit f9e120f
Show file tree
Hide file tree
Showing 58 changed files with 1,460 additions and 1,138 deletions.
4 changes: 2 additions & 2 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@ social:
# Home Assistant release details
current_major_version: 0
current_minor_version: 106
current_patch_version: 0
date_released: 2020-02-26
current_patch_version: 2
date_released: 2020-02-28

# Either # or the anchor link to latest release notes in the blog post.
# Must be prefixed with a # and have double quotes around it.
Expand Down
2 changes: 1 addition & 1 deletion source/_docs/configuration/templating.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Extensions allow templates to access all of the Home Assistant specific states a
- `states('device_tracker.paulus')` will return the state string (not the object) of the given entity or `unknown` if it doesn't exist.
- `is_state('device_tracker.paulus', 'home')` will test if the given entity is the specified state.
- `state_attr('device_tracker.paulus', 'battery')` will return the value of the attribute or None if it doesn't exist.
- `is_state_attr('device_tracker.paulus', 'battery', 40)` will test if the given entity attribute is the specified state (in this case, a numeric value).
- `is_state_attr('device_tracker.paulus', 'battery', 40)` will test if the given entity attribute is the specified state (in this case, a numeric value). Note that the attribute can be `None` and you want to check if it is `None`, you need to use `state_attr('sensor.my_sensor', 'attr') == None`.

<div class='note warning'>

Expand Down
1 change: 1 addition & 0 deletions source/_docs/mqtt/discovery.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Supported by MQTT discovery:
- [Binary sensors](/integrations/binary_sensor.mqtt/)
- [Cameras](/integrations/camera.mqtt/)
- [Covers](/integrations/cover.mqtt/)
- [Device Triggers](/integrations/device_trigger.mqtt/)
- [Fans](/integrations/fan.mqtt/)
- [HVACs](/integrations/climate.mqtt/)
- [Lights](/integrations/light.mqtt/)
Expand Down
2 changes: 1 addition & 1 deletion source/_docs/scripts/conditions.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ A better weekday condition could be by using the [Workday Binary Sensor](/integr

### Zone condition

Zone conditions test if an entity is in a certain zone. For zone automation to work, you need to have set up a device tracker platform that supports reporting GPS coordinates. Currently this is limited to the [OwnTracks platform](/integrations/owntracks/) and the [iCloud platform](/integrations/icloud/).
Zone conditions test if an entity is in a certain zone. For zone automation to work, you need to have set up a device tracker platform that supports reporting GPS coordinates.

```yaml
condition:
Expand Down
144 changes: 72 additions & 72 deletions source/_integrations/alarm_control_panel.mqtt.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -34,57 +34,10 @@ alarm_control_panel:
```
{% configuration %}
name:
description: The name of the alarm.
required: false
type: string
default: MQTT Alarm
unique_id:
description: An ID that uniquely identifies this alarm panel. If two alarm panels have the same unique ID, Home Assistant will raise an exception.
required: false
type: string
state_topic:
description: The MQTT topic subscribed to receive state updates.
required: true
type: string
command_topic:
description: The MQTT topic to publish commands to change the alarm state.
required: true
type: string
command_template:
description: "The [template](/docs/configuration/templating/#processing-incoming-data) used for the command payload. Available variables: `action` and `code`."
required: false
type: string
default: action
value_template:
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value."
required: false
type: template
qos:
description: The maximum QoS level of the state topic.
required: false
type: integer
default: 0
payload_disarm:
description: The payload to disarm your Alarm Panel.
required: false
type: string
default: DISARM
payload_arm_home:
description: The payload to set armed-home mode on your Alarm Panel.
required: false
type: string
default: ARM_HOME
payload_arm_away:
description: The payload to set armed-away mode on your Alarm Panel.
required: false
type: string
default: ARM_AWAY
payload_arm_night:
description: The payload to set armed-night mode on your Alarm Panel.
availability_topic:
description: The MQTT topic subscribed to receive availability (online/offline) updates.
required: false
type: string
default: ARM_NIGHT
code:
description: If defined, specifies a code to enable or disable the alarm in the frontend.
required: false
Expand All @@ -99,41 +52,28 @@ code_disarm_required:
required: false
type: boolean
default: true
availability_topic:
description: The MQTT topic subscribed to receive availability (online/offline) updates.
required: false
type: string
payload_available:
description: The payload that represents the available state.
required: false
type: string
default: online
payload_not_available:
description: The payload that represents the unavailable state.
command_template:
description: "The [template](/docs/configuration/templating/#processing-incoming-data) used for the command payload. Available variables: `action` and `code`."
required: false
type: string
default: offline
json_attributes_topic:
description: The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation.
required: false
default: action
command_topic:
description: The MQTT topic to publish commands to change the alarm state.
required: true
type: string
json_attributes_template:
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
required: false
type: template
device:
description: 'Information about the device this alarm panel is a part of to tie it into the [device registry](https://developers.home-assistant.io/docs/en/device_registry_index.html). Only works through [MQTT discovery](/docs/mqtt/discovery/) and when [`unique_id`](#unique_id) is set.'
required: false
type: map
keys:
identifiers:
description: 'A list of IDs that uniquely identify the device. For example a serial number.'
required: false
type: [list, string]
connections:
description: 'A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `"connections": [["mac", "02:5b:26:a8:dc:12"]]`.'
required: false
type: list
identifiers:
description: 'A list of IDs that uniquely identify the device. For example a serial number.'
required: false
type: [list, string]
manufacturer:
description: 'The manufacturer of the device.'
required: false
Expand All @@ -150,4 +90,64 @@ device:
description: 'The firmware version of the device.'
required: false
type: string
json_attributes_template:
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
required: false
type: template
json_attributes_topic:
description: The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation.
required: false
type: string
name:
description: The name of the alarm.
required: false
type: string
default: MQTT Alarm
payload_arm_away:
description: The payload to set armed-away mode on your Alarm Panel.
required: false
type: string
default: ARM_AWAY
payload_arm_home:
description: The payload to set armed-home mode on your Alarm Panel.
required: false
type: string
default: ARM_HOME
payload_arm_night:
description: The payload to set armed-night mode on your Alarm Panel.
required: false
type: string
default: ARM_NIGHT
payload_available:
description: The payload that represents the available state.
required: false
type: string
default: online
payload_disarm:
description: The payload to disarm your Alarm Panel.
required: false
type: string
default: DISARM
payload_not_available:
description: The payload that represents the unavailable state.
required: false
type: string
default: offline
qos:
description: The maximum QoS level of the state topic.
required: false
type: integer
default: 0
state_topic:
description: The MQTT topic subscribed to receive state updates.
required: true
type: string
unique_id:
description: An ID that uniquely identifies this alarm panel. If two alarm panels have the same unique ID, Home Assistant will raise an exception.
required: false
type: string
value_template:
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the value."
required: false
type: template
{% endconfiguration %}
134 changes: 68 additions & 66 deletions source/_integrations/binary_sensor.mqtt.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ The binary sensor state will be updated only after a new message is published on
the binary sensor will receive an instant state update after subscription and Home Assistant will display the correct state on startup.
Otherwise, the initial state displayed in Home Assistant will be `unknown`.

Stateless devices such as buttons, remote controls etc are better represented by [MQTT device triggers](/integrations/device_trigger.mqtt/) than by binary sensors.

## Configuration

The `mqtt` binary sensor platform optionally supports an `availability_topic` to receive online and offline messages (birth and LWT messages) from the MQTT device. During normal operation, if the MQTT sensor device goes offline (i.e., publishes `payload_not_available` to `availability_topic`), Home Assistant will display the binary sensor as `unavailable`. If these messages are published with the `retain` flag set, the binary sensor will receive an instant update after subscription and Home Assistant will display the correct availability state of the binary sensor when Home Assistant starts up. If the `retain` flag is not set, Home Assistant will display the binary sensor as `unavailable` when Home Assistant starts up. If no `availability_topic`
Expand All @@ -30,29 +32,69 @@ binary_sensor:
```
{% configuration %}
state_topic:
description: The MQTT topic subscribed to receive sensor values.
required: true
type: string
name:
description: The name of the binary sensor.
availability_topic:
description: "The MQTT topic subscribed to receive birth and LWT messages from the MQTT device. If `availability_topic` is not defined, the binary sensor availability state will always be `available`. If `availability_topic` is defined, the binary sensor availability state will be `unavailable` by default."
required: false
type: string
default: MQTT Binary Sensor
payload_on:
description: The payload that represents the on state.
device:
description: "Information about the device this binary sensor is a part of to tie it into the [device registry](https://developers.home-assistant.io/docs/en/device_registry_index.html). Only works through [MQTT discovery](/docs/mqtt/discovery/) and when [`unique_id`](#unique_id) is set."
required: false
type: map
keys:
connections:
description: "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `'connections': ['mac', '02:5b:26:a8:dc:12']`."
required: false
type: [list, map]
identifiers:
description: A list of IDs that uniquely identify the device. For example a serial number.
required: false
type: [list, string]
manufacturer:
description: The manufacturer of the device.
required: false
type: string
model:
description: The model of the device.
required: false
type: string
name:
description: The name of the device.
required: false
type: string
sw_version:
description: The firmware version of the device.
required: false
type: string
device_class:
description: Sets the [class of the device](/integrations/binary_sensor/#device-class), changing the device state and icon that is displayed on the frontend.
required: false
type: string
default: "ON"
payload_off:
description: The payload that represents the off state.
expire_after:
description: "Defines the number of seconds after the value expires if it's not updated. After expiry, the value is cleared, and the availability is set to false"
required: false
type: integer
force_update:
description: Sends update events even if the value hasn't changed. Useful if you want to have meaningful value graphs in history.
required: false
type: boolean
default: false
json_attributes_template:
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
required: false
type: template
json_attributes_topic:
description: The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation.
required: false
type: string
default: "OFF"
availability_topic:
description: "The MQTT topic subscribed to receive birth and LWT messages from the MQTT device. If `availability_topic` is not defined, the binary sensor availability state will always be `available`. If `availability_topic` is defined, the binary sensor availability state will be `unavailable` by default."
name:
description: The name of the binary sensor.
required: false
type: string
default: MQTT Binary Sensor
off_delay:
description: "For sensors that only sends `On` state updates, this variable sets a delay in seconds after which the sensor state will be updated back to `Off`."
required: false
type: integer
payload_available:
description: The payload that represents the online state.
required: false
Expand All @@ -63,73 +105,33 @@ payload_not_available:
required: false
type: string
default: offline
json_attributes_topic:
description: The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation.
payload_off:
description: The payload that represents the off state.
required: false
type: string
json_attributes_template:
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
default: "OFF"
payload_on:
description: The payload that represents the on state.
required: false
type: template
type: string
default: "ON"
qos:
description: The maximum QoS level to be used when receiving messages.
required: false
type: integer
default: 0
state_topic:
description: The MQTT topic subscribed to receive sensor values.
required: true
type: string
unique_id:
description: An ID that uniquely identifies this sensor. If two sensors have the same unique ID, Home Assistant will raise an exception.
required: false
type: string
device_class:
description: Sets the [class of the device](/integrations/binary_sensor/#device-class), changing the device state and icon that is displayed on the frontend.
required: false
type: string
expire_after:
description: "Defines the number of seconds after the value expires if it's not updated. After expiry, the value is cleared, and the availability is set to false"
required: false
type: integer
value_template:
description: "Defines a [template](/docs/configuration/templating/#processing-incoming-data) to extract a value from the payload. Available variables: `entity_id`. Remove this option when 'payload_on' and 'payload_off' are sufficient to match your payloads."
required: false
type: string
force_update:
description: Sends update events even if the value hasn't changed. Useful if you want to have meaningful value graphs in history.
required: false
type: boolean
default: false
off_delay:
description: "For sensors that only sends `On` state updates, this variable sets a delay in seconds after which the sensor state will be updated back to `Off`."
required: false
type: integer
device:
description: "Information about the device this binary sensor is a part of to tie it into the [device registry](https://developers.home-assistant.io/docs/en/device_registry_index.html). Only works through [MQTT discovery](/docs/mqtt/discovery/) and when [`unique_id`](#unique_id) is set."
required: false
type: map
keys:
identifiers:
description: A list of IDs that uniquely identify the device. For example a serial number.
required: false
type: [list, string]
connections:
description: "A list of connections of the device to the outside world as a list of tuples `[connection_type, connection_identifier]`. For example the MAC address of a network interface: `'connections': ['mac', '02:5b:26:a8:dc:12']`."
required: false
type: [list, map]
manufacturer:
description: The manufacturer of the device.
required: false
type: string
model:
description: The model of the device.
required: false
type: string
name:
description: The name of the device.
required: false
type: string
sw_version:
description: The firmware version of the device.
required: false
type: string
{% endconfiguration %}

## Examples
Expand Down
Loading

0 comments on commit f9e120f

Please sign in to comment.