Hey there,
I have several aquara Temp Sensors around the House an sometimes i want to ask Alexa aubout the temperature an humidity in an specific room.
The problem is that my sensors named like “temperature livingroom”
So, if I wanna ask alexa, I have to say: “Alexa, whats the temperature of temperature Livingroom?”
which is noch very elegant.
It would be better to ask “Alexa, whats the temperature in the Livingroom?”
I found a solution an google which doesnt work for me. And if I had to be honest, I don’t understand how it works.
platform: template
sensors:
last_alexa:
unique_id: *** hier eine unique ID eintragen (VSCode Kontextmenu -> generate UUID) ***
value_template: >
{%- for group in states.media_player | groupby('state') -%}
{%- for entity in group.list -%}
{%- if is_state_attr(entity.entity_id, 'last_called', true) %}
{{ entity.entity_id }}
{%- endif -%}
{%- endfor -%}
{%- endfor -%}
alias: wie ist die Temperatur im Wohnzimmer
sequence:
- service: notify.alexa_media
data_template:
target:
- '{{ states.sensor.last_alexa.state }}'
data:
type: tts
method: speak
message: >
{% set alexa_text = [ "Die Temperatur im Wohnzimmer beträgt ",
"Im Wohnzimmer sind ",
"Im Moment sind im Wohnzimmer " ] | random %}
{{ '{} {} Grad Celsius.'.format( alexa_text, states('Multisensor.Esszimmer')) }}
mode: single
alexa:
smart_home:
filter:
include_entities:
- script.wie_ist_die_Temperatur_im_Wohnzimmer
The question is, is there a better, easier Solution.
It would be awesomne if someone give me some tipps and Ideas.