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.
I am trying to do a similar thing but failing. I have tried the great suggestion from @fastjack but it doesn’t seem to work in my case.
I think it’s because I don’t need the additional…
, 'current_temperature'
bit. It also seems to object to the use of…
state_attr
… when I use this I don’t get any response at all from Rhasspy.
My full issue, start to finish, is this:
I’m trying to create a sentence with associated automation to pull the temperature from various rooms. Each room contains a temperature sensor.
My sentence is set up thus:
[GetTemperature]
whats the temperature in the (kitchen:sensor.kitchen_temperature | office:sensor.office_temperature | garage:sensor.garage_temperature){entity}
… and the HA automation is:
- id: Rhasspy GetTemperature
alias: Rhasspy GetTemperature
mode: single
trigger:
- platform: event
event_data: {}
event_type: rhasspy_GetTemperature
action:
- service: mqtt.publish
data:
topic: hermes/dialogueManager/endSession
payload_template: '{"sessionId": "{{ trigger.event.data._intent.sessionId }}", "text": "The temperature in the {{ trigger.event.data.entity_raw_value }} is {{ trigger.event.data.entity }} degrees."}'
… but an example of the spoken result is:
“The temperature in the kitchen is sensor.kitchen underscore temperature degrees”
… so it’s pulling the entity name but not its value (state? numerical state?)
I’ve tried using all sorts of variants of:
states.trigger.event.data.entity
states.trigger.event.data.entity.state
variations on the state_attr(“states.” + trigger.event.data.entity + “.state”) theme
… but to no avail.
Put the example in the Template editor and you should see the value
HA automation
payload_template: ‘{
“sessionId”: “{{ trigger.event.data._intent.sessionId }}”,
“text”: “The temperature in the {{ trigger.event.data.entity_raw_value }} is
{{ state_attr( trigger.event.data.entity, ‘DING_DING’) }} degrees.”
}’