Run File on Recognize Wake Word($10 to charity of your choice for best answer)

Looking for a way to run a Python file to turn on onboard lights on a respeaker 6 microphone whenever a wake word is recognized. Also a way to stop that script when Rhasspy stops listening.



This might be of interest:

Hope this helps.

Yes, we made it compatible with rhasspy last month.

Actually it does works, but we need rhasspy publishing all hermes topics like snips/alice does to fully work and have leds following mqtt activity.

HLC also allow to configure actions on button pressed. I use it with snips to disable wakeword, but here we need a way to do it with rhasspy.

Haven’t got around to trying it yet but looks like the best reply. $10 to what charity?

On my pi HermesLedControl was not working, or not how i expected. I can’t remember exactly.
So i wrote a small phyton script that works for me until the whole hermes stuff is implemented. Then I will try HermesLedControl again. :wink:

I use marytts and this is also published over mqtt. I’m not a python developer, so maybe something could be better. Here is my really short temporary solution:

import logging
import time

import paho.mqtt.client as mqtt
from gpiozero import LED
from pixel_ring import pixel_ring

MQTT_IP = ''
MQTT_PORT = 1883

def on_message(client, userdata, message):
    if 'hermes/nlu/intentNotRecognized' == message.topic:'intent not recognized')

    if 'rhasspy/de/transition/SnowboyWakeListener' == message.topic:
        if 'loaded' == str(message.payload.decode("utf-8")):

    if message.topic.startswith('hermes/intent/'):'intent ' + message.topic.rpartition('/')[-1])

    if 'rhasspy/de/transition/MaryTTSSentenceSpeaker' == message.topic:
        state = str(message.payload.decode("utf-8"))
        if 'speaking' == state:
       elif 'ready' == state:
  'speaking done')

if __name__ == '__main__':
    logging.basicConfig(filename='test.log', level=logging.INFO)
    power = LED(5)


    client = mqtt.Client('my_pi')
    client.connect(MQTT_IP, port=MQTT_PORT)
    client.on_message = on_message
    client.subscribe('rhasspy/de/transition/MaryTTSSentenceSpeaker')'starting pixels')

    while True:
        except KeyboardInterrupt:
1 Like

Yes HLC works with snips (and now Alice) Hermes topics. Actually they are not all published by rhasspy so obviously hlc can’t get the messages. Should be ok when rhasspy publish all of them.

Tell me, where did you add this so that it could run my python script to turn on the LEDs? project-alice-assistant/HermesLedControl does not work with respeaker core v2 and therefore I am looking for another way. My LEDs are turned on by this pixel_ring project, but you need to somehow run this script or just make one file as you indicated and have the LEDs turn on

I figured out this difficult task myself and I published the solution here