Configure Audio

Hi, New to Rhasspy and having difficulty getting my microphone recognised.
My install followed the instructions for Debian and is running on a Raspberrypi 4
I have installed PyAudio.
The mic is a simple usb and works when using Alsa but is not recognised when using Rhasspy.
arecord -l gives
**** List of CAPTURE Hardware Devices ****
card 2: Device [USB PnP Sound Device], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

The mic shows up as follows:- USB PnP sound device Audio (hw :2,0)* (0)
Device is set to 0
The profile is:-
{
“dialogue”: {
“system”: “rhasspy”
},
“intent”: {
“system”: “fsticuffs”
},
“microphone”: {
“pyaudio”: {
“device”: “0”
},
“system”: “pyaudio”
},
“sounds”: {
“system”: “aplay”
},
“speech_to_text”: {
“system”: “pocketsphinx”
},
“text_to_speech”: {
“system”: “espeak”
}
}
Any help appreciated

Some progress. If I upload a wav file and played it. It is recognised and shows a JSON code.
However nothing is action-ed . I used the example Get Time.
Do I have to recreate the intent as mine?
Also, what is the file directory structure. My Log is also empty. Should I expect some feedback there?
Thanks.

Do you have an intent handler script running? Rhasspy recognizes your intents, but it’s up to you to define what should happen on recognizing the intent. For instance with:

Hi,
Thanks for coming back. I had a feeling I was missing something conceptually.
I will investigate.

Ok so I understand that I can use a Command and an associated script.
I need to add similar code to this to my profile. How do I do this please?
I assume arguments are values to pass to the script?
Sorry if this is too elementary but I think this is great software that I can build into my projects.
I am not using home assistant as my projects are of a more general nature.

"handle": {
  "system": "command",
  "command": {
      "program": "/path/to/program",
      "arguments": []
  }
}

And this would be the script (thanks to synesthesian)

#!/usr/bin/env python

import sys
import json
import random
import datetime


def speech(text):
    global o
    o["speech"] = {"text": text}


# get json from stdin and load into python dict
o = json.loads(sys.stdin.read())

intent = o["intent"]["name"]

if intent == "GetTime":
    now = datetime.datetime.now()
    speech("It's %s %d %s." % (now.strftime('%H'), now.minute, now.strftime('%p')))

elif intent == "Hello":
    replies = ['Hi!', 'Hello!', 'Hey there!', 'Greetings.']
    speech(random.choice(replies))

# convert dict to json and print to stdout
print(json.dumps(o))