Add example to binary_sensor.template (#512)

This commit is contained in:
Daniel Høyer Iversen 2016-05-25 16:07:48 +02:00 committed by Fabian Affolter
parent 5088f68991
commit ec4cf16cf5

View File

@ -48,3 +48,20 @@ sensor:
friendly_name: 'Furnace Running friendly_name: 'Furnace Running
sensor_class: heat 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
```