Executing Python MQTT Skills

Hi all,

I am trying to create a way to more simply run new skills for Rhasspy. What I envision is a single directory where I add skills and they are:

  1. added to sentences.ini
  2. Rhasspy is trained
  3. the python script for the skill is executed

The above process leaves me with two questions:

  1. What is the best way to execute the skill python scripts? Is creating a service with systemd a good approach or should I just spawn a subprocess for each?
  2. Can Rhasspy have multiple sentences.ini files (e.g. One for each skill)? If so, is there a reasonable maximum of these files?

Thanks for any input you can provide.

Not exactly sure what you’re trying to accomplish, but I did something similar. I wanted Rhasspy to “Fire Phasers” when I gave the voice command, so I wrote a short python script that subscribes to a topic on my MQTT Broker, and executes when it get the MQTT message. The python script autostarts when the PI starts up, and subscribes to the topic. I think I posted on this a while ago. Hope this helps.

Thanks ! Basically what I am hoping to put together for myself is a way that would autostart all the python scripts in a directory and add their accompanying intents to Rhasspy with minimal manual intervention.

Hi, new to this myself but I will try to help.

1:How to run skills seems to be a big debat in this community. Essentially you want to create ab app (doesn’t need to be python) that connects to the MQTT bus that rhasspy is on and listens for the specific intent topic for the intent you want the app to handle. Then the app should respond to the MQTT bus with the appropriate response. The app does not need to be run on the rhasspy device itself as long as it can connect to the MQTT bus. Some people run the scripts/apps using systemd and others seem to like the docker route, setting each app up in it’s own container. I am working on building a suite of apps based on the rhappsy app library and have decided to go the docker route myself. But again the key is to deploy it somewhere it can access MQTT.

2: Yes you can have multiple sentence files. you can even create them via the web ui if you want to see an example how rhasspy wants to see the files.