hI @ianperrin
It Works !!!
Nice explanations.
My mistake is when i launched a webpage to write the url i stoped the MM by Ctrl+Q. Now with MM start and a webpage opened. Everything is alright
Thanks for your help
hI @ianperrin
It Works !!!
Nice explanations.
My mistake is when i launched a webpage to write the url i stoped the MM by Ctrl+Q. Now with MM start and a webpage opened. Everything is alright
Thanks for your help
ok thanks ianperrin for your help
Step 2 is ok because on magic mirror, i have the link on magic mirror : client unauthorized see /MMM-Strava/auth/
but now in step 5, i make:
in webpage, and magic mirror starting i put
http://192.128.1.99:8080/MMM-Strava/Oauth/
but nothing happen. The webpage says:
host unreachable
ERR_CONNECTION_REFUSED
have you an idea?
Hi everybody,
I posted in troubleshooting section but i don’t know if it’s visible. That’s why i post here. I don’t understand the step 2 and the step 5 in Tutorial about MMM-Strava. I have a ID and a secret but i don’t know what i write in case:
APi Name
Category
Club
WebSite
Description
and Callback domain
In Website and Callback domain what i write?
In callback domain, i put my IP to my magic mirror like 192.128.1.99:8080 but nothing happen
Can anybody help me please?
Hi nothing use this module?
Anybody can help me please?
Hi everybody
I try to install MMM-Strava on my magic mirror but i have problem with authorization.
Installation is ok because when i restarted the Magic Mirror i had a message like “check authorization”
i followed explanation about installation but i have problem in step 2:
Make sure the callback domain matches the IP address (or URL) used to access the MagicMirror.
I don’t know what i write in this case
On Strava APi application i must complete:
APi Name
Category
Club
WebSite
Description
and Callback domain
Can anybody help me please to write the good things ?
After this, i’ don’t understand the step 5
Authenticate the module to allow access to the Strava API.
Browse to the Strava authentication page: http://localhost:8080/MMM-Strava/auth/ - the exact URL may vary depending on your configuration.
Select the module you wish to authenticate (e.g. module_4_MMM-Strava) and click/tap Authorise -The number of the modules will vary depending on your configuration.
On the Strava Authorisation page, select the level of access you wish to give to the Magic Mirror, and click/tap Authorize - the module requires at least View data about your public profile and View data about your activities but it’s up to you whether you want to allow access to private activities.
Once the successful authorisation message appears, restart your Magic Mirror.
What is the good authenticate url ?
Thanks for your help
@sdetweil i send you a personal mail with my domoticz module and config.js.
Thanks for your help
hi @sdetweil , sorry for this late answer, i’m very busy at this moment
I applied your programe line and now, in the console i have:
:8080/modules/fabio/domoticz//domoticz.js:142 Uncaught TypeError: Cannot read property ‘0’ of undefined
at Class.processJson (:8080/modules/fabio/domoticz//domoticz.js:142)
at XMLHttpRequest.domoRequest.onreadystatechange (:8080/modules/fabio/domoticz//domoticz.js:128)
and this:
domoticz.js:142 Uncaught TypeError: Cannot read property ‘0’ of undefined
at Class.processJson (domoticz.js:142)
at XMLHttpRequest.domoRequest.onreadystatechange (domoticz.js:128)
processJson @ domoticz.js:142
domoRequest.onreadystatechange @ domoticz.js:128
XMLHttpRequest.send (async)
updateDomo @ domoticz.js:136
(anonymous) @ domoticz.js:170
and the js script below
/* global Module */
/* Magic Mirror
* Module: Domoticz
*
* By Mathias Arvidsson
*/
Module.register("domoticz",{
defaults: {
units: config.units,
updateInterval: 50,
animationSpeed: 0,
timeFormat: config.timeFormat,
lang: config.language,
initialLoadDelay: 0,
retryDelay: 2500,
apiBase: "http://1xx.1xx.x.xx", // IP domoticz
apiPort: "xxxx", // Port
sensors: [
{
idx: "1",
symbolon: "fa fa-user",
symboloff: "fa fa-user-o",
hiddenon: false,
hiddenoff: false,
customTitle: "",
},
],
},
firstEvent: false,
getStyles: function() {
return ['font-awesome.css'];
},
// Define required scripts.
getScripts: function() {
return ["moment.js"];
},
// Define start sequence.
start: function() {
Log.info("Starting module: " + this.name);
// Set locale.
moment.locale(config.language);
this.loaded = false;
this.status1 = false;
this.title = "Loading...";
this.scheduleUpdate(this.config.initialLoadDelay);
this.sensors = [];
for (var c in this.config.sensors) {
var sensor = this.config.sensors[c];
var newSensor = {idx:sensor.idx, symbolon:sensor.symbolon, symboloff:sensor.symboloff, hiddenon:sensor.hiddenon, hiddenoff:sensor.hiddenoff, customTitle:sensor.customTitle, status:"", sname:"",type:""};
Log.log(sensor.idx);
this.sensors.push(newSensor);
}
Log.log(this.sensors);
},
// Override dom generator.
getDom: function() {
var wrapper = document.createElement("div");
if (!this.loaded) {
wrapper.innerHTML = "Loading...";
wrapper.className = "dimmed light small";
return wrapper;
}
var tableWrap = document.createElement("table");
tableWrap.className = "small";
for (var c in this.sensors) {
var sensor = this.sensors[c];
if((sensor.status=="On" && sensor.hiddenon)||(sensor.status=="Off" && sensor.hiddenoff)) continue;
var sensorWrapper = document.createElement("tr");
sensorWrapper.className = "normal";
var symbolTD = document.createElement('td');
symbolTD.className = "symbol";
var symbol = document.createElement('i');
var symbolClass = sensor.symboloff
if(sensor.status=="On") symbolClass = sensor.symbolon
symbol.className = symbolClass;
symbolTD.appendChild(symbol);
sensorWrapper.appendChild(symbolTD);
var titleTD = document.createElement('td');
titleTD.className = "title bright";
if(sensor.status=="Off") titleTD.className = "title light";
titleTD.innerHTML = sensor.sname;
if(typeof sensor.customTitle !== 'undefined') titleTD.innerHTML = sensor.customTitle;
sensorWrapper.appendChild(titleTD);
var statusTD = document.createElement('td');
statusTD.className = "time light";
statusTD.innerHTML = sensor.status;
sensorWrapper.appendChild(statusTD);
tableWrap.appendChild(sensorWrapper);
}
wrapper.appendChild(tableWrap);
return wrapper;
},
updateDomo: function() {
var i = 0;
for (var c in this.sensors) {
Log.log("this is c: " + c);
var sensor = this.sensors[c];
var url = this.config.apiBase + ":" + this.config.apiPort + "/json.htm?type=devices&rid=" + sensor.idx;
var self = this;
var domoRequest = new XMLHttpRequest();
domoRequest.open("GET", url, true);
domoRequest.onreadystatechange = function() {
if (this.readyState === 4) {
if (this.status === 200) {
self.processJson(JSON.parse(this.response));
Log.log("Loaded data");
} else {
Log.error(self.name + ": Could not load data. request status="+this.status);
Log.log("Did not load data");
}
}
};
domoRequest.send();
i++;
}
},
processJson: function(data) {
Log.log("****Parsing data: " + c + " " + data.result[0].Name);
if (!data) {
// Did not receive usable new data.
// Maybe this needs a better check?
return;
}
for (var c in this.sensors) {
var sensor = this.sensors[c];
if(sensor.idx == data.result[0].idx){
this.sensors[c].sname = data.result[0].Name;
this.sensors[c].status = data.result[0].Data;
this.sensors[c].type = data.result[0].Type;
}
}
this.loaded = true;
this.updateDom(this.config.animationSpeed);
},
scheduleUpdate: function(delay) {
Log.log("Updating..");
var nextLoad = this.config.updateInterval;
if (typeof delay !== "undefined" && delay >= 0) {
nextLoad = delay;
}
var self = this;
setInterval(function() {
self.updateDomo();
}, 500 );
}
});
for your information, the module seems to work but i have this error.
Have you a solution?
thanks a lot
@sdetweil said in MMM-Domoticz Cannot read property '0' of undefined:
this is not set correctly if called in the domoRequest.onreadystatechange = function() {}
u should be using self… ‘this’ is context sensitive, means ‘inside this function’
hi @sdetweil, i replace conole.log by Log.log and now i have error in the console
Could not load data.
refered to line 131.
Sorry but i don’t unerstand your last post about this and self. Can you show me the good syntax or do you need the entire program?
thanks for your help
Hi everybody
I update my magic mirror from 2.6 to 2.8 and also npm to the latest version and now i have error on console (ctrl+ maj+i) with MMM-Domoticz:
domoticz.js:150 Uncaught TypeError: Cannot read property ‘0’ of undefined
at Class.processJson (domoticz.js:150)
at XMLHttpRequest.domoRequest.onreadystatechange (domoticz.js:128)
you see below the domoticz.js short program:
line 115: updateDomo: function() {
var i = 0;
for (var c in this.sensors) {
//console.log("this is c: " + c);
var sensor = this.sensors[c];
var url = this.config.apiBase + ":" + this.config.apiPort + "/json.htm?type=devices&rid=" + sensor.idx;
var self = this;
var domoRequest = new XMLHttpRequest();
domoRequest.open("GET", url, true);
domoRequest.onreadystatechange = function() {
if (this.readyState === 4) {
if (this.status === 200) {
line 128: self.processJson(JSON.parse(this.response));
//console.log("Loaded data");
} else {
Log.error(self.name + ": Could not load data.");
//console.log("Did not load data");
}
}
};
domoRequest.send();
i++;
}
},
processJson: function(data) {
//console.log("****Parsing data: " + c + " " + data.result[0].Name);
if (!data) {
// Did not receive usable new data.
// Maybe this needs a better check?
return;
}
for (var c in this.sensors) {
var sensor = this.sensors[c];
line 150: if(sensor.idx == data.result[0].idx){
this.sensors[c].sname = data.result[0].Name;
this.sensors[c].status = data.result[0].Data;
this.sensors[c].type = data.result[0].Type;
}
}
and also i have also a problem with console.log (to mm2.6 also) the error message is:
console.log is not a function.
I post this because i’m noob in js script. My intenet searching for this problem is a failure.
Can anyboby help me please?
thanls for next answers
thanks @mumblebaj you’re awesome !!!. Git reset --hard work fine
Update MM2.8 is ok.
hi,
sdetweil: i try your solution:
cd ~/MagicMirror
git checkout – config/config.js.sample
but i have the same problem. git pull said me the same thing. Have you a other idea?
mumblebaj: if y use this command line, all my modules and config will be deleted? if i copy my modules folder and config folder and paste them in the new version of Magic mirror, everything will work fine?
Thanks
Hi,
I have a problem with my Magic Mirror. I just want to update my MM but i can’t because the result of “git pull && npm install” is: (in french)
Mise à jour de57daa…a31546b
error: Vos modifications locales aux fichiers suivants seraient écrasées par la fusion :
config/config.js.sample
package-lock.json
vendor/package-lock.json
Veuillez valider ou remiser vos modifications avant la fusion.
Abandon
and with google translate:
Updated from57daa…a31546b
error: Your local changes to the following files would be overwritten by the merge:
config / config.js.sample
Package-lock.json
vendor / package-lock.json
Please validate or postpone your changes before the merge.
abandonment
Can anobody tell me the command line to close this error in order to restart git pull?
Thanks for next answers
@Sean thanks for your answer it was a H/W failure I2C was not activate and i don’t know why ? I enabled I2c with raspi-config and shutdown the pi. I pluged my sensor again and it works
Hi everybody,@Sean and @Benjaminh86
I use this module just for change pages with MMM-Pages and MMM-Pages indicator but after a while, my sensor is unknown.
when i just want to test the sensor with “python gesture_print.py”, i have:
Error with sensor
Paj7620 initialize register finished.
my matrix is good i think:
sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: 30 31 32 33 34 35 36 37 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
and i have 5 file in /home/pi/MagicMirror/modules/MMM-GroveGestures/py
I restart Raspberry but the result is the same
Can aybody help me please ?
Hi,
i use MMM-AssistantMk2 and it’s awesome but i have a problem with youtube and start video. If i say: Smooth criminals Mickael Jackson, a youtube window open but nothing appened. Just a black screen with youtube logo
I open console and there are errors but i don’t undestand. See below:
www-widgetapi.js:99 Error while parsing the 'allow' attribute: 'accelerometer;', 'autoplay;', 'encrypted-media;', 'gyroscope;', 'picture-in-picture' are invalid feature names.
mb @ www-widgetapi.js:99
:8080/modules/MMM-AssistantMk2//MMM-AssistantMk2.js:744 Uncaught TypeError: console.log is not a function
at onReady (:8080/modules/MMM-AssistantMk2//MMM-AssistantMk2.js:744)
at P.k.H (s.ytimg.com/yts/jsbin/www-widgetapi-vflf9U9oY/www-widgetapi.js:54)
at Y.k.s (s.ytimg.com/yts/jsbin/www-widgetapi-vflf9U9oY/www-widgetapi.js:98)
at Y.k.I (s.ytimg.com/yts/jsbin/www-widgetapi-vflf9U9oY/www-widgetapi.js:112)
at kb.g (s.ytimg.com/yts/jsbin/www-widgetapi-vflf9U9oY/www-widgetapi.js:87)
at g (s.ytimg.com/yts/jsbin/www-widgetapi-vflf9U9oY/www-widgetapi.js:76)
I post my config.js below with MMM-AssistantMK2 and MMM-Hotword:
{
module: "MMM-AssistantMk2",
position: "top_right",
config: {
deviceLocation: {
coordinates: { // set the latitude and longitude of the device to get localized information like weather or time. (ref. mygeoposition.com)
latitude: xx.xxxx, // -90.0 - +90.0
longitude: x.xxxx // -180.0 - +180.0
},
},
profiles: {
"default" : { // profile name.
profileFile: "default.json", // profile file name.
lang: "fr-FR"
//currently available (estimation, not all tested):
// de-DE, en-AU, en-CA, en-GB, en-US, en-IN
// fr-CA, fr-FR, it-IT, ja-JP, es-ES, es-MX, ko-KR, pt-BR
// https://developers.google.com/assistant/sdk/reference/rpc/languages
},
},
record: {
recordProgram : "arecord",
device : "plughw:1",
},
play: {
playProgram: "mpg321", // recommended.
},
transcriptionHook: {
HIDE_ALL_MODULES: {
pattern: "cache les modules",
command: "HIDEMODULES"
},
SHOW_ALL_MODULES: {
pattern: "affiche les modules",
command: "SHOWMODULES"
},
SCREEN_ON: {
pattern: "allume l'écran",
command: "SCREENON"
},
SCREEN_OFF: {
pattern: "eteins l'écran",
command: "SCREENOFF"
},
REBOOT: {
pattern: "reboot le miroir",
command: "REBOOT"
},
SHUTDOWN: {
pattern: "eteins le miroir",
command: "SHUTDOWN"
},
STOP_PLAY: {
pattern: "arrête la video", // this is for youtube but it is preferable to have youtubeAutoplay: false, when running spotify so you don't get interaction with youtube player.
command: "STOP_VID"
},
// STOP_PLAY2: {
// pattern: "arrête la musique",
// command: "STOP_VID"
// },
SPOTIFY_PREVIOUS: {
pattern: "musique précédente",
command: "SPOTIFY_PREVIOUS"
},
SPOTIFY_PAUSE: {
pattern : "stop",
command: "SPOTIFY_PAUSE"
},
SPOTIFY_PLAY: {
pattern : "lance la musique",
command: "SPOTIFY_PLAY"
},
SPOTIFY_NEXT: {
pattern: "musique suivante",
command: "SPOTIFY_NEXT"
},
SPOTIFY_VOLUME: {
pattern: "met le volume à ([0-9]{1,2}[0]?|100)",
command: "SPOTIFY_VOLUME"
},
SPOTIFY_SEARCH: {
pattern: "joue (.*) on Spotify",
command: "SPOTIFY_SEARCH"
},
SPOTIFY_SEARCH_PLAYLIST: {
pattern: "playlist (.*) sur Spotify",
command: "SPOTIFY_SEARCH_PLAYLIST"
},
SPOTIFY_MA_PLAYLIST: {
pattern: "(.*) ma playlist", // (.*) is an action eg: play my playlist / run my playlist etc...
command: "SPOTIFY_MA_PLAYLIST"
},
SPOTIFY_TRANSFER: {
pattern: "joue la musique sur (.*)", // (.*) is the name of your device
command: "SPOTIFY_TRANSFER"
},
VOLUME_UP: {
pattern: "augmente le volume",
command: "CMD_VOLUME_UP"
},
VOLUME_DOWN: {
pattern: "baisse le volume",
command: "CMD_VOLUME_DOWN"
},
SET_VOLUME: {
pattern: "met le volume global à ([0-9]{1,2}[0]?|100)",
command: "CMD_VOLUME_SET"
}
},
command: {
STOP_VID: {
moduleExec: {
module: ["MMM-AssistantMk2"],
exec: (module, params, key) => {
module.assistant.subdom.youtube.innerHTML = "";
module.assistant.subdom.youtube.style.display = "none";
module.youtubePlaying = false;
}
}
},
SPOTIFY_TRANSFER: {
notificationExec: {
notification: "SPOTIFY_TRANSFER",
payload: (params) => {
console.log("SPOTIFY_TRANSFER @",params)
return params[1];
}
}
},
SPOTIFY_PAUSE: {
notificationExec: {
notification: "SPOTIFY_PAUSE"
}
},
SPOTIFY_PLAY: {
notificationExec: {
notification: "SPOTIFY_PLAY"
}
},
SPOTIFY_MA_PLAYLIST: {
notificationExec: {
notification: "SPOTIFY_PLAY",
payload: (params) => {
console.log("SPOTIFY_MA_PLAYLIST")
return {
context_uri:"spotify:playlist:0bdByehKVfdsfdsfdsOhF5t", // Uri of a personnal playlist or album
}
},
notification: "SPOTIFY_SHUFFLE", // added this to toogle shuffle
notification: "SPOTIFY_NEXT" // added this to not always have the same song starting first
}
},
SPOTIFY_NEXT: {
notificationExec: {
notification: "SPOTIFY_NEXT"
}
},
SPOTIFY_PREVIOUS: {
notificationExec: {
notification: "SPOTIFY_PREVIOUS"
}
},
SPOTIFY_VOLUME: {
notificationExec: {
notification: "SPOTIFY_VOLUME",
payload: (params) => {
console.log("SPOTIFY_VOLUME @",params)
return params[1];
}
}
},
SPOTIFY_SEARCH: {
notificationExec: {
notification: "SPOTIFY_SEARCH",
payload: (params) => {
console.log("SPOTIFY_SEARCH @",params)
return {
type: "artist,track,album,playlist",
query: params[1],
random:false,
}
}
}
},
SPOTIFY_SEARCH_PLAYLIST: {
notificationExec: {
notification: "SPOTIFY_SEARCH",
payload: (params) => {
console.log("SPOTIFY_SEARCH_PLAYLIST @",params)
return {
type: "playlist",
query: params[1],
random:true,
}
}
}
},
CMD_VOLUME_UP: {
notificationExec: {
notification: "VOLUME_UP"
}
},
CMD_VOLUME_DOWN: {
notificationExec: {
notification: "VOLUME_DOWN"
}
},
CMD_VOLUME_SET: {
notificationExec: {
notification: "VOLUME_SET",
payload: (params, key) => {
console.log("@", params);
return params[1];
}
}
}
},
notifications: {
ASSISTANT_ACTIVATED: "HOTWORD_PAUSE",
ASSISTANT_DEACTIVATED: "HOTWORD_RESUME",
},
responseVoice: true,
screenDuration: 5000,
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
}
},
{
module: "MMM-Hotword",
config: {
snowboy: [
{
hotwords: "smartmirror", //this will be sent to other module for distinguishing which hotword is detected.
file: "resources/models/smart_mirror.umdl",
sensitivity: '0.5',
},
//{
//hotwords: "snowboy",
//file: "resources/models/snowboy.umdl",
//sensitivity: '0.5',
//},
{
file: 'resources/models/jarvis.umdl',
sensitivity: '0.8,0.80',
hotwords: ['jarvis','jarvis'] //Kitt.ai changed their Jarvis UMDL, it has 2 models in one file. So weird.
//anyway, you can give different name for each. ['jarvis_1', 'jarvis_2']. Even though I think this is useless.
}
],
record: {
recordProgram : "arecord",
device : "plughw:1"
},
autostart:true,
onDetected: {
notification: (payload) => {
return "ASSISTANT_ACTIVATE"
},
payload: (payload) => {
return {
profile: payload.hotword
}
}
},
},
},
Can you help me please?
thanks for next answers
Hi
I just install magic mirror on my raspberry pi 3 b+ and i install the wallberry theme module. In order to see the unsplash wallpaper, an app must be create on unsplash website to obtain a secret api code. But after few days, unsplash sends me a mail witch says that my app is not compatible with unsplash rules. The mail below:
The way you currently have your app designed violates point 3 of the API Usage Guidelines - You cannot replicate the core user experience of unsplash.com
The best way to make sure your application doesn’t violate this guideline is to integrate Unsplash inside an existing app that offers more value than simply the Unsplash integration.
Some examples:
✓ the Ghost integration brings Unsplash inside Ghost’s editor to improve the workflow of finding beautiful images. Without the integration, the app still offers a lot of value to its users.
✕ a wallpaper app that returns Unsplash images for downloading. Without the integration, the app has no content.
Because your app is a wallpaper app, it currently violates the above API Usage Guideline.
We’re all for remixing and open-source, but the API costs us a non-trivial amount of money to host, operate, and provide support for. We’d prefer not to be paying to actively support apps that are offering similar or competing services. Therefore, we’ve disabled your application.
You are still more than welcome to use our API, just not in this specific way.
Thanks for understanding, and I’m more than happy to elaborate on anything if you need me to.
Can anybody says me the problem and provide me a solution. Thanks for next answers