Storing values in the right way

I’ve made a multimedia section in my Home Assistant configuration where I can select a room (“Ruimte”) and select a source / radio stream (“Bron”). See the image below:

In the red rectangles I want to display the selected radio stream for the selected room. Mainly to create an overview of what is playing in what room. In my configuration.yaml I tried the following code:

- platform: template
  sensors:
    media_player_living_room_source:
      value_template: >-
        {% if is_state('input_select.room', 'Huiskamer') %}
          {{ states.input_select.radio.state }}
        {% endif %}

    media_player_bedroom_source:
      value_template: >-
        {% if is_state('input_select.room', 'Slaapkamer') %}
          {{ states.input_select.radio.state }}
        {% endif %}
      
    media_player_kitchen_source:
      value_template: >-
        {% if is_state('input_select.room', 'Keuken') %}
          {{ states.input_select.radio.state }}
        {% endif %}          

I hoped that it would store the value only when the IF condition was satisfied and keep that value in memory, but that is not the case. When I change the room input select on the picture above from “Keuken” to another room, the value “538” in the lowest red rectangle will disappear.

I am trying to achieve that when the room input select is set to “Keuken” and the source input select is set to “538”, it will hold that value when I select another room. This means that it should display three values in the red rectangles in case all three media players are playing. These values should only be changed when another source will be selected.

What is the easiest way to achieve this?

Thanks in advance,