Noob question, playing around with ESPresence. I have it working fine with an ESP32 room sensor which is tracking my cell phone. However when I make a dashboard card that shows my sensor it puts the ESP32 room value and state in lower case. For example, “Raymond’s Office” shows as “raymond_s_office” in the sensor card. I’ve spent quite a bit of time searching and have only found snipppets of solutions which I have not been able to make work. Any help would be appreciated.
Replying to my own post so any others that run across this will hopefully find a solution. A super helpful person in the Facebook group gave me the solution! This is what I now have in my configuration.yaml. 1st section defines the sensor, 2nd section transforms the MQTT states to something more friendly.
# Your BLE Sensor
sensor:
# One entry for each beacon you want to track
- platform: mqtt_room
unique_id: rb_phone
device_id: 'phone:raymonds'
name: "Raymond's Phone"
state_topic: 'espresense/devices/phone:raymonds'
timeout: 10
away_timeout: 120
# Transform MQTT messages to a more friendly format
template:
- sensors:
raymonds_unslugged:
friendly_name: "Raymond Beacon"
icon_template: mdi:radar
value_template: >-
{% if states.sensor.raymonds.state == 'not_home' %}
Away
{% else %}
{{ states('sensor.raymonds') | replace('raymond_s_office',"Raymond's Office") | title }}
{% endif %}