• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Config File Help (Camera, Voice Control, Spotify)

Scheduled Pinned Locked Moved Unsolved Troubleshooting
4 Posts 2 Posters 888 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    ricardoyen
    last edited by sdetweil Nov 19, 2019, 12:22 PM Nov 19, 2019, 12:19 PM

    Hi All,

    Complete Newbie here, I have managed to install the following modules.

    Raspotify
    MMM-Spotify
    MMM-Remote-Control
    MMM-AlarmClock
    MMM-Hotword
    MMM-AssistantMk2

    and everything works, then I installed

    Camera, Voicecontrol, (created & retrieved the sound files, ShowCamera, HideCamera and Selfie) but I’m stuck now on the config file…

    and I’m not sure how to get the triggers to work !! ( Voice commands to work)

    I would like to do the following.

    1. Using MMM_AssistantMk2, control spotify
    2. Use the camera and voicecontrol

    Below is my Config.file, with location and ID omitted. Please help !!

    /* Magic Mirror Config Sample
     *
     * By Michael Teeuw http://michaelteeuw.nl
     * MIT Licensed.
     *
     * For more information how you can configurate this file
     * See https://github.com/MichMich/MagicMirror#configuration
     *
     */
    
    var config = {
    	address: "0.0.0.0", // Address to listen on, can be:
    	                      // - "localhost", "127.0.0.1", "::1" to listen on loopback interface
    	                      // - another specific IPv4/6 to listen on a specific interface
    	                      // - "", "0.0.0.0", "::" to listen on any interface
    	                      // Default, when address config is left out, is "localhost"
    	port: 8080,
    	ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1"], // Set [] to allow all IP addresses
    	                                                       // or add a specific IPv4 of 192.168.1.5 :
    	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.5"],
    	                                                       // or IPv4 range of 192.168.3.0 --> 192.168.3.15 use CIDR format :
    	                                                       // ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.3.0/28"],
    
    	language: "en",
    	timeFormat: 24,
    	units: "metric",
    
    	modules: [
    		{
    			module: "alert",
    		},
    		{
    		  module: "MMM-Spotify",
    		  position: "bottom_left",
    		  config: {
    		    style: "mini", // "default" or "mini" available
    		    control: "default", //"default", "hidden" available
    		    updateInterval: 1000,
    		    onStart: null, // disable onStart feature with `null`
    		    allowDevices: [], //If you want to limit devices to display info, use this.
    		    // allowDevices: ["RASPOTIFY", "My iPhoneX", "My Home speaker"],
    		  }
    		},
    		{
    			module: "updatenotification",
    			position: "top_bar"
    		},
    		{
    			module: "clock",
    			position: "top_left"
    		},
    		{
    			module: "calendar",
    			header: "SA Holidays",
    			position: "top_left",
    			config: {
    				calendars: [
    					{
    						symbol: "calendar-check",
    						url: "webcal://www.officeholidays.com/ics/ics_country.php?tbl_country=South%20Africa"					}
    				]
    			}
    		},
    		{   
    		    module: 'camera',
    		    position: 'top_center',
    		    config: {
    			selfieInterval: 3,  // Time interval in seconds before the photo will be taken.
    				emailConfig: {
    					service: 'Hotmail', // Email provider to use to send email with a photo.
    					auth: {
    						user: '<name@email.com>', // Your email account
    						pass: '<password>'        // Your password for email account
    					}
    				}
    		}		
    		},
    	
    		{
    			module: 'voicecontrol',
    			position: 'bottom_left',
    			config: {
    				models: [
    					{
    						keyword: "Show Camera",
    						description: "Say 'Show Camera' to display camera",
    						file: "ShowCamera.pmdl",
    						message: "SHOW_CAMERA"
    					},
    					{
    						keyword: "Hide Camera",
    						description: "Say 'Hide Camera' to hide camera",
    						file: "HideCamera.pmdl",
    						message: "HIDE_CAMERA"
    					},
    					{
    						keyword: "Selfie",
    						description: "Say 'Selfie' when camera is visible",
    						file: "Selfie.pmdl",
    						message: "SELFIE"
    					},
    				]
    			}
    		},
    		{
    	module: 'MMM-Remote-Control',
    	disabled: false,
    	config: {
    		customCommand: {},
    		customMenu: 'custom_menu.json',
    		showModuleApiMenu: 'true',
    		apikey: '',
    		}
       		},
    		{
      module: "MMM-Remote-Control-Repository",
    		},
    		{
    			  module: 'MMM-AlarmClock',
    			  position: 'top_right',
    			  config: {
    			    sound: 'blackforest.mp3',
    			    format: 'dddd, h:mm a',
    			    timer: 60000,
    			    volume: 1.0,
    			    touch: false,
    			    fade: false,
    			    alarms: [
    			      {
    				time: '19:02',
    				days: [1,2,3,4,5,6,7],
    				title: 'Morning Alarm',
    				message: 'Get Up! and train like a beast!'
    			      }
    			    ]
    			  }
    		},
    		{
    			module: "compliments",
    			position: "lower_third"
    		},
    		{
    			module: "currentweather",
    			position: "top_right",
    			config: {
    				location: "XYZ",
    				locationID: "XYZ",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
    				appid: "XYZ"
    			}
    		},
    		{
    			module: "weatherforecast",
    			position: "top_right",
    			header: "Weather Forecast",
    			config: {
    				location: "XYZ",
    				locationID: "XYZ",  //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
    				appid: "XYZ"
    			}
    		},
    		{
    			module: "newsfeed",
    			position: "bottom_bar",
    			config: {
    				feeds: [
    					{
    						title: "News ",
    						url: "XYZs"
    					}
    				],
    				showSourceTitle: true,
    				showPublishDate: true,
    				broadcastNewsFeeds: true,
    				broadcastNewsUpdates: true
    			}
    		},
    {
    	module: "MMM-Hotword",
    	position: "bottom_right",
    	config: {
    		chimeOnFinish: null,
    		mic: {
    			recordProgram: "arecord",
    			device: "plughw:1"
    		},
    		models: [
    			{
    				hotwords    : "smart_mirror",
    				file        : "smart_mirror.umdl",
    				sensitivity : "0.5",
    			},
    		],
    		commands: {
    			"smart_mirror": {
    				notificationExec: {
    					notification: "ASSISTANT_ACTIVATE",
    					payload: (detected, afterRecord) => {
    						return {profile:"default"}
    					}
    				},
    				restart:false,
    				afterRecordLimit:0
    			}
    		}
    	}
    },
    {
    	module: "MMM-AssistantMk2",
    	position: "bottom_right",
    	config: {
    		deviceLocation: {
    			coordinates: {
    				latitude: xx.xxx, // -90.0 - +90.0
    				longitude: yy.yyyy // -180.0 - +180.0
    			},
    		},
    		record: {
    			recordProgram : "arecord",  
    			device        : "plughw:1",
    		},
    
    		play: { // Full values are in `FOR EXPERTS` section.
    		      playProgram: "mpg321", // recommended.
    		},
    
    
    		    // --- OPTIONAL / not important but customizable for your usage
    
    
    		    responseVoice: true, // If available, Assistant will response with her voice.
    		    responseScreen: true, // If available, Assistant will response with some rendered HTML
    		    responseAlert: true, // If available, Assistant will response with Alert module of MM
    		    // Sometimes, any response might not be returned. responseAlert is useful for displaying error.
    
    		    screenZoom: "80%", // Adjust responseScreen to your mirror size.
    		    screenDuration: 0, // milliseconds. How long responseScreen will be shown after speech.
    		    //If you set 0, Screen Output will be closed after Response speech finishes ASAP.
    
    		    youtubeAutoplay: true, //If set as true, found Youtube video will be played automatically.
    		    pauseOnYoutube:true, //If set as true, You cannot activate Assistant during youtube playing. Recommended for the performance (Because permanent hotword detecting might make performance lower)
    
    		    youtubePlayerVars: { // You can set youtube playerVars for your purpose, but should be careful.
    		      "controls": 0,
    		      "loop": 1,
    		      "rel": 0,
    		 },
    		    youtubePlayQuality: "default", //small, medium, large, hd720, hd1080, highres or default
    
    		notifications: {
    			ASSISTANT_ACTIVATED: "HOTWORD_PAUSE",
    			ASSISTANT_DEACTIVATED: "HOTWORD_RESUME",
    		},
    		useWelcomeMessage: "brief today",
    		profiles: {
    			"default" : {
    				lang: "en-US"
    			}
    		},
    	}
    },
    ]
    };
    
    /*************** DO NOT EDIT THE LINE BELOW ***************/
    if (typeof module !== "undefined") {module.exports = config;}
    
    S 1 Reply Last reply Nov 19, 2019, 12:29 PM Reply Quote 0
    • S Offline
      sdetweil @ricardoyen
      last edited by Nov 19, 2019, 12:29 PM

      @ricardoyen said in Config File Help (Camera, Voice Control, Spotify):

      MMM_AssistantMk2

      so, what you want are recipes.

      https://github.com/eouia/MMM-AssistantMk2/wiki/Usage#recipes as individual files in the module folder. this will make the config file change very small

      basically little files that take a spoken word/phrase and then take some action, execute some ‘command’ (command could be to Magic Mirror or to the system …)

      so, you could write down what you need the system to do…

      if I say this … then this is what should happen

      i don’t know anything about the 'Camera, Voicecontrol, (created & retrieved the sound files, ShowCamera, HideCamera and Selfie) ’ thing…

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      R 1 Reply Last reply Nov 19, 2019, 3:17 PM Reply Quote 0
      • R Offline
        ricardoyen @sdetweil
        last edited by Nov 19, 2019, 3:17 PM

        @sdetweil

        Ok, suppose I manage to get the receipe,

        Which file in which directory do I modify to make it work…

        I was to start spotify, stop spotify, next track, pause etc.

        S 1 Reply Last reply Nov 19, 2019, 3:59 PM Reply Quote 0
        • S Offline
          sdetweil @ricardoyen
          last edited by Nov 19, 2019, 3:59 PM

          @ricardoyen

          u create a file in the MMM-AssistantMK2 folder for each distinct recipe. (distinct action, start spotify, stop spotify, etc,etc)

          then in config you put those in a single list
          and then connect the command to the recipe

          so for each recipe, you would determine WHAT you need to do, then get the system operations for HOW to do that (issue this command, change this file, … whatever)…

          I believe no one has done all this yet

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            2/4
            Last post
          Enjoying MagicMirror? Please consider a donation!
          MagicMirror created by Michael Teeuw.
          Forum managed by Sam, technical setup by Karsten.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy