HermesLedControl

I’m not quite sure. But with a separate mqtt broker you will be on the safe side, also for any future application. It requires nearly no resources. Just do a simple linux installation since this is the easiest way. Not in docker since configuration is more complicated.

Ok i’will try this, thanks a lot

Edit : It works so nice thanks again !!

You can. You just need to map the ports from your rhasspy docker or , if you are deploying hermes_led_control as a docker container aswell, just link them in a docker compose file for example.
That will expose the internal mqtt broker.

1 Like

Sounds interesting. Do you have an example? Thank you

You can find an example for Node-RED and Rhasspy here. The same method works for linking other containers: they’re all in the same virtual network that Docker Compose creates and they can reach each other by their container name on their exposed ports.

Thank you very much. This information is extremely helpful

Since I could not find a docker image of hermes-led anywhere I made my own and postet it on their github. You can find it here if you are interested.

Daenara

1 Like

Hello,

I would like to know if there is a way to change the idle led status/animation trough MQTT ?
I yould like my automation system (Jeedom) to send various status to rhasspy/hermesLedControl by lighting the led with different patterns.
for example, if a mail was detected in my mail box light in yellow …
in red if my security alarm is activated…

Do you know how to do that ?
regards.

For anyone interested to get it running with the rhasspy docker image, the integrated MQTT broker and the HLC installscript, I’m using this docker-compose.yml for Rhasspy:

rhasspy:
  image: "rhasspy/rhasspy"
  container_name: rhasspy
  restart: unless-stopped
  volumes:
    - "$HOME/.config/rhasspy/profiles:/profiles"
    - "/etc/localtime:/etc/localtime:ro"
  ports:
    - "12101:12101"
    - "12183:12183"
  devices:
    - "/dev/snd:/dev/snd"
  command: --user-profiles /profiles --profile de
  dns: 192.168.0.242

The additional port is what you might mostly be interested in. :wink:

Additionally you need to tell HLC the MQTT target. Unfortunately it’s not possible to specify no config file. So I simply created a profile.json in HLC’s main folder:

{
  "mqtt": {
    "host": "127.0.0.1",
    "port": 12183
  }
}

Normally this configuration is being read from the profile.json of rhasspy. But if you’re using the internal broker there’s no MQTT section being written to the profile.json.

And last but not least this is my adjusted systemd unit file I’m using:

[Unit]
Description=Hermes Led Control

[Service]
WorkingDirectory=/home/pi/hermesLedControl_v2.0.9
ExecStart=/home/pi/hermesLedControl_v2.0.9/venv/bin/python3 main.py --pathToConfig=profile.json --engine=rhasspy --hardware=respeaker2 --pattern=projectalice
Restart=always
RestartSec=5
User=pi

[Install]
WantedBy=multi-user.target

Hope this helps someone. :slight_smile:

5 Likes

Hello,
I made modification inside the code to add a new topic to change idle status dynamically.
For now I’m able to set an animation or pattern for idle Status (and change it) through MQTT.
I also modify the Breath animation to pass it severals colors, and also to add a sleep after all (or one) color breath.

Hello,

Has anyone ever run the Google AIY leds on the Rhasspy installed?

The start configuration of the program: hermesledcontrol.service

ExecStart=/home/pi/hermesLedControl_v2.0.9/venv/bin/python3 main.py --engine=rhasspy
–pathToConfig=/home/pi/.config/rhasspy/profiles/fr/profile.json --hardware=googleAIY --pattern=kiboost

In the jeeRhasspy logs, I see :

[2020-12-07 13:49:19][DEBUG] : [jeerhasspyCmd] <execute> TTS-default.ledOn() | {"background":"0"}
[2020-12-07 13:49:19][DEBUG] : [jeerhasspyCmd] <setLEDs> 1 siteId: default
[2020-12-07 13:49:19][DEBUG] : [RhasspyUtils] <_request> POST | http://192.168.XXX.XXX:12101/api/mqtt/hermes/leds/toggleOn | {"siteId":"default"}
[2020-12-07 13:49:24][DEBUG] : [jeerhasspyCmd] <execute> TTS-default.ledOff() | {"background":"0"}
[2020-12-07 13:49:24][DEBUG] : [jeerhasspyCmd] <setLEDs> 0 siteId: default
[2020-12-07 13:49:24][DEBUG] : [RhasspyUtils] <_request> POST | http://192.168.XXX.XXX:12101/api/mqtt/hermes/leds/toggleOff | {"siteId":"default"}
[2020-12-07 13:51:20][DEBUG] : [jeerhasspyCmd] <execute> TTS-default.ledOn() | {"background":"0"}
[2020-12-07 13:51:20][DEBUG] : [jeerhasspyCmd] <setLEDs> 1 siteId: default
[2020-12-07 13:51:20][DEBUG] : [RhasspyUtils] <_request> POST | http://192.168.XXX.XXX:12101/api/mqtt/hermes/leds/toggleOn | {"siteId":"default"}
[2020-12-07 13:51:25][DEBUG] : [jeerhasspyCmd] <execute> TTS-default.ledOff() | {"background":"0"}

And service Hermesledcontrol logs :

déc. 07 14:47:54 raspberrypi python3[7549]: Starting Hermes Led Control v. 2.0.6
déc. 07 14:47:54 raspberrypi python3[7549]: Initializing HermesLedControl
déc. 07 14:47:54 raspberrypi python3[7549]: Initializing Rhasspy settings
déc. 07 14:47:54 raspberrypi python3[7549]: Loading configurations
déc. 07 14:47:54 raspberrypi python3[7549]: Error loading configurations: 'mqtt'

Any idea for Error loading configurations: ‘mqtt’ ?

This helped me to get it working with my Respeaker 4. The shell script in the wiki did not work on my raspberry pi4 and was not creating the configuration correctly.

I manually created a folder under pi/home/hermesLedControl with a configuration.yml file and the profile.json example that you provided. Added the link to profile.json in the config file:

pathToConfig=‘profile.json’

Opened the 12183 port of the Rhasspy image in docker and those lovely LEDS came into action.

Spent so much time on it this weekend and had almost given up home so thank you!

1 Like

I’ve detailed how I got past this using the post from @Armadillo. Let me know if I can help you further

Thank you, work great

1 Like

I use a Raspberry Pi 4B with a ReSpeaker 4 and “installed” Rhasspy via docker.

After that I installed HermesLedControl.
For some reason the wake word recognition is extremeley bad now and it seems HermesLedControl consumes a lot of CPU.

Has someone else reached better results? If yes, how?

Did you activate the DoA (Detection Of Arrival) function in Hermes Led Control?
It’s very resources greedy and I can imagine it causes the behaviour…

Yes, I activated DoA. After disabling DoA, it works. Thank you!

I had some problems. So I post the commands/settings I use:

sudo ./hlc_download.sh
2 (rhasspy)
/home/pi/.config/rhasspy/profiles/de/profile.json (path to assistant config file)
#2 (respeaker4)
#1 (google)
#/home/pi/.config/hermesLedControl (where configuration saved)
#2 (no DoA)
#1 (yes - install respeaker4)

# here the HLC script skiped because of kernel issues. so install it manually again:
git clone https://github.com/respeaker/seeed-voicecard
cd seeed-voicecard
sudo ./install.sh --compat-kernel
sudo reboot

Is there an overview about the difference of the HCL led patterns (google, alexa, …)?

No idea, but you can easily try them.
In the configuration file you can specify which animation HLC should use, just restart the service and test.

AFAIR on the wiki on the github page there is also a more detailed description of all animations and how you can customize your own!

Hi Guys, I am trying HermesLedControl on my 2 satellite RasPi’s, and have a couple of questions…

After a couple of issues (including HLC defaulting to the wrong MQTT port) it is flashing beautifully on the RasPi 3B with reSpeaker 4-mic HAT. :smiley: :heart_eyes:

  1. The wiki on the project-alice github leaves out more than it answers. Should I ask questions and make documentation suggestions by raising github issues, or is there a more appropriate forum than here ?

  2. Unfortunately the RasPi Zero W with Adafruit Voice Bonnet (which I believe is functionally identical to reSpeaker 2-mic HAT) appears to be receiving MQTT messages, but showing messages like “On play finished received but it wasn’t for me”

/etc/systemd/system/hermesledcontrol.service contains

[Unit]
Description=Hermes Led Control

[Service]
WorkingDirectory=/home/don/hermesLedControl_v2.0.15
ExecStart=/home/don/hermesLedControl_v2.0.15/venv/bin/python3 main.py --hermesLedControlConfig=/home/don/.config/hermesLedControl/configuration.yml
Restart=always
RestartSec=5
User=don

[Install]
WantedBy=multi-user.target

/home/don/.config/hermesLedControl/configuration.yml contains:

engine: "rhasspy"
pathToConfig: "/home/don/.config/rhasspy/profiles/en/profile.json"
hardware: "respeaker2Mics"
pattern: "google"
enableDoA: false
debug: True
endFrame: 0 

and the Rhasspy profile is:

{
    "dialogue": {
        "volume": "0.5"
    },
    "handle": {
        "satellite_site_ids": "sat-2",
        "system": "hass"
    },
    "home_assistant": {
        "access_token": "eyJ0eXAiOiJKV1Qi … PH_CoQYsJa00b_-sd8",
        "url": "http://192.168.1.98:8123/"
    },
    "intent": {
        "system": "hermes"
    },
    "microphone": {
        "arecord": {
            "device": "plughw:CARD=seeed2micvoicec,DEV=0",
            "siteId": "sat-2",
            "udp_audio_port": "12203"
        },
        "system": "arecord"
    },
    "mqtt": {
        "enabled": "true",
        "host": "192.168.1.98",
        "port": "1883",
        "password": "passwd",
        "site_id": "sat-2",
        "username": "rhasspy"
    },
    "sounds": {
        "aplay": {
            "device": "plughw:CARD=seeed2micvoicec,DEV=0",
            "volume": "0.5"
        },
        "system": "aplay"
    },
    "speech_to_text": {
        "system": "hermes"
    },
    "text_to_speech": {
        "satellite_site_ids": "sat-2",
        "system": "hermes"
    },
    "wake": {
        "porcupine": {
            "udp_audio": "12203"
        },
        "system": "porcupine"
    }
}

On the RasPi Zero (siteId “sat-2”), journalctl -u hermesledcontrol.service gives (with date/time stamps removed for readability) …

[MainThread] - [INFO] - Initializing HermesLedControl
[MainThread] - [INFO] - Initializing Rhasspy settings
[MainThread] - [INFO] - Loading configurations
[MainThread] - [INFO] - Loaded 14 hardware references
[MainThread] - [INFO] - - Mqtt server set to 192.168.1.98
[MainThread] - [INFO] - - Mqtt port set to 1883
[MainThread] - [INFO] - - Mqtt username set to rhasspy
[MainThread] - [INFO] - - Mqtt password set to "hidden"
[MainThread] - [INFO] - - Client id set to sat-2
[MainThread] - [INFO] - - Hardware set to ReSpeaker 2-Mics
[MainThread] - [INFO] - - Using google as pattern with 3 leds
[MainThread] - [INFO] - Initializing leds controller
[MainThread] - [INFO] - Hermes Led Control started
[Thread-4] - [DEBUG] - New animation <bound method GoogleHomeLedPattern.wakeup of <ledPatterns.GoogleLedPat
[Thread-4] - [DEBUG] - Timeout is setting duration from 0 to 120
[Thread-4] - [DEBUG] - New animation <bound method GoogleHomeLedPattern.idle of <ledPatterns.GoogleLedPatte
[Thread-3] - [DEBUG] - On hotword triggered
[Thread-3] - [DEBUG] - New animation <bound method GoogleHomeLedPattern.wakeup of <ledPatterns.GoogleLedPat
[Thread-3] - [DEBUG] - Timeout is setting duration from 0 to 120
[Thread-3] - [DEBUG] - On play finished received but it wasn't for me
[Thread-3] - [DEBUG] - On hotword toggle on triggered

I have tried to simplify the config files by reducing fields duplicated in multiple files.

SiteId is specified in ~/.config/rhasspy/profiles/en/profile.json"; but does “–clientId:” also need to be specified in ~/.config/hermesLedControl/configuration.yml" ?