How to combine the entity_id value into intent_script correctly? I need to use one of the values: {name} or {media_player}, which the system will send, depending on the sentence said
intent_script:
SetVolume:
action:
service: "media_player.volume_set"
data:
entity_id: "{{ name }}" or "{{ media_player }}" #???
volume_level: "{{ volume / 100.0 }}"
speech:
text: "Volume changed to {{ volume }}"
And I’m also interested in whether HassLightSet, HassTurnOff, HassTurnOn exist in YAML format? It would be useful to use them as examples.
Сonfusing naming is used here. But both values pass media_player entities.
for {name}, the search occurs in aliases and names.
for {media_player } is selected from a specific list
if a foreign language does not bother, I attach sentences
let’s abstract from concrete entities.
Suppose a script can get one of two variables with a numeric value (depending on the phrase said). Is it possible to make a universal record for this case?
{{ var1 }} or {{ var2 }}