Change capital letters to lower letters value_template

Hi All,

This is working:

{% set item =  state_attr('sensor.bitladon_all', 'result') | selectattr('ticker', 'eq', 'FTT') | first %}
{{ item.ticker }}

Output: FTT

But is there a way to make this to lower letters:
Output: fft

Cheers
Peter

1 Like

Please try this

{% set item =  state_attr('sensor.bitladon_all', 'result') | selectattr('ticker', 'eq', 'FTT') | first %}
{{ item.ticker | lower }}
3 Likes

Thanks you are my hero for today… makes many automatons lots easier!!

1 Like

How do I change from not_home to e.g. Away or Not Home?

- platform: mqtt_room
  name: "Kim Apple Watch"
  device_id: "xxxxxxx"
  state_topic: 'espresense/rooms'
  timeout: 5
  away_timeout: 120

- platform: mqtt_room
  name: "Kim iPhone"
  device_id: "xxxxxxxxx"
  state_topic: 'espresense/rooms'
  timeout: 5
  away_timeout: 120

- platform: mqtt_room
  name: "Nattz Apple Watch"
  device_id: "xxxxxxx"
  state_topic: 'espresense/rooms'
  timeout: 5
  away_timeout: 120

If your define the device class for these sensors, home assistant will translate the sensor states in the UI using the language of the UI.
See Binary sensor - Home Assistant

1 Like