Read the statement by Michael Teeuw here.
MMM-GoogleAssistant and LED Lights
-
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.
-
see the top of this topic. you will have to construct some of it
-
@sdetweil yes i am using the recipe “with-status.js” but my question is how to use the status of GA in my python script or use different scripts on different status whichever is possible.
-
@Sihtodstel i dont know. as i said u will have to construct some of this.