Change the values a device outputs

Heya, trying to change the two states my lock outputs from locked/unlocked to the Swedish translations of the words.

What ive attempted so far w/o luck is adding this to my config:

sensor:
  - platform: template
    sensors:
      danalock_v3_smart_lock:
        friendly_name: "Ytterdörr"
        unit_of_measurement: "State"
        entity_id: lock.danalock_v3_smart_lock
        value_template: >-
          {% set mapper =  {
              'locked' : 'Låst',
              'unlocked' : 'Olåst' } %}
          {% set state =  states.lock.danalock_v3_smart_lock.state %}
          {{ mapper[state] if state in mapper else 'Unknown' }}

Any ideas on what im doing wrong?

remove the unit_of_measurement, it’s doing nothing for you, but that’s not your problem. The Jinja and format/spacing looks good. So my only question are: Do you get any errors? Are you restarting after you add this in? Do you have more than 1 sensor section?