Compare commits

..

2 Commits

2 changed files with 31 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
blueprint:
name: Invert a binary sensor
description: Creates a binary_sensor which holds the inverted value of a reference binary_sensor
domain: template
source_url: https://github.com/home-assistant/core/blob/dev/homeassistant/components/template/blueprints/inverted_binary_sensor.yaml
input:
reference_entity:
name: Binary sensor to be inverted
description: The binary_sensor which needs to have its value inverted
selector:
entity:
domain: binary_sensor
variables:
reference_entity: !input reference_entity
binary_sensor:
state: >
{% if states(reference_entity) == 'on' %}
off
{% elif states(reference_entity) == 'off' %}
on
{% else %}
{{ states(reference_entity) }}
{% endif %}
# delay_on: not_used in this example
# delay_off: not_used in this example
# auto_off: not_used in this example
availability: "{{ states(reference_entity) not in ('unknown', 'unavailable') }}"

View File

@@ -1,13 +1,13 @@
<svg width="68.5" height="20" viewBox="0 0 685 200" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="2025.12.1">
<title>2025.12.1</title>
<linearGradient id="zywbv" x2="0" y2="100%">
<linearGradient id="GGkaK" x2="0" y2="100%">
<stop offset="0" stop-opacity=".1" stop-color="#EEE"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<mask id="mlBIM"><rect width="685" height="200" rx="30" fill="#FFF"/></mask>
<g mask="url(#mlBIM)">
<mask id="wwoCE"><rect width="685" height="200" rx="30" fill="#FFF"/></mask>
<g mask="url(#wwoCE)">
<rect width="685" height="200" fill="#08C" x="0"/>
<rect width="685" height="200" fill="url(#zywbv)"/>
<rect width="685" height="200" fill="url(#GGkaK)"/>
</g>
<g aria-hidden="true" fill="#fff" text-anchor="start" font-family="Verdana,DejaVu Sans,sans-serif" font-size="110">
<text x="65" y="148" textLength="570" fill="#000" opacity="0.25">2025.12.1</text>

Before

Width:  |  Height:  |  Size: 815 B

After

Width:  |  Height:  |  Size: 815 B