Read the statement by Michael Teeuw here.
MMM-GoogleAssistant and LED Lights
-
@Pyroson u will need a module, with a node_helper to talk to the gpio pins, as u can’t do that from the modulename.js as it runs in the browser.
there might be a generic module to twiddle the LEDs.
-
@Pyroson here is a module that turns off/on LEDs on gpio
https://github.com/idoodler/MMM-RPI-LED
you could extend that to twiddle the lights like u need
-
curious to this aswell as i have the ReSpeaker 4 mic array with 12 leds and i was trying to do the same… as far as i know theres 4 stage: wake up, listen, think and speak. i have sample python scripts for each stage with a corresponding light patternand im still looking to see if i can figure it out where to call them from but no joy yet! :/
for me when looking through @Bugsounet code, it all appears on one line (no line breaks) and is pretty hard to try and read… is this on purpose and the same for all?
thanks
-
@banbutcher python will have to be called from a node_helper as well, as u can’t exec code from a browser.
there are all kinds of examples of this.
his code is minified, makes it faster to execute, and harder to take.
-
my code is protected, you can’t modify it.
If you modify it, MM will close (self protected of GA/A2D)I will explain to you tomorrow how you can do
If you have some python code, you can do it with GA (GA have some trigger on every events and you can use it) -
Thanks guys
-
I have write a special
recipe
for you, with the latested version of MMM-GoogleAssistant :)the
recipe
name iswith-status.js
(locating: with the latest version of GA in recipes directory)- How it’s works ?
GA will send the status (stand-by, listen, …) to your wanted file
/** with-status.js **/ /** send the status of assistant to a python script **/ /** For LED Strip for example **/ /** @bugsounet **/ var recipe = { commands: { "Status": { shellExec: { exec: (param) => { return "python /home/pi/myscript.py " + param.status.actual } } } }, plugins: { onStatus: "Status" }, } exports.recipe = recipe
I have defined in the
with-status.js
sample
to run this command :python /home/pi/myscript.py Status_of_GA
- Status_of_GA can be :
- listen
- standby
- confirmation
- reply
- error
- hook
- You can change the name and the path of the script (I don’t force it) and can be and bash script or other
- How load this recipe ?
in GA configuration, you have an recipe field
just add it :)
samples :
-
recipes: [ "with-status.js" ],
-
recipes: [ "with-status.js", "with-MMM-TelegramBot.js" ],
for some other recipe needed
- How it’s works ?
-
cool, thanks a lot for this, im looking forward to trying some stuff out! :)
-
@Bugsounet
Hi guys, i’m new to python and i’m not sure how I would create a script that would turn on different GPIO pins depending on the GA staus. If someone could point me in the right direction that would be awesome! -
@CallanPiper i have the same request.