Hassio Problem with concatenate rhasspy parameter to get climate temperature

Hello,
I know, this is hassio Problem. Just a try.

Problem
I try to get my climate temperatures by event, called from rhasspy.
The names of the climates are
climate.ROOM_heizung (climate.wohnzimmer_heizung, climate_badezimmer_heizung, etc.)
The given parameter is room.

This works:
In other automations this works.In this case other parameter, are given (light.wohnzimmer_deckenlampe), if no room is given, it will take the sitId, which is always given.

automation:
#
#---------------------------------
#   rhasspy_ChangeLightState    
#---------------------------------   
    - id: '1614092734440'
      alias: rhasspy_ChangeLightState
      trigger:
      - platform: event
        event_type: rhasspy_ChangeLightState
      action:
      - service: light.turn_{{ trigger.event.data.state }}
        data_template:
          entity_id: >
            {% if trigger.event.data.room %}
              light.{{ trigger.event.data.room}}_{{ trigger.event.data.device}}
            {% else %}
              light.{{ trigger.event.data._intent.siteId}}_{{trigger.event.data.device}}
            {% endif %}
      - service: mqtt.publish
        data_template:
          payload_template: >
            {% if trigger.event.data.state == "ON" %}
              {"siteId": "{{trigger.event.data._intent.siteId}}",
               "text": "Ich habe das Licht angemacht"}
            {% else %}
              {"siteId": "{{trigger.event.data._intent.siteId}}",
               "text": "Ich habe das Licht ausgemacht"}
             {% endif %}
          topic: hermes/tts/say

This does not work:

{{ state_attr("climate." + {{trigger.event.data.room}} + "_heizung", 'current_temperature') }} 

OR

{{ state_attr("climate.{{trigger.event.data.room}}_heizung", 'current_temperature') }} 

should become:

{{ state_attr('climate.wohnzimmer_heizung', 'current_temperature') }}  

Thanks in advance
kay

Not really the most appropriate place for this kind of request… You should ask on the Home Assistant forum.

Just a guess though…

{{ state_attr("climate." + trigger.event.data.room + "_heizung", 'current_temperature') }} 

I Love you. :heart_eyes: :heart_eyes: :heart_eyes: :stuck_out_tongue_winking_eye:
I tried for three days. You got it.
Thank you very much.

Solution

- id: 'rhasspy_Get_local_temperature'
  alias: rhasspy_Get_local_temperature
  trigger:
  - platform: event
    event_type: rhasspy_Get_local_temperature
  action:
    - service: mqtt.publish
      data_template:
        payload_template: >
                {"siteId": "{{trigger.event.data._intent.siteId}}",
                 "text": "Die aktuelle Temperatur im Raum {{trigger.event.data.room}} beträgt {{ state_attr("climate." + trigger.event.data.room + "_heizung", 'current_temperature') }}  Grad "}
        topic: hermes/tts/say      
  mode: single