-
Notifications
You must be signed in to change notification settings - Fork 8
How to Add new Commands and Actions #64
Comments
You might want to take a look at my fork https://github.com/drftg/MMM-Assistant as I have already extended this module a bit to be able to send Notifications to other modules in the form
but this only works via a snowboy hot word |
I have a few questions:
This is your config file....
|
This particular module does not have native support for added hot words in the way (we) would like. We are currently investigating how to make this more easy. For such an implementation I suggest to rather use MMM-voice which has this more clearly implemented. The problem is that we would like to be able to use Alexa, GA and MM control separately, but still in an easy way. @drftg has made some improvements and additions, but ultimately we will make a future release that better implement this. |
Okay, so if I'm understanding this correctly this module does not have the ability yet to have hot words like "Smart mirror next page" which intern will alter the MMM-Carousel module to go to the next page? It just has the ability to call GA, Alexa, and MM standard voice commands? |
@Adsouza98 Just a quick response. You can use a hot word for MMM-Carousel like this
|
When I use just that code you provided it reads my hot word but doesn't perform the action of simulating the right arrow key being pressed. Then gets stuck with a red recording icon. I've tried both KEYPRESSED and KEY_PRESSED my config:
|
Come on guys, you're making me cry! 😭 |
@Adsouza98 Sorry for the confusion. That config only works on my fork, not the original one. @E3V3A Sorry for making you cry. But sometimes that is exactly what I want; one hotword for one specific action. I agree that a "next page" hotword is not the best option but I myself am very happy with using a single hot word just to wake up the screen. |
@Adsouza98 Some explanation for the longer question you asked above.
Due to how MMM-Assistent was originally designed the commands defined by MMM-Assistant can only be reached by spoken word. The phrases are defined in translations/en.json etcetera. For example the line To make commands available with using just a hot word I extended the config so the commands are sent as notifications. Some are handled by MMM-Assistant itself like
and all others are sent to the rest of MagicMirror. So
This is the case described as
The modulemap was introduced because I found that the STT (Speech to text) engine did not always understand me correctly when pronouncing module names but also because module names are sometimes unpronounceable. Besides mapping the words that are "understood" in command mode to actual modules I also extended the functionality by mapping that to a set of modules. This makes it possible to actually define named pages. That, for me, makes modules like MMM-pages and MMM-Carousel obsolete. Now I can just ask my mirror to "show weather" and it will hide all modules except the ones I specified in modulemap after "weather". Also, although @E3V3A does not like that, you can use a specific hot word and send a
If you define the module "alert" in your config, it will handle the notification "SHOW_ALERT". I gave the example below to show how that works. {notification: "SHOW_ALERT", parameter: {type: "notification", title: "Important message!", message: "we are awake"}} where
|
@drftg Honestly all I want is to be able to say "smart mirror next page" or "next page" which then sends a notification to the MMM-Carousel module (or all modules) simulating a right key press and vice-versa with previous page 😭. The MMM-Voice/MMM-Lucy module does offer page views this but it's supper laggy on my PI 3. The MMM-Assistant voice recognition works simultaneously with my voice which is why I want to use this module. How would I accomplish this with the standard eouia Assistant module? Sorry for so many questions, and taking up your time. |
Then just follow @drftg fork. The reason this module has not yet implemented it that way, is because we want to also be able to control both the MM and/or the module using other methods, such as ultrasound , PIR, GPIO buttons etc. The programming would quickly get out of control and very disorderly, and would agian make also this module laggy! So we solve one problem at the time and compartmentalize the development. You user scenario is definitely important, and is why I labelled this issue as it is. |
Hey, I was wondering where the getCommands function and Action function are suppose to be declared.
Are they suppose to be declared inside the MMM-Assistant module for the config.js or in a separate file?
Also I was hoping someone can show me a simple example of how to create the function call to another module. (Example: change the text of hello world).
Just installed Magic Mirror last week and this is my first Github question, so sorry if formatting is horrendous.
The text was updated successfully, but these errors were encountered: