Save profile doesn't work

Hi there!

I am trying to edit my profile in the advanced tab in order to use a custom program for intent handling.

"handle": {
    "system":"command",
    "command": {
        "program": "/home/pi/.config/rhasspy/intenthandler.py"
        "arguments": []
    },
    "forward_to_hass": false
}

But when I hit “save profile” and restart Rhasspy, the added part is gone. Since that is a change diffferent from the default, I am wondering why it is not shown? Thanks for any help!

The code only saves non-standard/custom portions of your profile. Perhaps your config YAML matches the default a little too closely?

1 Like

Thank you! The thing is that’s the template

“handle”: {
“system”: “command”,
“command”: {
“program”: “/path/to/program”,
“arguments”: []
},
“forward_to_hass”: true
}

so it can’t really differ that much :confused:

do you need a comma after the program line?

"handle": {
    "system":"command",
    "command": {
        "program": "/home/pi/.config/rhasspy/intenthandler.py",
        "arguments": []
    },
    "forward_to_hass": false
}
1 Like

You’re right, thank you very much! Unfortunately, Rhasspy’s behaviour doesn’t change :confused: Still not saved

hmmm… need a space after the colon in

    "system": "command",

but that’s the only other syntax issue that I can see. Might want to check that all the parts above and below what you shared are valid json, too, including starting with a {

Obvious, I know, but it’s always the punctuation that gets me.

1 Like

Embarrrassing how many typos I missed :man_facepalming: Thanks again! I hope there is no left

{
“microphone”: {
“arecord”: {
“device”: “default:CARD=seeed4micvoicec”
},
“system”: “arecord”
}
“handle”: {
“system”: “command”,
“command”: {
“program”: “/home/pi/.config/rhasspy/intenthandler.py”,
“arguments”: []
},
“forward_to_hass”: false
}
}

That’s how I’m trying to save it now, but it still doesn’t work :sob: I’m sorry to bother you! Obviously there’s something I’m missing, I’m sure it’s something stupid…

Your JSON is missing a comma before “handle”.

Here you go (the corrected version):

{
  "microphone": {
    "arecord": {
      "device": "default:CARD=seeed4micvoicec"
    },
    "system": "arecord"
  },
  "handle": {
    "system": "command",
    "command": {
      "program": "/home/pi/.config/rhasspy/intenthandler.py",
      "arguments": []
    },
    "forward_to_hass": false
  }
}

You can use something like this to validate your JSON before submitting it:

4 Likes

What a powerful tool, thank you very much! I don’t know why, but Rhasspy still only saves the microphone part …

My input:

{
“microphone”: {
“arecord”: {
“device”: “default:CARD=seeed4micvoicec”
},
“system”: “arecord”
},
“handle”: {
“system”: “command”,
“command”: {
“program”: “/home/pi/.config/rhasspy/intenthandler.py”,
“arguments”: []
},
“forward_to_hass”: false
}
}

What Rhasspy shows after save and automatic restart

{
“microphone”: {
“arecord”: {
“device”: “default:CARD=seeed4micvoicec”
},
“system”: “arecord”
}
}

EDIT: After updating to 2.4.16, rhasspy shows me this after the save and automatic restart:

{
“microphone”: {
“arecord”: {
“device”: “default:CARD=seeed4micvoicec”
},
“system”: “arecord”
},
“handle”: {
“system”: “command”,
“command”: {
“program”: “/home/pi/.config/rhasspy/intenthandler.py”
}
}
}

Also, it doesn’t call my program :confused:

“error”: “[Errno 2] No such file or directory: ‘/home/pi/intenthandler.py’: ‘/home/pi/intenthandler.py’”

But I guess that’s another story

Nice suggestion on the tool, I wonder who created these tools for a developer whose life got easier. I use similar tools for JSON.

Thank you Fastjack for suggesting this JSON tool.

1 Like