I’m trying to use some old intent scrips I was using with Snips… and it occurred to me they might have had a setting in the console to “include Site ID” or something like that. So supposed to… I’m not sure.
My intent script pulls “room” from the intent or defaults to the site id, which is the room the satellite is in.
> onOffIntent:
> speech:
> type: plain
> text: >
> {% if room == null %}
> yes sir
> {% else %}
> Turning {{action}} {{room}} {{device}}
> {% endif %}
>
> action:
> - service_template: >
> {% if action == "on" %}
> {% if device == "lights" %}
> homeassistant.turn_on
> {% elif device == "tv" %}
> media_player.turn_on
> {% else %}
> switch.turn_on
> {% endif %}
> {% elif action == "off" %}
> {% if device == "lights" %}
> homeassistant.turn_off
> {% elif device == "tv" %}
> media_player.turn_off
> {% else %}
> switch.turn_off
> {% endif %}
> {% endif %}
> data_template:
> entity_id: >
> {% if room == null %}
> {% set room = site_id %}
> {% else %}
> {% set room = room | replace(" ","_") %}
> {% endif %}
> {% if device == "lights" %}
> group.{{room}}_lights
> {% elif device == "tv" %}
> media_player.{{room}}_tv
> {% else %}
> switch.{{room}}_{{device}}
> {% endif %}
The action, room and device all seem to be received properly, but the site_id is null. When I looked at the logs, the thing I noticed was action, room and device were all slots. site_id is in the MQTT, but not defined as a slot.
[DEBUG:2020-10-22 10:11:14,727] rhasspyserver_hermes: <- NluIntent(input=‘turn on the office lights’, intent=Intent(intent_name=‘onOffIntent’, confidence_score=1.0), site_id=‘the_office’, id=None, slots=[Slot(entity=‘action’, value={‘kind’: ‘Unknown’, ‘value’: ‘on’}, slot_name=‘action’, raw_value=‘on’, confidence=1.0, range=SlotRange(start=5, end=7, raw_start=5, raw_end=7)), Slot(entity=‘room’, value={‘kind’: ‘Unknown’, ‘value’: ‘the office’}, slot_name=‘room’, raw_value=‘the office’, confidence=1.0, range=SlotRange(start=8, end=18, raw_start=8, raw_end=18)), Slot(entity=‘device’, value={‘kind’: ‘Unknown’, ‘value’: ‘lights’}, slot_name=‘device’, raw_value=‘lights’, confidence=1.0, range=SlotRange(start=19, end=25, raw_start=19, raw_end=25))], session_id=‘the_office-porcupine-4d311965-dd9c-4a61-8f30-325bf00e2354’, custom_data=None, asr_tokens=[[AsrToken(value=‘turn’, confidence=1.0, range_start=0, range_end=4, time=None), AsrToken(value=‘on’, confidence=1.0, range_start=5, range_end=7, time=None), AsrToken(value=‘the’, confidence=1.0, range_start=8, range_end=11, time=None), AsrToken(value=‘office’, confidence=1.0, range_start=12, range_end=18, time=None), AsrToken(value=‘lights’, confidence=1.0, range_start=19, range_end=25, time=None)]], asr_confidence=None, raw_input=‘turn on the office lights’, wakeword_id=‘porcupine’, lang=None)
So possibly I need to change something in my Home Assistant intent script to pull it properly