I’ve been fighting this one for a while, so hopefully someone can help point me in the right direction.
I’ve setup Snips to pass a location in one of the slots. If there is no location specified, I would like to set the empty Slot value depending on the Site_ID.
Below is my intent script, and it all works except the tv_location that I’m setting doesn’t get passed to the action. It’s set correctly in the speech section. I can repeat the same script in the action section, but I was hoping there was a better way.
turnOnTV:
speech:
type: plain
text: >
{% if tv_location == null %}
{% if site_id == "default" %}
{% set tv_location = "living room" %}
{% elif site_id == "aiy_kit2" %}
{% set tv_location = "guest room" %}
{% else %}
{% set tv_location = "unknown" %}
{% endif %}
{% endif %}
Turning on {{tv_location}}
action:
- service: media_player.turn_on
data_template:
entity_id: 'media_player.{{tv_location | replace(" ","_")}}_tv'