HermesLedControl

OK, thanks for your explanation.
The HLC-Topics are created on my correct mqtt-broker.

Maybe I should alter my question more precisely:
Should something happen inside these topics, wenn HLC is active?
If not, what must be sent (for example) with the topic " mqtt.0.hermes.leds.onMessage" that sometings happen with the LED-ring?

Nothing have to be sent to have the led on when service starts.
HLC doesn’t send anything on mqtt, it just listen on some topics to give a visual feedback.

Here are all the topics used by HLC, and the full documentation: https://github.com/project-alice-assistant/HermesLedControl/wiki/MQTT-Topics

Maybe you could try debug mode. Never had too, leds just lights on when starting the service: https://github.com/project-alice-assistant/HermesLedControl/wiki/Run-in-debug-mode

And once more, actual version of rhasspy doesn’t publish every hermes topics so it doesn’t work actually. Just get the led on, I get the wakeword detected animation, but after that nothing, it stay in this state until I restart the service.

So, pretty unusable with actual rhasspy, but having it set on the rpi, it should begin to work without doing anything when we update to rhasspy version with all hermes topics.

OK, thanks again.
That completely answers my question.
I will wait for a rhasspy-version with the hermes-topics.

Hi,

Is HermesLedControl working on an docker install of rhasspy ?

I got this error after the installation of HLC

Jun 11 18:23:57 raspberrypi systemd[1]: Started Hermes Led Control.
Jun 11 18:23:58 raspberrypi python3[1293]: Starting Hermes Led Control v. 2.0.6
Jun 11 18:23:58 raspberrypi python3[1293]: Initializing HermesLedControl
Jun 11 18:23:58 raspberrypi python3[1293]: Initializing Rhasspy settings
Jun 11 18:23:58 raspberrypi python3[1293]: Loading configurations
Jun 11 18:23:58 raspberrypi python3[1293]: Error loading configurations: 'mqtt'
Jun 11 18:23:58 raspberrypi systemd[1]: hermesledcontrol.service: Succeeded.
Jun 11 18:24:01 raspberrypi systemd[1]: Started Session c2 of user pi.
Jun 11 18:24:03 raspberrypi systemd[1]: hermesledcontrol.service: Service RestartSec=5s expired, scheduling restart.
Jun 11 18:24:03 raspberrypi systemd[1]: hermesledcontrol.service: Scheduled restart job, restart counter is at 18.
Jun 11 18:24:03 raspberrypi systemd[1]: Stopped Hermes Led Control.

Did we have to install mosquito or something else ?

Yes, it is running

Yes, you have to install a mqtt broker (e.g. mosquitto) in order to get access to the intents

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