Hello,
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