Read the statement by Michael Teeuw here.
VoiceControl module
-
@tyho What I meant is you need to add socketNotificationReceived to your module notification.js.
-
@alexyak i can’t get it to work. it tested:
It sends sockets notifications from notifications.js to node_helper.js. But not from node_helper.js back to notifications.js.Even if i put it in the start function of the node_helper.js:
start: function() { this.sendSocketNotification("autosleep", {}); },
it won’t get received it my notification.js:
socketNotificationReceived: function(notification) { if (notification === "autosleep") { alert("autosleep received"); awake = 0; } },
any idea? is it even possible to use it backwards?
-
Try to put a call in your start method of the module (notification.js) to establish the connection with node_helper. Something like that:
this.sendSocketNotification(“CONNECT”, {});
-
I’ve updated the VoiceControl module to display a list of commands on the mirror:
[ card : alexyak/voicecontrol ]
-
[card:alexyak/voicecontrol]
-
This is a really cool module. Does anyone know a good microphone that will work for the whole room? The mic I have only works when you are close.
-
Hi,
@alexyak sorry, but i have a little Problem. Maybe you can help me.
You write on Github in your Readme file, I have to put the code (notificationReceived: function(notification, payload, sender)…) into the module to use it. I like to controll the module Simple music player by @EoF so i clone your github files copy the code into the config.js File train and download a pmdl file. But where should i paste the code notificationReceived: function(notification, payload, sender)… In the config.js File or in the mmm-music-player.js file in folder modules simple music Player?
Sorry i’m new in the coding world, and now a little bit confused :-D
Greets gismo2006
-
@gismo2006 This part has to go into
mm-music-player.js
. This is where you receive the notification. Then instead ofthis.media.play()
you have to do access the play and stop functions of the mm-music-player (which unfortunately is seems a little bit complicated, since they are only elements on the web page).Edit: Maybe the easiest is to give the Play and Stop button an
id
and then ‘fake’ a click event on the the buttons.var playButton = document.getElementById('play-button'); playButton.click();
-
Hi @Jopyth thank you for your helping.
But I think i’m to stupid… :-(
I have copy your first code line into the mm-music-player.js file. But now the module isn’t shown at the mirror. But the mirror shows all other module i installed at the same time… (I use pavrios Facial-Recogination module) If I cut out your line the mirrors behaviour is like it should be. On searching my misstake i found a line called: var playButton = document.createElement(“div”);. I cut this line and put in your line but nothing.
greets gismo
-
@gismo2006 Have you put this into the notificationReceived function, e.g. in line 26?
notificationReceived: function(notification, payload, sender) { if (notification === "PLAY_MUSIC"){ var playButton = document.getElementById('play-button'); playButton.click(); } if (notification === "STOP_MUSIC"){ var stopButton = document.getElementById('stop-button'); stopButton.click(); } },
Also add the id somewhere here, e.g. with
playButton.id = 'play-button'
Same for the stop button.