skuethe/MMM-Spotify

Touch Interface Conflict with MMM-GoogleAssistant

sunnstix opened this issue · 3 comments

I implemented the Google Assistant module yesterday and I have had success in using its recipes to send notifications to MMM-Spotify but now I can't use the touch interface. Other touchscreen integrated modules are still functioning and the touch interface fails to work regardless of position. Has anyone had similar issues in integrating these two modules?

Below are the configs:

{
  			module: "MMM-Spotify",
  			position: "bottom_left",
  			config: {
  			  debug: false,
  			}
		},
		{
 			module: 'MMM-SmartTouch',
    			position: 'bottom_right',    // This can be any of the regions.(bottom-center Recommended)
    			config: {
        			// The config property is optional.
    			}
		},
		{
		  module: "MMM-GoogleAssistant",
		  //position: "fullscreen_above",
		  config: {
		    debug: false,
		    assistantConfig: {
		      lang: "en-US",
		      projectId: "", // Required to use gaction.
		      modelId: "", // (OPTIONAL for gaction)
		      instanceId: "", // (OPTIONAL for gaction)
		      latitude: 27.2038,
		      longitude: -77.5011,
		    },
		    responseConfig: {
		      useScreenOutput: true,
		      screenOutputCSS: "screen_output.css",
		      screenOutputTimer: 3000,
		      screenRotate: true,
		      activateDelay: 250,
		      useAudioOutput: true,
		      useChime: true,
		      newChime: false,
		      useNative: true,
		      playProgram: "mpg321"
		    },
		    micConfig: { // put there configuration generated by auto-installer
		      recorder: "arecord",
		      device: "plughw:1",
		    },
		    customActionConfig: {
		      autoMakeAction: false,
		      autoUpdateAction: false, // in RPI, gaction CLI might have some trouble.(current version should be 2.2.4, but for linux-arm, Google haven't updated) so leave this as false in RPI. I don't know it is solved or not.
		      actionLocale: "en-US", // At this moment, multi-languages are not supported, sorry. Someday I'll work.
		    },
		    snowboy: {
		      usePMDL: true,
		      audioGain: 3.0,
		      Frontend: true,
		      Model: "jarvis",
		      Sensitivity: 0.5
		    },
		    A2DServer: {
		      useA2D: true,
		      stopCommand: "stop"
		    },
		    recipes: [ "with-MMM-TelegramBot.js","with-MMM-Spotify" ],
		    NPMCheck: {
		      useChecker: true,
		      delay: 10 * 60 * 1000,
		      useAlert: true
		    }
		  }
		},

Yes, the problem here is that the Assistant module blocks the whole screen with it´s iFrame, even when inactive. The touch input you give just is picked up by that iFrame and not by your MMM-SmartTouch module. I added some custom css to prevent that from happening:

In MMM-GoogleAssistant.css, I added this width: 0px line, that prevents the iFrame from blocking any Touch input, since it is now 0px wide:

#GA_HELPER.hidden {
  opacity: 0;
  width: 0px;
}

if works, create a custom.css file in css directory of MagicMirror

@PaulReichmuth Thanks! Didn't realize that it blocks it even when it's inactive. Will attempt to do so now.