vajdum,
If you have the Satellite and Base recognising the intent ⌠when the words âPorcupine, turn on the study lightâ are spoken, Rhasspy determines that the âLightStateâ intent is to be called with slot ânameâ having a value of âstudy lightâ and slot âvalueâ having a value of âonâ ⌠as seen here:
⌠the next step is to get Rhasspy & Home Assistant to action it.
You may need to use a Long-lived Access Token. This is done at the very bottom of your profile page in Home Assistant
Click [Create Token], give it a name (I called mine âRhasspyâ), and a long sequence of characters (well beyond the left and right sides of the window) will be shown.
Click your mouse anywhere in the line of code, press the [Home] key to move the cursor to the start of the code, press [Shift-End] to highlight to the end of the code, and [Ctrl-C] to copy the code to clipboard.
In Rhasspy on the Satellite, set [Intent Handling] to âHome Assistantâ, [Save], add the URL for Home Assistant â the âhttp://â protocol, hostname or IP address of the Home Assistant machine, and port number :8123.
Go to the browser window with your Satellite and paste that long code above into the âAccess Tokenâ field and click [Save Settings].
I am using intents in HA, so selected the âsend intentsâ⌠option.
There, that should send your intents to Home Assistant.
Now to Home Assistant and we will add the intents into configuration.yaml so that Home Assistant will action them.
There are several ways to edit the .yaml files, and I have installed the âFile editorâ Add-on from Configuration > Add-ons.
I have added into the configuration.yaml page:
intent:
intent_script: !include intents.yaml
The keywords âintent:â and âintent_script:â are required. In my case I have chosen to place the actual intents in a separate file to make them easier to edit; but you can simply list the intents directly after âintent_script:â.
In my new intents.yaml file I have:
#
# intents.yaml - the actions to be performed by Rhasspy voice commands
#
GetTime:
speech:
text: The current time is {{ now().strftime("%H %M") }}
LightState:
speech:
text: Turning {{ name }} {{state }}
action:
- service: light.turn_{{ state }}
target:
entity_id: light.{{ name | replace(" ","_") }}
And thatâs it !
When the words âPorcupine, turn on the study lightâ are spoken, Rhasspy determines that the âLightStateâ intent is to be called with slot ânameâ having a value of âstudy lightâ and slot âvalueâ having a value of âonâ ⌠as seen in the first image above.
This intent is passed (in a JSON file) to Home Assistant, where the intent name is looked up in the configuration.yaml (or intents.yaml) file.
Intent name âLightStateâ matches with âLightState:â, and parameters are substituted, so that Home Assistant effectively runs:
LightState:
speech:
text: Turning study light on
action:
- service: light.turn_on
target:
entity_id: light.study_light