Recpie Question?
-
Hi guys i wrote a Recpie but if i start MM Fatal error recepie ligtcontrol.py come on the display
i checked my recpie but cant finde the mistake can you guys spot it?
//Backgroundlightning v.1 var recipe = { transcriptionHooks: { "GA_GPIO_true": { pattern: "licht bitte ein", command: "GA_GPIO_true" }, "GA_GPIO_false": { pattern: "licht bitte aus", command: "GA_GPIO_false" }, }, commands: { "GA_GPIO_true": { soundExec: { chime: "open", }, shellExec: { exec: "/home/pi/MagicMirror/lighton.py" } }, "GA_GPIO_false": { soundExec: { chime: "close", }, shellExec: { exec: "/home/pi/MagicMirror/lightoff.py" } }, } } exports.recipe = recipe // Don't remove this line.
Edit [@bugsounet]: add js code tag
-
my goal with this recpie is to say “licht bitte ein” and it starts a pythonscript
-
naturally it’s possible !
but it’s need some manipulation
-
what i have to add or change?
-
- ask the assistant to repeat the desired sentence
sample:
Jarvis (or ok google) … repeat afte me: licht bitte ein“repeat after me” or equal in your language
- turn off your mirror
- navigate to : ~/MagicMirror/modules/MMM-GoogleAssistant/tmp
you will see and.mp3
file
you can play it … Wow ! it’s the last reponse of google !!! - copy this file to an usb key (or transfert it with ftp or else …)
- go to your computer
- open with an sound editor
- delete the not needed content (“You have says …” in english)
- save your new mp3 file
Repeat it for next recipe response
when done … I will explain what you have to add in your recipe
just beep mewhen done humm… 95% of job done !
-
- upload for mp3 files to
~/MagicMirror/modules/MMM-GoogleAssistant/resources
directory - now we don’t use
chime
feature insoundExec
. We will usesound
! - transform
chime
tosound
From:
... soundExec: { chime: "open", }, ...
to:
... soundExec: { sound: "you file.mp3", }, ...
- save your recipe !
- restart your mirror !
- ‘et voila!’
- upload for mp3 files to
-
I just see that is not your question
you have forget the
python
command !//Backgroundlightning v.1 var recipe = { transcriptionHooks: { "GA_GPIO_true": { pattern: "licht bitte ein", command: "GA_GPIO_true" }, "GA_GPIO_false": { pattern: "licht bitte aus", command: "GA_GPIO_false" }, }, commands: { "GA_GPIO_true": { soundExec: { chime: "open", }, shellExec: { exec: "python /home/pi/MagicMirror/lighton.py" } }, "GA_GPIO_false": { soundExec: { chime: "close", }, shellExec: { exec: "python /home/pi/MagicMirror/lightoff.py" } }, } } exports.recipe = recipe // Don't remove this line.
don’t forget to verify if the path is correct of
exec
is correctin all case you can tunning the response !
-
This post is deleted! -
it worked out
thx very much
-
just a Question because im interested i have an idea to make PIR sensor who detects me and triggers GA to say: “Hello How are you”
is that possible?
with the recepies? -
its like revers what i did. i have to read a GPIO to turning HIGH and after it triggers GoogeAssistans to say something.
Or i write a recpie who autostart a script. the main function of the scrip is waiting to turn a GPIO HIGH. If a GPIO is HIGH it starts a mp3 file
maybe a easier way? -
This post is deleted! -
This post is deleted! -
-
Hello @bugsounet. I hope you are well. I did all steps you mention above for vocal answers in the recipes but besides that they all work fine GA does not answer accordinly Please Check the recipe for possible error. Thanks in advance
var recipe = { transcriptionHooks: { "redfm": { pattern: "play red fm", command: "red fm" }, "athensdeejay": { pattern: "play athens deejay", command: "athens deejay" }, "sferafm": { pattern: "play sfera fm", command: "sfera fm" }, "rebelfm": { pattern: "play rebel fm", command: "rebel fm" } }, commands: { "red fm": { notificationExec: { notification: "EXT_RADIO-START", payload: (params) => { return { img: "modules/EXT-RadioPlayer/Logos/GR/redfm.jpeg", link: "https://stream.radiojar.com/redfm963" } } }, displayResponse: true, soundExec: { sound: "modules/MMM-GoogleAssistant/resources/answers/enjoy.mp3" } }, "sfera fm": { notificationExec: { notification: "EXT_RADIO-START", payload: (params) => { return { img: "modules/EXT-RadioPlayer/Logos/GR/sfairafm.png", link: "http://sfera.live24.gr:80/sfera4132" } } }, displayResponse: true, soundExec: { sound: "modules/MMM-GoogleAssistant/resources/answers/enjoy.mp3" } }, "athens deejay": { notificationExec: { notification: "EXT_RADIO-START", payload: (params) => { return { img: "modules/EXT-RadioPlayer/Logos/GR/athensdj.png", link: "http://netradio.live24.gr:80/athensdeejay" } } }, displayResponse: true, soundExec: { sound: "modules/MMM-GoogleAssistant/resources/answers/enjoy.mp3" } }, "rebel fm": { notificationExec: { notification: "EXT_RADIO-START", payload: (params) => { return { img: "modules/EXT-RadioPlayer/Logos/GR/rebelfm.png", link: "http://netradio.live24.gr/rebel1052" } } }, displayResponse: true, soundExec: { sound: "modules/MMM-GoogleAssistant/resources/answers/enjoy.mp3" } } } } exports.recipe = recipe
-
Hi, set
displayResponse: false,
displayResponse: true,
: will display in visual and play vocal purpose by google. So, in your case … it’s not needed -
OK but i change that in a try to make it work. So the problem is something else because GA does not reply to me when it opens the station
-
ah, sound feature not set correctly
the path is already set from
modules/MMM-GoogleAssistant/resources/
in main core
so just set it like this :sound: "answers/enjoy.mp3"
(if your sound inresources/answers
of GA directory and namedenjoy.mp3
) -
Thank you so much. Possibly you already know it but I would like to inform you that I had my paypal set up again and made a donation to your project.
-
Just see, Thanks
why ? I have renew my computer this week (UEFI… multi OSs / dual boot take me head !
)
-