What's the craziest thing you can or cannot do with Rhasspy?

I used rhasspy to replace what I initially did with snips.

Currently I use nearly all cloud free software, with the only exceptions being a xiaomi/roborock cleaning robot and a xiaomi air cleaner I brought from China.

I use homeassistant as a “hardware abstraction” and nodered to build more complex automations. I couple rhasspy with homeassistant through nodered to also handle a bit more complex intents. There are probably better ways to do that but it works for me.

For the craziest things:

  • I coupled signal messenger through nodered with rhasspy, so I can text or voice message my flat with commands and get the response back as a message from everywhere
  • I kinda hacked the intercom of the house I live in (there was a youtube video where somebody reversed it with some arduino code) and can tell my flat via signal to press the buzzer to let me in or to turn my nuki smart lock in the same way so I don’t need to carry any keys.
  • I managed to build in selective room cleaning with some node red sorcery so I can tell the roborock robot to clean specific rooms.
  • I have a robot hand and robot arm that just do some stupid tricks when I tell something to rhasspy
  • I put zigbee rgb lights everywhere in the flat and can just control them (probably what everybody else does)
  • the craziest thing for me is that this all works offline (except sending signal messages) and with open source software. I created a flow in nodered that updates the slots with devices that are available in homeassistant and retrains rhasspy, so I don’t need to do much when I add new devices in homeassistant.
2 Likes

So I have done a few things and am working on others. This post is a combo of both. I currently control all of the HA functions in my house using Alexa and node-red. I am in the middle of converting from Alexa to Rhasspy. But I sill want to ask Alexa questions and have her answer them if they are not HA related. But I do not want any Echos in the house. I am working on forwarding Rhasspy commands that are not recognized to Alexa and having Rhasspy recite the answer back. I have this working. So if I ask Rhasspy “what is the population of Athens”, the command will not be recognized and node-red will forward it to alexa. Then node-red captures the response from Alexa and sends it to the Rhasspy satellite.

Some of my requests are HA informational requests and not action requests. For example, I maintain state of all of my lights in the house. I can ask Rhasspy “what lights are on?”, and node-red runs the code and Rhasspy responds back with audio of the list of lights that are currently on.

I am also building some voice recognition models using edgeimpulse.com. So far I have had some fairly good success.

4 Likes

Can you please give us some more (detailed) instructions, on how you forward and receive requests to alexa?

slot_programs/albums:

#!/usr/bin/env python3

import requests

SERVER="http://YOUR_KODI_URL:8080"
USERNAME="XXX"
PASSWORD="YYY"

client = requests.Session()
client.auth = (USERNAME, PASSWORD)
client.headers.update({"Content-Type": "application/json"})

url = SERVER + '/jsonrpc'

albums = client.post(url, data='{"jsonrpc": "2.0", "method": "AudioLibrary.GetAlbums", "params":{"allroles": true}, "id": 1}').json()
for album in albums['result']['albums']:
    if any(el in album['label'] for el in ['[', ',', '$']):
        continue
    print("(" + album['label'] + "):" + str(album['albumid']))

slot_programs/artists:

#!/usr/bin/env python3

import requests

SERVER="http://YOUR_KODI_URL:8080"
USERNAME="XXX"
PASSWORD="YYY"

client = requests.Session()
client.auth = (USERNAME, PASSWORD)
client.headers.update({"Content-Type": "application/json"})

url = SERVER + '/jsonrpc'

artists = client.post(url, data='{"jsonrpc": "2.0", "method": "AudioLibrary.GetArtists", "params":{}, "id": 1}').json()
for artist in artists['result']['artists']:
    if ',' in artist['artist']:
        continue
    print("(" + artist['artist'] + "):" + str(artist["artistid"]))

slot scripts in HA:

PlayArtist:
  action:
  - service: script.play_artist
    data:
      artist_id: "{{ artistid }}"
      volume: "{{ volume if volume is defined else '0.3' }}"
PlayAlbum:
  action:
  - service: script.play_album
    data:
      album_id: "{{ albumid }}"
      volume: "{{ volume if volume is defined else '0.3' }}"

Home Assistant script play_album:

play_artist:
  alias: Play shuffle artist
  variables:
    artist_id: ''
  sequence:
  - alias: Play Artist
    service: media_player.play_media
    data:
      entity_id: media_player.kodi
      media_content_type: artist
      media_content_id: '{{ artist_id }}'
  - service: media_player.shuffle_set
    data:
      entity_id: media_player.kodi
      shuffle: true
  - service: media_player.volume_set
    data:
      entity_id: media_player.kodi
      volume_level: 0.3
  - service: switch.turn_on
    entity_id: switch.speakercontroloutlet
play_album:
  alias: Play an album
  variables:
    album_id: ''
  sequence:
  - alias: Play album
    service: media_player.play_media
    data:
      entity_id: media_player.kodi
      media_content_type: album
      media_content_id: '{{ album_id }}'
  - service: media_player.shuffle_set
    data:
      entity_id: media_player.kodi
      shuffle: false
  - service: media_player.volume_set
    data:
      entity_id: media_player.kodi
      volume_level: 0.3
  - service: switch.turn_on
    entity_id: switch.speakercontroloutlet

Sorry for the code dump on a forum. I should clean these things up and put them on Github. The ones powered by Jellyfin are even more ugly :slight_smile:

3 Likes

I was planning on trying something like that too, would be very interested in how you accomplished this.

I use node-red as an intermediary to communicate between Rhasspy and Alexa. Let me know if you are still interested and I will start a new thread. @romkabouter @schnopsi

1 Like

Still interested ;). Thx!

Yes please, I have NR running as well :slight_smile:

Thanks for sharing! Should give me a headstart on my jukebox.

1 Like