diff --git a/source/_components/binary_sensor.trend.markdown b/source/_components/binary_sensor.trend.markdown new file mode 100644 index 00000000000..739ce499770 --- /dev/null +++ b/source/_components/binary_sensor.trend.markdown @@ -0,0 +1,72 @@ +--- +layout: page +title: "Trend Binary Sensor" +description: "Instructions how to integrate Trend binary sensors into Home Assistant." +date: 2016-09-05 10:00 +sidebar: true +comments: false +sharing: true +footer: true +ha_category: Binary Sensor +logo: home-assistant.png +--- + +The `trend` platform allows you to create sensors which show the trend of numeric `state` or`state_attributes` from other entities. + +This sensor requires two updates of the underlying sensor to establish a trend - so it can take some time to show an accurate state. + +It can be useful as part of automations, where you want to base an action on a trend. + +To enable Trend binary sensors in your installation, add the following to your `configuration.yaml` file: + +```yaml +# Example configuration.yaml entry +binary_sensor: + - platform: trend + sensors: + solar_angle: + friendly_name: 'Sun rising' + entity_id: sun.sun + sensor_class: light + attribute: elevation +``` + +Configuration variables: + +- **sensors** array (*Required*): List of your sensors. + - **friendly_name** (*Optional*): Name to use in the Frontend. + - **sensor_class** (*Optional*): The [type/class](/components/binary_sensor/) of the sensor to set the icon in the frontend. + - **entity_id** (*Required*): The entity that this sensor tracks. + - **attribute** (*Optional*): The attribute of the entity that this sensor tracks. If no attribute is specified - the sensor will track the state. + - **invert** (*Optional*): Invert the result (so `true` means decending rather than ascending) + +## {% linkable_title Examples %} + +In this section you find some real life examples of how to use this sensor. + +### {% linkable_title Temperature trend %} + +This example indicates true if the temperture is rising: + +```yaml +binary_sensor: + - platform: trend + sensors: + temperature_up: + friendly_name: 'Temp increasing' + entity_id: sensor.skylight_temperature + sensor_class: heat +``` + +And this one indicates true if the temperture is falling: + +```yaml +binary_sensor: + - platform: trend + sensors: + temperature_down: + friendly_name: 'Temp decreasing' + entity_id: sensor.skylight_temperature + sensor_class: cold + invert: Yes +```