Data template under action not working with if is_state

Hi all,
I would like to have some if is_state statements unter the action “entity_id” part, to ensure that my Google Homes do only speak via TTS when there is no music playing on them / no guest is in the guest room.
What am I doing wrong? It looks good in the templates tab.
This is the error log:

Logger: homeassistant.components.automation.notify_for_high_humidity
Source: helpers/script.py:1138
Integration: Automatisierung (documentation, issues)
First occurred: 7:48:21 (1 occurrences)
Last logged: 7:48:21

Notify for high humidity: Error executing script. Invalid data for call_service at pos 2: not a valid value for dictionary value @ data['entity_id']

And then there is a second error. In the last weeks it worked that TTS annonced the correct rooms (see “message” part). Now it doesn say any room anymore. Code wasnt changed.
My code:

action:
      - service: tts.google_say
        data_template:
          entity_id: >
            {% if is_state('media_player.wohnzimmer_mini', 'off') %}- media_player.wohnzimmer_mini{%- endif %}
            {% if is_state('media_player.schlafzimmer', 'off') %}- media_player.schlafzimmer{%- endif %}
            {% if is_state('input_boolean.guest_mode', 'off') %}- media_player.gastezimmer{%- endif %}
          message: >
            The humidity is too high in the room
            {% if (states.climate.gastezimmer.attributes.current_humidity) > 60 %}
            Guestroom, 
            {% endif %}
            {% if (states.climate.wohnzimmer.attributes.current_humidity) > 60 %}
            Living Room,
            {% endif %}
            {% if (states.climate.schlafzimmer.attributes.current_humidity) > 60 %}
            Sleeping Room,
            {% endif %}
            {% if (states.climate.bad.attributes.current_humidity) > 60 %}
            Bath,
            {% endif %}
            Please Ventilate.

Your problem is probaby when none of the ifs is true for the entity_id, then the field will be empty, because you don’t have any else clause.
I’m not sure, but I think you can use None or none as your else value.

Thanks for your feedback. Unfortunatly it still seems not to work. Same error in the logs.

New code:

- service: tts.google_say
        data_template:
          entity_id: >
            {% if is_state('media_player.wohnzimmer_mini', 'off') %}- media_player.wohnzimmer_mini{% else %}none{%- endif %}
            {% if is_state('media_player.schlafzimmer', 'off') %}- media_player.schlafzimmer{% else %}none{%- endif %}
            {% if is_state('input_boolean.guest_mode', 'off') %}- media_player.gastezimmer{% else %}none{%- endif %}
          message: >
            The humidity is too high in the room
            {% if (states.climate.gastezimmer.attributes.current_humidity) > 60 %}
            Guestroom, 
            {% endif %}
            {% if (states.climate.wohnzimmer.attributes.current_humidity) > 60 %}
            Living Room,
            {% endif %}
            {% if (states.climate.schlafzimmer.attributes.current_humidity) > 60 %}
            Sleeping Room,
            {% endif %}
            {% if (states.climate.bad.attributes.current_humidity) > 60 %}
            Bath,
            {% endif %}
            Please Ventilate.

But the code seems to be correct:

Is it maybe because of the many spaces in the second and third entity_id? But how should I remove them?