From a719fb843a8db0c1fef46a02eac044f2bd90835a Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Fri, 29 Jan 2016 11:14:34 +0100 Subject: [PATCH] Add example (thanks @pavoni) --- source/_components/sensor.template.markdown | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/source/_components/sensor.template.markdown b/source/_components/sensor.template.markdown index 094492e2771..f4533c3b3d9 100644 --- a/source/_components/sensor.template.markdown +++ b/source/_components/sensor.template.markdown @@ -34,3 +34,24 @@ Configuration variables: - **unit_of_measurement** (*Optional*): Defines the units of measurement of the sensor, if any. - **value_template** (*Optional*): Defines a [template](/getting-started/templating/) to extract a value from the payload. + +## {% linkable_title Examples %} + +In this section you find some real life examples of how to use this sensor. + +### {% linkable_title Sun angle %} + +This example shows the sun angle in the forntend. + +```yaml +sensor: + platform: template + sensors: + solar_angle: + value_template: '{{ "%+.1f"|format(states.sun.sun.attributes.elevation) }}' + friendly_name: 'Sun Angle' + unit_of_measurement: '°' +``` + + +