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! -