Sorry John, my mistake ! Most people get stuck well before the point of actioning the voice command, so well done !
As always with computers, there are several ways to achieve the same objective. There are 3 options for “Intent Handling” with Home Assistant. I have since changed to doing all my automations in node-RED (another learning curve, so I’m not recommending it for you now), but I started using Home Assistant Intents.
In the “settings > Intent Handling” section at the Rhasspy which is detecting the voice commands,
Enter the URL for your Home Assistant including port :8123 and select “Send Intents”. I needed to also setup a HA “Long-Lived Access Token” (at the very bottom of your Profile at very bottom left corner of your HA page) but you may not.
You now need to edit the HA “/config/configuration.yaml” file and add the keywords “intent:” and “intent_script:” before your HA intents.
My own example of turning lights on|off the intent code was
LightState:
speech:
text: Turning {{ name }} {{state }}
action:
- service: light.turn_{{ state }}
target:
entity_id: light.{{ name | replace(" ","_") }}
I don’t have an alarm myself, but it looks to me as though you want to perform the action of arm or disarm your alarm, and that according to HA Developer Tools
select your entity, then click [YAML Mode] to see the action you want your intent to perform.
Putting it all together I believe you want
intent:
intent_script:
AlarmChangeState:
speech:
text: The Alarm is now {{state }}
action:
- service: alarm_control_panel.alarm_{{ state }}
target:
entity_id: alarm_control_panel.blink_johns_house
data:
code: "1234"
This then leaves a small issue … that you are currently passing in {name} with value or “alarm” which is not used, and {state} with a value of “on” or “off” - but the service you want to perform is called “alarm_arm_away” or “alarm_disarm”. The “alarm_” prefix is common, so I suggest the easiest fix here is to go back to your sentences.ini file and add substitutions for on and off, such as:
[AlarmChangeState]
turn ( on:arm_away | off:disarm ){state} [the] alarm
( arm:arm_away | disarm ) the alarm
Sorry for the long post, but I found that -while all the information is in the rhasspy documentation - it is not so easy to find the bit you want when you need it 