Read the statement by Michael Teeuw here.
Posts
-
RE: Error on loading .css
Hi,
Thanks for your reply.
I use portainer and Watchtower to automatic upgrade the Docker image. This is the stack I use:
version: '3' services: magicmirror: container_name: magicmirror-1 image: karsten13/magicmirror:latest cap_add: - NET_ADMIN - NET_RAW network_mode: deellan ports: - "4885:8080" volumes: - /volume2/docker/magicmirror-1/config:/opt/magic_mirror/config - /volume2/docker/magicmirror-1/modules:/opt/magic_mirror/modules - /volume2/docker/magicmirror-1/css:/opt/magic_mirror/css restart: unless-stopped command: - npm - run - server -
Error on loading .css
Hi,
I use the Docker image of karsten13/magicmirror:latest
Since a week I’ve got these error messages at the Console.
192.168.1.66/:1 Refused to apply style from ‘http://192.168.1.66:4885/css/roboto.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
192.168.1.66/:1 Refused to apply style from ‘http://192.168.1.66:4885/css/font-awesome.css’ because its MIME type (‘text/html’) is not a supported stylesheet MIME type, and strict MIME checking is enabled.
loader.js:205 Error on loading stylesheet: css/font-awesome.cssAny ideas how to fix this?
KR,
Bert -
RE: Not loading one of two Google calendars
Hi,
The second Google calendar was too big. I made a module to prepare a smaller ics file with only the future events.
And now it is working. Two Google calendars.
KR,
Bert -
RE: Not loading one of two Google calendars
Hi Sam,
[calendarutils.js:112 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'length') at Object.titleTransform (calendarutils.js:112:24) at calendar.js:353:41 at Array.forEach (<anonymous>) at Class.getDom (calendar.js:255:10) at main.js:132:35 at new Promise (<anonymous>) at updateDom (main.js:112:10) at Object.updateDom (main.js:669:4) at Class.updateDom (module.js:341:6) at Class.socketNotificationReceived (calendar.js:210:8)](link url)But also with this error, both .ics are loading.
KR,
Bert -
RE: Not loading one of two Google calendars
Hi Sam,
What I did, with some help of ChatGPT.
The newly random events are working flawless. I prepared Python script to check the quality of the Google .ics file. I have 3071 events and 9 of them gave an error.
Error parsing event: 'NoneType' object has no attribute 'dt'Indicates that one of the events in my .ics file has a missing or improperly formatted DTSTART or DTEND.
I made another script to check how much. Nine 9 events has missing date fields. Another script to remove those 9 entries and load it into MM. And now they show up.
But…then I saw an error at the console at the customEvents parts.
{ keyword: "Verjaardag", symbol: "birthday-cake", color: "Gold", transform: { search: "^([^']*) '(\\d{4})$", replace: "$1 ($2.)", yearmatchgroup: 2, }, },But with this code the other Google ics was working. Strange, without this code the two Google ics are working. So not sure if commenting the customEvents did the trick.
I can’t revert because I deleted the “wrong” events from the calendar.
KR,
Bert -
RE: Not loading one of two Google calendars
Hi Sam,
I’ll generate a .ics calendar file with 4500 events, including a mix of:
Single events: Appointments, meetings, etc.
Recurring events: Weekly or yearly recurrences for things like birthdays, anniversaries.
Time ranges: Events spanning multiple hours or days.
The events will cover the period from January 1st, 2019 to January 1st, 2026.I can put it at a website if you want? If you need an URL.
KR,
Bert -
RE: Not loading one of two Google calendars
Hi Sam,
The upcoming events are important. Always looking forward ;)
Is there a way setting variables to fix it? I can remove all old events from Google, but why? Maybe we need to import only future events.
What will be the best solution?
KR,
Bert -
RE: Not loading one of two Google calendars
Hi Sam,
Total number of events: 3080. 58 upcoming. So maybe too much?
I use MM at a Docker and that did not use PM2. The one from karsten13.
Ton of DEBUG with no errors. He is spitting all VEVENT form the past years.
KR,
Bert -
Not loading one of two Google calendars
Hi,
I am using the default MM calendar since ages with two Google urls. Since a week? one of them is not working anymore.
{ url: https://calendar.google.com/calendar/ical/email%40gmail.com/private-6.../basic.ics }The ICS is generated and seems to be fine.
Any ideas?
KR,
Bert -
Default module: Compliments is day_sunny working?
Hi,
At the compliments module you can the weather. I use the MMM-OpenWeatherForecast module.
And I think the CURRENTWEATHER_TYPE is not used used as a notification.
Any tips?
KR,
Bert -
RE: Bathroom mirror
Hi,
Really nice done!
What kind of mirror did you use? Glass? Foil?
Groeten,
Bert -
RE: MMM-RemoteControl or vcgencmd Issue
A (or my) Rpi4 has two HDMI ports. So you should add also the HDMI port 0 or 1 (or id 2 and id 7). docs
Status screen:
vcgencmd display_power -1 2 | grep -q "1" && echo "on" || echo "off" vcgencmd display_power -1 7 | grep -q "1" && echo "on" || echo "off"Regards,
Bert -
RE: Use of array within all module files
@sdetweil I am sorry and lost. ;)
The
sendSocketNotificationfrom node_helper.jsself.sendSocketNotification('MQTT_PAYLOAD', { topic: topic, value: value, subs: self.subscriptions )};So if I understand correctly…I should add
this.subscriptions = payload;at the receiving functionsocketNotificationReceivedat modulename.jssocketNotificationReceived: function(notification, payload) { this.subscriptions = payload; if (notification === 'MQTT_PAYLOAD') { // // } },I did that but it is not working. The array is not available at other functions within modulename.js.
At the node_helper part it is working.
this.subscriptions = (jsonObj);and I can use the array at other functions. withvar self = this; var l = self.subscriptions.length; // as an example. -
RE: Use of array within all module files
@sdetweil Thanks for your reply. Much appreciated!
I think I need another approach to get the result that I need. The
subscriptionsarray is (must be) part of thethis.config. So I addsubscriptions: [];to thedefaults:at the modulename.jsThe thing now is add the generated JSON (csvtojson) to the
this.config. :grinning_face_with_big_eyes: and I can usethis.configas a payload.The array is something like this:
subscriptions = [{ topic: 'homey/light/keuken/dimmer-fibaro-1/onoff', // MQTT Topic name label: 'Licht keuken', type: 'device', display: { left: 50, top: 50 }, }, { topic: 'homey/sensor/washok/temp-hum-xiaomi-1/measure-temperature', label: 'Washok Temp', type: 'label', display: { left: 265, top: 0, prefix: "", suffix: "°C", decimals: 0 }, } -
RE: Use of array within all module files
@sdetweil can you be more precise? I did not understand you.
The
subscriptionsis the generate json array with all kind of information to build an element / divs etc. That array is build at node_helper.js and globally needed within modulename.js.As I understand the way of working well…?
Regards,
Bert -
RE: Use of array within all module files
Hi Sam,
I take a look at that code. I can read it. ;) But can’t find the answer.
This are my thougts. From start() I send
this.sendSocketNotification('CONFIG', this.config);The
this.configpayload is needed at the node_helper.js at two places. One to figure out the csv file and do the MQTT stuff.CSVToJSON({ ignoreEmpty: true, trim: true }) .fromFile(CSVfile) .then((jsonObj) => { //console.log(jsonObj); this.subscriptions = (jsonObj); //JSON.parse this.setconfig(payload); })I forward the
this.configto the MQTT function. The arraysubscriptionsis available there. At the MQTT function:self.sendSocketNotification('MQTT_PAYLOAD', { topic: topic, value: value, subs: self.subscriptions )};These payloads arrived within the function at the module file. But I can not use the payload outside of that specific function.
I am not a programmer as you can see…just using reverse engineering and read a lot of configurations. I am almost there, I think.
Regards,
Bert -
Use of array within all module files
Hi,
I convert a CSV file to a JSON array at the node_helper.js file. This array (
subscriptions) is needed at several functions at the mmm-sample.js file.The array is available at other functions within the node_helper.js I use
this.subscriptions = (jsonObj);within the CSVtoJSON function and declarevar subscriptions = [];at the top of nodehelper.js and also at the mmm-sample.js.How can I achieve this? Do I need the
sendSocketNotificationfunctionality to send data back and forth between the files?Any help is much appreciated.
Regards,
Bert