Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 117789

Change the state or ICON of a binary sensor for tilt

$
0
0

@jlvandusen wrote:

I have a tilt sensor that I am using to track if the garage door is open or closed…
Its name is:
binary_sensor.ecolink_garage_door_tilt_sensor_sensor

It currently is on (open) or off (closed)
How can I change its icon to show mdi:garage for closed and mdi-garage-open for when its open and change its results to be the same?

I tried creating a template to a fake garage_door entity but that didnt work

- platform: template
  sensors:
    garage_door:
      entity_id:
        - binary_sensor.ecolink_garage_door_tilt_sensor_sensor
      value_template: >-
        {{ is_state("binary_sensor.ecolink_garage_door_tilt_sensor_sensor") }}
      icon_template: >-
        {% if is_state("binary_sensor.ecolink_garage_door_tilt_sensor_sensor", "on") %}
          mdi:garage-open
        {% else %}
          mdi:garage
        {% endif %}

Posts: 6

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 117789

Trending Articles