It will allows to take selfies with a webcam.
This module is an Extented plugins for MMM-GoogleAssistant
In addition, you can use others EXT plugin to control it or add some pretty plugins:
EXT-SelfiesSender
: For sending to TelegramBot, GooglePhotos or by mail your selfies resultEXT-SelfiesFlash
: For turn on/off automaticaly a flash lightEXT-SelfiesViewer
: For displaying your selfies result on the screenEXT-Alert
: For display some information or error on your screen (Optional)Clone the module into your MagicMirror module folder and execute npm intall
in the module's directory.
cd ~/MagicMirror/modules
git clone https://github.com/bugsounet/EXT-Selfies
cd EXT-Selfies
npm install
To display the module insert it in the config.js file.
{
module: 'EXT-Selfies',
position: 'top_left',
config: {
debug: false,
captureWidth:1280,
captureHeight:720,
device: null,
usePreview: true,
previewWidth:640,
previewHeight:360,
displayButton: true,
buttonStyle: 0,
buttons: {
1: "master.png",
2: "halloween.png",
3: "birthday.png",
4: "christmas.png"
},
blinkButton: false,
playShutter: true,
resultDuration: 1000 * 10,
autoValidate: true,
counterStyle: 0,
showResult: true
}
},
Option Description Type Default debug Enable or not the Debug mode Boolean false captureWidth Width of captured image Number 1280 captureHeight Height of captured image Number 720 device Default camera name (see bellow) String or null null usePreview Display webcam preview when taking selfie Boolean true previewWidth Width of preview camera window Number 640 previewHeight Height of preview camera window Number 360 displayButton Display button to press for take a selfie Boolean true buttonStyle Choose style of the button (see bellow) Number or Array 0 buttons Define any buttons (see bellow) Object blinkButton Need to Blink button? Boolean false playShutter Play shooter when taking a selfie? Boolean true resultDuration How long to display the selfie result? (in ms. default is 10 sec) Number 10000 autoValidate Validate automaticaly the selfie (by using false
it will use touch-screen functionality for validate)Boolean true counterStyle Style of the count down before take a selfie (see bellow) Number 0 showResult Show the result of the selfie Boolean true
device
feature is only used ifusePreview
is not used (false
)
->
null
value should works at 99% of case if you have only one intalled camera.
-> See the backend log to get your installed camera name (with debug mode activated)
->EXT-Selfies
will tell you the list of camera installed, just report it indevice
sample:device: "/dev/video1",
You can configure your own button !
Just upload your new button in resouces
directory of EXT-Selfies
Add it in your configuration
Sample:
buttons: {
1: "master.png",
2: "halloween.png",
3: "birthday.png",
4: "christmas.png",
5: "MyOwnButton.png" // this is my new button !
},
With this config, you have visual choice button!
butonStyle: 0,
: mini button with the result of font-awesome icon camerabutonStyle: 1,
:butonStyle: 2,
:butonStyle: 3,
:butonStyle: 4,
:You can again choose some buttons and blink it one by one!
butonStyle: [1,2,3,4]
in this case, EXT-Selfies
will display button 1 after button 2 after button 3 ... (with a blink)
we code some counter Style
counterStyle: 0,
: It's the default count with a minimal animate
counterStyle: 1,
: It's a google style counter (full animated and need a pi4!)
counterStyle: 2,
: It's a counter by using a point and transform it to a number (full animated and need a pi4!)
counterStyle: 3,
: It's a counter based to moving number (animated)
Let's test it ... and see any visual
MMM-GoogleAssistant
recipe for vocal controlA prepared recipe is inclued and waiting for your use
Just add it in the config of MMM-GoogleAssistant
recipes: [
"../../EXT-Selfies/recipe/EXT-Selfies.js"
],
recipes: [
"my_recipe.js",
"../../EXT-Selfies/recipe/EXT-Selfies.js"
],
[EN]
activate your mirror with your prefered keyword and just say:
take a selfie
: Assistant will open a new window to take a selfie
[FR]
Une commande est également disponible pour prendre un selfie.
Il suffit d'activer votre assistant avec votre mot clé préféré et dire:
prends un selfie
cd ~/MagicMirror/modules/EXT-Selfies
npm run update