diff --git a/source/_components/binary_sensor.template.markdown b/source/_components/binary_sensor.template.markdown index 03af11a3a0a..3fd245870a7 100644 --- a/source/_components/binary_sensor.template.markdown +++ b/source/_components/binary_sensor.template.markdown @@ -30,6 +30,7 @@ Configuration variables: - **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. - **value_template** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. + - **warnings** (*Optional*): Turn off warnings (useful if the sensor is loaded before devices it depends on). ## {% linkable_title Examples %} @@ -44,7 +45,7 @@ sensor: platform: template sensors: furnace_on: - value_template: {{ states.sensor.furnace.state > 2.5 }} + value_template: {% raw %}`{{ states.sensor.furnace.state > 2.5 }}`{% endraw %} friendly_name: 'Furnace Running sensor_class: heat ``` diff --git a/source/_components/sensor.template.markdown b/source/_components/sensor.template.markdown index 956d276aca9..ca42bcaf90f 100644 --- a/source/_components/sensor.template.markdown +++ b/source/_components/sensor.template.markdown @@ -34,6 +34,7 @@ Configuration variables: - **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** (*Optional*): Defines a [template](/topics/templating/) to extract a value from the payload. + - **warnings** (*Optional*): Turn off warnings (useful if the sensor is loaded before devices it depends on). ## {% linkable_title Examples %} @@ -54,9 +55,9 @@ sensor: unit_of_measurement: '°' ``` -### {% linkable_title Multi line example with an if test %} +### {% linkable_title Multi line example with an if test (and warnings disabled)%} -This example shows a multiple line template with and is test. It looks at a sensing switch and shows on/off in the frontend. +This example shows a multiple line template with and if test. It looks at a sensing switch and shows on/off in the frontend. It disables warnings to avoid log messages where the switch it depends on isn't loaded yet. ```yaml sensor: @@ -75,6 +76,7 @@ sensor: failed {%- endif %}{% endraw %} + warnings: Off ``` (please note the blank line to close the multi-line template)