home-assistant.io/source/_components/binary_sensor.trend.markdown
2017-02-10 19:10:24 -05:00

2.2 KiB

layout, title, description, date, sidebar, comments, sharing, footer, ha_category, logo, ha_release, ha_iot_class
layout title description date sidebar comments sharing footer ha_category logo ha_release ha_iot_class
page Trend Binary Sensor Instructions how to integrate Trend binary sensors into Home Assistant. 2016-09-05 10:00 true false true true Binary Sensor home-assistant.png 0.28 Local Push

The trend platform allows you to create sensors which show the trend of numeric state orstate_attributes from other entities. This sensor requires two updates of the underlying sensor to establish a trend. Thus 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:

# Example configuration.yaml entry
binary_sensor:
  - platform: trend
    sensors:
      solar_angle:
        entity_id: sun.sun

Configuration variables:

  • sensors array (Required): List of your sensors.
    • friendly_name (Optional): Name to use in the Frontend.
    • device_class (Optional): The type/class 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 then the sensor will track the state.
    • invert (Optional): Invert the result (so true means descending 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 temperature is rising:

binary_sensor:
  - platform: trend
    sensors:
      temperature_up:
        friendly_name: 'Temp increasing'
        entity_id: sensor.skylight_temperature
        device_class: heat

And this one indicates true if the temperature is falling:

binary_sensor:
  - platform: trend
    sensors:
      temperature_down:
        friendly_name: 'Temp decreasing'
        entity_id: sensor.skylight_temperature
        device_class: cold
        invert: Yes