Using External MQTT Broker Crashes Rhasspy

I have Rhasspy working with Home Assistant using the Send events to Home Assistant (/api/events) method.

When I use the Internal MQTT broker (host:"", port:12183) Rhasspy works with HA as desired.

I now want to make use of Rhasspy’s Hermes MQTT messages to add additional functionality to my setup, so I want both Home Assistant and Rhasspy to use the mosquitto MQTT broker used by Home Assistant.

The issue is that when I select External MQTT in Rhasspy and fill in the appropriate details of the HA MQTT broker, upon reboot of the pi Rhasspy’s GUI no longer loads. The only way to fix it is to ssh into the pi and then manually edit my profile.json back to the Internal MQTT broker settings.

I have checked the logs and when I run docker-compose up I see the folowing error:

Error: Format string 'rhasspy-microphone-pyaudio-hermes --sample-rate 16000 --sample-width 2 --channels 1 --debug --host 192.168.xx.xx --port 1883 --site-id default --username xxxxxx--password xxxxxx --device-index 0 --udp-audio-host' for 'program:microphone.command' is badly formatted: an integer is required in section 'program:microphone' (file: '/profiles/en/supervisord.conf')

This is the relevant part of that file:

command=rhasspy-microphone-pyaudio-hermes --sample-rate 16000 --sample-width 2 --channels 1 --debug --host 192.168.xx.xx --port 1883 --site-id default --username xxxxxx --password xxxxxx --device-index 0 --udp-audio-host

I’m not sure which integer I am missing or where in this section I should place it. Has anyone experienced this issue?


Further Info:

I have Home Assistant 0.118.2 on a Windows 10 PC, created using docker-compose. The MQTT broker (mosquitto) used by Home Assistant is contained in a second container on this PC. Port 1883 is exposed and can be successfully used by Home Assistant.

I have Rhasspy 2.5.7 on a Pi 4, also created using docker-compose. This is the docker-compose file:

  image: "rhasspy/rhasspy"
  container_name: rhasspy
  restart: unless-stopped
    - "$HOME/.config/rhasspy/profiles:/profiles"
    - "/etc/localtime:/etc/localtime:ro"
    - "1883:1883" 
    - "12101:12101"
    - "12183:12183"
    - "/dev/snd:/dev/snd"
  command: --user-profiles /profiles --profile en

These are my Rhasspy settings:

  1. MQTT: Internal
  2. Audio Recording: PyAudio
  3. Wake Word: Porcupine
  4. Speech to Text: Pocketsphinx
  5. Intent Recognition: Fsticuffs
  6. Text to Speech: Espeak
  7. Audio Playing: aplay
  8. Dialogie Management: Rhasspy
  9. Intent Handling: Home Assistant

Not sure if you’ve solved it yet, but for future reference at least.
I had a similar issue that every service which connected to the MQTT complained about unable to format, in my case %o not being a valid placeholder.
The issue was cause by the password I had set up for MQTT having one (or more) % signs in it, changing password so that it didn’t contain % solved my issue. In this case I’m guessing the password (or username) contains %d

1 Like

i have the same issues. as soon i change mqtt to external rhasspy stops working and can’t be reached anymore. what could be a possible workaround to make it work? any help/advice would be highly appreciated (rhasspy 2.5.9).

at least for some moments it seems to be working, as i made it to receive some data in my ioBroker… to me it looks like the mqtt crash has nothing to do with ioBroker, asbit also crashes without any broker connected…