MagicMirror² v2.5.0 is available! For more information about this release, check out this topic.

Problem with MMM-LocalTemperature using MMM-Lucy



  • Re: Hello-Lucy

    Installed MMM-voice, and MMM-Lucy -> made modifications as you decribed well in the readme file on modules that i’m using but not listed in your list of adapted modules to work with voice.

    Ex MMM-YouLess, MMM-Iframe-Ping, MMM-rain-forecast, MMM-LocalTemperature

    All work fine, except the last one -> MMM-LocalTemperature.
    I can Hide the module , but Show does’t react.

    this the code snippet set in the MMM-LocalTemperature.js file

    		return wrapper;
    	},
    	
    	   /////  Add this function to the modules you want to control with voice //////
    
    	    notificationReceived: function(notification, payload) {
    	        if (notification === 'HIDE_INDOOR') {
    	            this.hide(1000);
    		    this.updateDom(300);
    	        }  else if (notification === 'SHOW_INDOOR') {
    	            this.show(1000);
     		    this.updateDom(300);
    	        }
    	            
    	    },
    
    
    	/**
    	 * The roundNumber function rounds a number to the specified number of decimal places.  
    	 * Use a negative precision value to round to a position left of the decimal.  
    

    Don’t understand reason why HIDE command is working, but SHOW is not.

    Verified MMM-voice.js & node_helper.js and here also is fine.

    @Mykle1 , would be gret if you could look into the code of the MMM-LocalTemperature.
    Could it be because it’s using some C-programming (DHT.c)


  • Module Developer

    @johans

    Your entry looks good

    Check that your entry in the MMM-voice node_helper has

    else if (/(SHOW)/g.test(data) && /(INDOOR)/g.test(data)) {
                this.sendSocketNotification('SHOW_INDOOR');
            } else if (/(HIDE)/g.test(data) && /(INDOOR)/g.test(data)) {
                this.sendSocketNotification('HIDE_INDOOR');
            }
    

    and that your entry into the MMM-voice.js file sentences array has

    'HIDE INDOOR',
    'SHOW INDOOR',
    

    and further down in the same file

    // MMM-voice sends notification to MMM-LocalTemperature to HIDE
            else if (notification === 'HIDE_INDDOR') {
                 this.sendNotification('HIDE_INDOOR');
            }
        
            // MMM-voice sends notification to MMM-LocalTemperature to SHOW
            else if (notification === 'SHOW_INDOOR') {
                 this.sendNotification('SHOW_INDOOR');
            }
    


  • @mykle1
    Thanks for the information, but every bit of code is exactly as you wrote. So I really can’t understand why all other modules are working fine, except this one.
    First I thought it was because of the word wasn’t recognized.
    So I used words like TEMPERATURE, TEMP, HUMIDITY, en last one INDOOR. All have the same behaviour.
    Module hides, but voice command can’t bring it back on screen. So there must be something in this MMM-LocalTemperature.js file that is blocking it from coming back on screen.


  • Module Developer

    @johans

    I’ve only seen that behavior when I made errors in my changes to the files described above. I can’t test it with that module because I don’t have the sensors necessary to run the module.



  • @mykle1
    I understand that you need the proper sensor for making a test. Anyhow for now, I disabled the SHOW & HIDE for this module so it will remain always on screen.
    It isn’t realy a breaking problem. I was just wondering why all other modules are doing fine except this one’s not.
    Thanks man, for your the help & support.


  • Module Developer

    @johans

    If, as you say, you’ve made all the edits correctly, then it is still possible that the temperature module is conflicting in some way. I would try to troubleshoot if I could run that module. Try some things on your own if you feel comfortable doing so.