Hello everyone,

I have used pimatic for several years now and I am a relatively new rhasspy user and I would like to share my settings to others to easyly integrate voicecontrol in your pimatic workflow.

Bild TextRhasspy is an open source, fully offline set of voice assistant services for many human languages.
https://rhasspy.readthedocs.io/en/latest/
https://www.youtube.com/watch?v=IsAlz76PXJQ

I have a connection to rhasspy through node-red by easy to use pimatic-nodes which call the api.
0_1618945356791_3476b94af6a5f193131a1b7e0044727026a9d9e4.png

Here is the node setup for it :

[{“id”:“b56e15b3.3ccbc8”,“type”:“websocket in”,“z”:“aaed059b.58cda8”,“name”:“rhasspy”,“server”:“63453288.fa038c”,“client”:"",“x”:70,“y”:340,“wires”:[[“d4b7ed96.952cb”]]},{“id”:“d4b7ed96.952cb”,“type”:“switch”,“z”:“aaed059b.58cda8”,“name”:“intent filter”,“property”:“intent.name”,“propertyType”:“msg”,“rules”:[{“t”:“eq”,“v”:“GetTime”,“vt”:“str”},{“t”:“eq”,“v”:“PimaticDevice”,“vt”:“str”},{“t”:“eq”,“v”:“SetVolume”,“vt”:“str”},{“t”:“eq”,“v”:“PimaticVar”,“vt”:“str”}],“checkall”:“true”,“repair”:false,“outputs”:4,“x”:230,“y”:340,“wires”:[[“8a77ee83.2a136”],[“af1a6eab.b3”],[],[“8f662ea3.5596f”]]},{“id”:“3cdc64ba.ce7c1c”,“type”:“http request”,“z”:“aaed059b.58cda8”,“name”:“text to speech”,“method”:“POST”,“ret”:“txt”,“paytoqs”:“ignore”,“url”:“http://yourrhasspyhost:12101/api/text-to-speech",“tls”:"",“persist”:false,“proxy”:"",“authType”:“basic”,“x”:680,“y”:220,“wires”:[[]]},{“id”:“f7f1aa3f.3cbca8”,“type”:“debug”,“z”:“aaed059b.58cda8”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:true,“complete”:“payload”,“targetType”:“msg”,“statusVal”:“payload”,“statusType”:“auto”,“x”:670,“y”:160,“wires”:[]},{“id”:“8a77ee83.2a136”,“type”:“function”,“z”:“aaed059b.58cda8”,“name”:"time text”,“func”:“var timeString = new Date().toLocaleTimeString([],\n{\n timeZone:“Europe/Berlin”,\n hour: “2-digit”, \n minute: “2-digit”,\n hour12: false\n})\n\nreturn {\n payload: “Es ist jetzt " + timeString\n}”,“outputs”:1,“noerr”:0,“initialize”:”",“finalize”:"",“libs”:[],“x”:500,“y”:200,“wires”:[[“f7f1aa3f.3cbca8”,“3cdc64ba.ce7c1c”]]},{“id”:“7d3dc201.fa32ec”,“type”:“rule action”,“z”:“aaed059b.58cda8”,“controller”:“505b6b31.6cc664”,“actionExpression”:"${ payload }",“messageOnError”:true,“name”:"",“x”:710,“y”:320,“wires”:[[“ebc3b01e.e3ccb”,“c8c030e5.1ad7f”]],“inputLabels”:["${ payload }"],“outputLabels”:[“msg.payload”]},{“id”:“af1a6eab.b3”,“type”:“template”,“z”:“aaed059b.58cda8”,“name”:"",“field”:“payload”,“fieldType”:“msg”,“format”:“handlebars”,“syntax”:“mustache”,“template”:“turn {{ slots.device }} {{ slots.state }}”,“output”:“str”,“x”:500,“y”:320,“wires”:[[“7d3dc201.fa32ec”]]},{“id”:“4bbe64c7.19c75c”,“type”:“debug”,“z”:“aaed059b.58cda8”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:true,“complete”:“payload”,“targetType”:“msg”,“statusVal”:“payload”,“statusType”:“auto”,“x”:890,“y”:400,“wires”:[]},{“id”:“ebc3b01e.e3ccb”,“type”:“debug”,“z”:“aaed059b.58cda8”,“name”:"",“active”:true,“tosidebar”:true,“console”:false,“tostatus”:true,“complete”:“payload”,“targetType”:“msg”,“statusVal”:“payload”,“statusType”:“auto”,“x”:890,“y”:280,“wires”:[]},{“id”:“35d78f2c.1e405”,“type”:“inject”,“z”:“aaed059b.58cda8”,“name”:"",“props”:[{“p”:“payload”},{“p”:“topic”,“vt”:“str”}],“repeat”:“60”,“crontab”:"",“once”:false,“onceDelay”:0.1,“topic”:"",“payload”:"",“payloadType”:“date”,“x”:230,“y”:420,“wires”:[[]]},{“id”:“8f662ea3.5596f”,“type”:“template”,“z”:“aaed059b.58cda8”,“name”:"",“field”:“payload”,“fieldType”:“msg”,“format”:“handlebars”,“syntax”:“mustache”,“template”:“set {{ slots.pivar }} to {{ slots.piwert }}”,“output”:“str”,“x”:500,“y”:400,“wires”:[[“3c60a0f8.50da”]]},{“id”:“c8c030e5.1ad7f”,“type”:“http request”,“z”:“aaed059b.58cda8”,“name”:“text to speech”,“method”:“POST”,“ret”:“txt”,“paytoqs”:“ignore”,“url”:“http://yourrhasspyhost:12101/api/text-to-speech",“tls”:"",“persist”:false,“proxy”:"",“authType”:“basic”,“x”:900,“y”:340,“wires”:[[]]},{“id”:“3c60a0f8.50da”,“type”:"rule action”,“z”:“aaed059b.58cda8”,“controller”:“505b6b31.6cc664”,“actionExpression”:"${ payload }",“messageOnError”:true,“name”:"",“x”:710,“y”:400,“wires”:[[“4bbe64c7.19c75c”]],“inputLabels”:["${ payload }"],“outputLabels”:[“msg.payload”]},{“id”:“63453288.fa038c”,“type”:“websocket-listener”,“path”:“ws://yourhost:12101/api/events/intent”,“wholemsg”:“true”},{“id”:“505b6b31.6cc664”,“type”:“controller”,“name”:“Pimatic”,“protocol”:“http”,“host”:“yourhost”,“port”:“80”,“path”:"",“username”:“yourusername”,“password”:“yourpw”}]

You have to insert your user, passwords, hosts etc. in the corresponding nodes.

For the configuration in Rhasspy I have “special” sentences to insert variables and build the commands for pimatic and slots for the devices and variable you want to call.

[GetTime]
wie spät ist es [(jetzt|momentan|gerade|aktuell|eigentlich)]
sag miir (die uhrzeit | wie spät es ist)
wie viel uhr (ist es|haben wir) [gerade]
wie ist die uhrzeit
welche uhrzeit haben wir [(gerade | aktuell)]

[PimaticDevice]
(schalte | mach) [die | der | das] $device{device} ((ein | an):on | aus:off){state}

[PimaticVar]
(setze | setze | stelle) [die | der | das] $pivar{pivar} auf (0…100){piwert} [grad | prozent]

Slots for device :

[device]
(verstärker | audio | lautsprecher):verstarker
(auto haustür):auto-haustur
stehlampe:steckdose10
arbeitsleuchte:S-20-001
(gute nacht):gute-nacht
(beamer | fernseher):beamer2

And slots for variables to set :

[pivar]
((heizung im bad) | (temperatur im bad) | badezimmertemperatur):$temp-soll

For the syntax of sentences and slots you can read here : https://rhasspy.readthedocs.io/en/latest/training/#basic-syntax

Both slots can be easyly expanded with all devices want to turn on or off, or variables you want to set.

In Pimatic there is nothing to configure.

Sorry for the content in german, hope it is helpful for some of you.
Feel free to ask questions or find mistakes :wink: