Skip to content

Commit ec4cf16

Browse files
Danielhiversenfabaff
authored andcommitted
Add example to binary_sensor.template (home-assistant#512)
1 parent 5088f68 commit ec4cf16

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

source/_components/binary_sensor.template.markdown

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,20 @@ sensor:
4848
friendly_name: 'Furnace Running
4949
sensor_class: heat
5050
```
51+
52+
53+
### {% linkable_title Switch as sensor %}
54+
55+
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/)
56+
57+
```yaml
58+
binary_sensor:
59+
platform: template
60+
sensors:
61+
movement:
62+
value_template: "{{ states.switch.movement.state == 'on' }}"
63+
sensor_class: motion
64+
door:
65+
value_template: "{{ states.switch.door.state == 'on' }}"
66+
sensor_class: opening
67+
```

0 commit comments

Comments
 (0)