ESPresense - Changing Displayed Location Names

Hello,

I am typing to edit the location display names showing in ESPresense.

Currently, if I am detected in my Master Bedroom, it displays my location as “master_bedroom”. I would like to edit this to display “Master Bedroom”.

I tried adding the following Platform Template in my Sensors YAML file

  - platform: template
    sensors:
      leon_iphone_ble:
        value_template: >-
         {% if is_state('sensor.leon_iphone_ble', 'entryway') %}
           Entryway
         {% elif is_state('sensor.leon_iphone_ble', 'kitchen') %}
           Kitchen
         {% elif is_state('sensor.leon_iphone_ble', 'lLiving_room') %}
           Living Room
         {% elif is_state('sensor.leon_iphone_ble', 'master_bedroom') %}
           Master Bedroom
         {% elif is_state('sensor.leon_iphone_ble', 'guest_bedroom') %}
           Guest Bedroom
         {% elif is_state('sensor.leon_iphone_ble', 'office') %}
           Office
         {% elif is_state('sensor.leon_iphone_ble', 'not_home') %}
           Not Home
         {% else %}
           Unknown
         {% endif %}`

Something is not right with the YAML Developers Tools is not showing errors though.

When installed, it only shows my location as “Unknown”, the only line of code working.

When I remove the YAML, my location goes back to displaying “master_bedroom” or “guest_bedroom”.

I think I’m very close, but I am not seeing my mistake.

Any help would be greatly appreciated.

Thank you.

add this to your template in developer tools:

{{ states('sensor.leon_iphone_ble'} }}

and observe why no is_state is matching.

BTW you have a backtick at the end of your endif.

Source sensor name looks identical with target one.

You want to create a sensor named leon_iphone_ble by sensor leon_iphone_ble, or I am reading wrong?

Developer Tool shows correct location, but the YAML is still deactivated. I’ll have to turn it back on and try again

The ‘ was a typo in my post only.

“Source sensor name looks identical with target one.

You want to create a sensor named leon_iphone_ble by sensor leon_iphone_ble, or I am reading wrong?“

—-

That was how the sample YAML was written.

Should it be different?

I’m maybe a 2 or 3 out of 10 in learning and understanding YAML.

They have to be different, can you share the link?

Or just change the initial template sensor name, it should work

This is where I found the YAML

https://reddit.com/r/homeassistant/s/Q2K1jBBa8p

Oh, I see. It is different.

Yes! That did it. Yay :grinning:

Thank you both for helping.

1 Like