File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
config/blueprints/template/homeassistant Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ blueprint :
2+ name : Invert a binary sensor
3+ description : Creates a binary_sensor which holds the inverted value of a reference binary_sensor
4+ domain : template
5+ source_url : https://github.com/home-assistant/core/blob/dev/homeassistant/components/template/blueprints/inverted_binary_sensor.yaml
6+ input :
7+ reference_entity :
8+ name : Binary sensor to be inverted
9+ description : The binary_sensor which needs to have its value inverted
10+ selector :
11+ entity :
12+ domain : binary_sensor
13+ variables :
14+ reference_entity : !input reference_entity
15+ binary_sensor :
16+ state : >
17+ {% if states(reference_entity) == 'on' %}
18+ off
19+ {% elif states(reference_entity) == 'off' %}
20+ on
21+ {% else %}
22+ {{ states(reference_entity) }}
23+ {% endif %}
24+ # delay_on: not_used in this example
25+ # delay_off: not_used in this example
26+ # auto_off: not_used in this example
27+ availability : " {{ states(reference_entity) not in ('unknown', 'unavailable') }}"
You can’t perform that action at this time.
0 commit comments