HermesLedControl

Ok thanks for your response i’ll try that :heart:

Si the internal mqtt can’t be use for this

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!