Este módulo está en desarrollo.
[] ( https://raw.githubusercontent.com/devilpro1/MMM-Alexa/master/resources/Alexa.png )
MMM-Alexa
is an embedded Alexa echo on MagicMirror.
This v1 is only audio reponse. I will work around visual and audio reponse soon (v2)
MagicMirror v2.14.00 and more MMM-Detector module for activating
cd ~/MagicMirror/modules
git clone https://github.com/devilpro1/MMM-Alexa
cd MMM-Alexa
npm install
See this wiki
This generator will allow to link MMM-Alexa to your amazon account. It will return the initial code for your module configuration (InitialCode).
This code is needed for get the token of AVS (Alexa Voice Service)
To make simple things I have code an HTML page (designed by @2hdlockness) you can get this code there
Notes:
deviceSerialNumber
is set by default to1234
, you can use this value, it's not really important When you have this code past it in the same document with CliendID, client Secret, ProductID ! {.is-info}
You can't now past all value in config ! {.is-success}
{
module: "MMM-Alexa",
position: "top_left",
configDeepMerge: true,
config: {
avs: {
ProductID: "Mirror",
ClientID: "amzn1.application-oa2-client.XXX",
ClientSecret: "XXX",
InitialCode: "XXX",
deviceSerialNumber: 1234
}
}
},
This configuration is equal to the
minimal configuration
and reserved for tunning {.is-info}
{
module: "MMM-Alexa",
position: "top_left",
configDeepMerge: true,
config: {
debug: false,
useStatus: true,
useChime: true,
avs: {
ProductID: "Mirror",
ClientID: "amzn1.application-oa2-client.XXX",
ClientSecret: "XXX",
InitialCode: "XXX",
deviceSerialNumber: 1234,
redirectUri: "https://devilpro1.github.io/MMM-Alexa/index.html"
},
micConfig: {
sampleRate: "16000",
channels: "1",
exitOnSilence: 15,
speechSampleDetect: 2000,
device: "default"
},
NPMCheck: {
useChecker: true,
delay: 10 * 60 * 1000,
useAlert: true
}
}
},
In a lot of my new modules you can see this in the module configuration But what is it !?
Since MagicMirror v2.13.0 I have coded in main core of MagicMirror this function It's allow to use internal module configuration and replace ONLY need part by your own. So copy and past an advanced (complete) configuration is not a good choice ;) Just modify your desired part!
when I register my developer account, in console and Initial Code Generator, i have set this value: Product ID => Mirror deviceSerialNumber => 1234 redirect url => https://devilpro1.github.io/MMM-Alexa/index.html Client ID => amzn1.application-oa2-client.XXXYYYZZZ Client Secret => XYYYRZZAXX InitialCode => XAAZRTTXX
With compare only 3 things are different: Client ID
, Client Secret
and InitalCode
so, you can just make this purpose in AVS: {}
avs: {
ClientID: "amzn1.application-oa2-client.XXXYYYZZZ",
ClientSecret: "XYYYRZZAXX",
InitialCode: "XAAZRTTXX"
},
configMergeDeep function will transform automaticaly avs:{}
with:
avs: {
ProductID: "Mirror",
ClientID: "amzn1.application-oa2-client.XXXYYYZZZ",
ClientSecret: "XYYYRZZAXX",
InitialCode: "XAAZRTTXX",
deviceSerialNumber: 1234,
redirectUri: "https://devilpro1.github.io/MMM-Alexa/index.html"
},
configMergeDeep is a magician !
- I assume you use only the
Minimal Configuration
- So just add the needed value to change like this (with the Minimal config).
- And MagicMirror will merge your configuration to the internal default configuration :)
{
module: "MMM-Alexa",
position: "top_left",
configDeepMerge: true,
config: {
avs: {
ProductID: "Mirror",
ClientID: "amzn1.application-oa2-client.XXX",
ClientSecret: "XXX",
InitialCode: "XXX",
deviceSerialNumber: 1234
},
audioConfig: {
useChime: false,
},
},
field type default value debug BOOLEAN false
When you set debug
to true
, detailed log will be recorded. When you don't want log, set it to false
field type default value useStatus BOOLEAN true
- useStatus: Display Alexa icon status
field type default value useChime BOOLEAN true
- useChime : If you don't want the beeping on status changed, set this to
false
.
field (- subFiled) type default value avs OBJECT { ... } - ProductID TEXT "Mirror" - CliendID TEXT "amzn1.application-oa2-client.XXX" - ClientSecret TEXT "XXX" - InitialCode TEXT "XXX" - deviceSerialNumber NUMBER 1234 - redirectUri TEXT "https://devilpro1.github.io/MMM-Alexa/index.html"
- ProductID: The ProductID from Developer console of amazon developer
- CliendID: The ClientID from Developer console of amazon developer
- ClientSecret: The Client Secret from Developer console of amazon developer
- InitialCode: The resulat code from Code Generator
- deviceSerialNumber: The deviceSerialNumber Set with Code Generator (1234 will be fine)
- redirectUri: The url of the Code Generator
field (- subFiled) type default value micConfig OBJECT { ... } - sampleRate NUMBER 16000, - channels NUMBER 1 - exitOnSilence NUMBER 15 - speechSampleDetect NUMBER 2000 - device STRING default
- sampleRate: audio sample rate (you don't have to change this!)
- channels: number of channels (you don't have to change this!)
- exitOnSilence: number of frame checked as silence before exit
- speechSampleDetect: number of sample checked for detection of voice
device
: recording device(microphone) name of your environment. (e.g."default"
is better way with pulse audio)
Generaly, you don't have to copy/past or modify this part {.is-warning}
Generaly, you don't have to copy/past this part {.is-info}
field (- subFiled) type default value NPMCheck OBJECT { ... } - useChecker BOOLEAN true - delay NUMBER 10 * 60 * 1000, - useAlert BOOLEAN true
- useChecker: Allow to check any update of @bugsounet npm libraries
- delay: delay of check update in ms (default: 10 mins)
- useAlert: if true, i will use
alert
module; if false, it will use MMM-UpdateNotification module of @bugsounet
One library from @devilpro1 and two from @bugsounet
cd ~/MagicMirror/modules/MMM-Alexa
npm run update
- MagicMirror : 2.14.0
- RPI 3b+ / raspbian 10 (buster)
- debian 10
- Author :
- @devilpro1
- Former creator @bugsounet
- License : MIT
Donate, if you love this module !
- @2hdlockness for design of alexa website.