Aqara window sensor displays `on` instead of `Open`

Hi there,

On my lovelace UI, there are two things that I’d like to change:

  1. For the device_tracker it displays home or not_home. I would like it to show Home and Not Home in the selected language (currently it’s the same for all languages)
    13_14h15m41s_004_
  2. My xiaomi aqara door/window sensors show me on and off instead of Open and Closed.
    13_14h16m44s_005_
    In the detailed view it shows me the history of open and closed, but the status is on.
    13_14h17m10s_006_

How can I change the sensors to show the right value?

You need to customize the entity with an opening device class. When the entity is ‘on’ it will show as open and vice-versa.

Look under DEVICE CLASS

Hi,
Good question!
You could use a template to create new sensors of each sensor for which you like to change the state names, see my example below:

sensor:
  - platform: template
    sensors:
      wall_switch_left:
        value_template: >-
          {% if is_state('binary_sensor.wall_switch_left_158d00027c19e9','off') %}
             SOMETHING
          {% else %} 
             SOMETHINGSELSE
          {% endif %}
      wall_switch_right:
        value_template: >-
          {% if is_state('binary_sensor.wall_switch_right_158d00027c19e9','on') %}
             SOMETHING
          {% else %}
              SOMETHINGSELSE
          {% endif %}

My initial binary sensors (binary_sensor.wall_switch_left_158d00027c19e9 and binary_sensor.wall_switch_rigth_158d00027c19e9) have either the state on or off.

The template creates two new sensors (wall_switch_left and wall_switch_right) which can either have the state SOMETHING and SOMETHINGSELSE.

You can use those in your lovelace.yaml like this:

title: My Awesome Home
views:
  - icon: mdi:home-assistant
    title: Second view
    background: radial-gradient(crimson, skyblue)
    cards:
      - type: entities
        title: Woonkamer
        entities:
          - sensor.wall_switch_left
          - sensor.wall_switch_right

Then you get this:

template

B.t.w. Did you know Home assistant supports lots of languages. If you change the language (for example to German) in the GUI (account settings) the statuses of a binairy sensors will change in an and aus.

I hope this is helpful!

Weird, I’ve kind of the same question. Is this changed in 0.84? In 0.83 I was getting the “friendly names” already… after updating open/closed is changed to on/off for example with the door sensors…

1 Like

It’s a bug! See: https://github.com/home-assistant/home-assistant-polymer/issues/2354, the “friendly names” should be visible by default. Probably fixed in the next release 0.84.4 with this PR: https://github.com/home-assistant/home-assistant-polymer/pull/2356

1 Like