From ec4cf16cf571af7b913e7111a9ad462284ac8c98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Wed, 25 May 2016 16:07:48 +0200 Subject: [PATCH] Add example to binary_sensor.template (#512) --- .../_components/binary_sensor.template.markdown | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/source/_components/binary_sensor.template.markdown b/source/_components/binary_sensor.template.markdown index 03af11a3a0a..65075fef314 100644 --- a/source/_components/binary_sensor.template.markdown +++ b/source/_components/binary_sensor.template.markdown @@ -48,3 +48,20 @@ sensor: friendly_name: 'Furnace Running sensor_class: heat ``` + + +### {% linkable_title Switch as sensor %} + +Some movement sensors and door/window sensors will apear as a switch. By using a template binary sensor, the switch can be displayed as a binary sensors. The original switch can then be hidden by [customizing.](/getting-started/customizing-devices/) + +```yaml +binary_sensor: + platform: template + sensors: + movement: + value_template: "{{ states.switch.movement.state == 'on' }}" + sensor_class: motion + door: + value_template: "{{ states.switch.door.state == 'on' }}" + sensor_class: opening +```