MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. lavolp3
    3. Best
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 0
    • Followers 11
    • Topics 38
    • Posts 892
    • Groups 3

    Posts

    Recent Best Controversial
    • RE: birthday list Implementation

      @veldje I have solved this by including a “birthday” calendar from google and giving at an own symbol.
      For that I have created an own calendar within google, transferred all birthdays to that (didn’t take long) and included that calendar into the config.

      6bbebc11-c9d8-4b0e-95ba-af46359dd39b-image.png

      posted in Forum
      lavolp3L
      lavolp3
    • RE: npm install vulnerabilities

      @OneAsianTortoise I wouldn’t do much about it as well. As @sdetweil said, they are only warnings. Your mirror will run with these warnings.
      What I think is unproblematic is running:

      npm audit fix
      

      These are automatic fixes on the vulnerabilities that are obvious for the system.
      I haven’t heard of anyone breaking their software doing this.

      posted in Troubleshooting
      lavolp3L
      lavolp3
    • RE: MMM-OralB / Bluetooth equipped toothbrush integration

      I can’t PR to your new repo, so here’s the code from MMM-BluetoothDevices.js:

      /*jshint esversion: 6 */
      //'use strict';
      
      Module.register('MMM-BluetoothDevices', {
        // Default module config.
        defaults: {
          name: 'raspberrypi',
          mode: 'le',
          hci: 'hci0',
          interfaceName: 'org.bluez.Adapter1',
          services: [
            { type: 'CurrentTimeService' },
          ],
          devices: [],
          layout: {
            title: {
              position: 'bottom',
              key: 'name',
            },
            data: {
              position: 'bottom',
              fields: [
                { key: 'mode', text: 'mode' },
              ],
            },
          },
          hideAfter: 10 * 60,
        },
      
        getStyles() {
          return ['MMM-BluetoothDevices.css'];
        },
      
        // Override dom generator.
        getDom() {
          const wrapper = document.createElement('div');
          wrapper.classList.add('toothbrushes');
      
          if (this.loading) {
            wrapper.innerHTML = 'Loading...';
            wrapper.className = 'light small';
      
            return wrapper;
          }
      
          const table = document.createElement('table');
          const row = document.createElement('tr');
      
          for (const deviceKey in this.devices) {
            const deviceType = this.devices[deviceKey].device.type;
      
            if (deviceType === 'OralBToothbrush') {
              row.appendChild(this.renderToothbrush(deviceKey));
            } else {
              throw new Error(`Unknown device type: ${deviceType}`);
            }
          }
      
          table.appendChild(row);
          wrapper.appendChild(table);
      
          return wrapper;
        },
      
        renderToothbrush(deviceKey) {
          const device = this.devices[deviceKey];
          const deviceTd = document.createElement('td');
          deviceTd.classList.add('toothbrush');
          deviceTd.style.textAlign = "center";
      
          const deviceCircle = document.createElement('div');
          deviceCircle.classList.add('toothbrush-circle-container');
          deviceCircle.classList.add(`toothbrush-circle-${device.data.state}`);
      
          const deviceCircleText = document.createElement('div');
          deviceCircleText.classList.add('toothbrush-circle-text');
      
          const deviceCircleSvg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
          deviceCircleSvg.classList.add('toothbrush-circle-ring');
      
          const deviceCircleSvgCircle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
          deviceCircleSvgCircle.classList.add('toothbrush-circle');
          deviceCircleSvgCircle.setAttribute('stroke-width', 15);
          deviceCircleSvgCircle.setAttribute('fill', 'transparent');
          deviceCircleSvgCircle.setAttribute('r', 52);
          deviceCircleSvgCircle.setAttribute('cx', 60);
          deviceCircleSvgCircle.setAttribute('cy', 60);
      
          deviceCircleSvg.append(deviceCircleSvgCircle);
          deviceCircle.append(deviceCircleSvg);
          deviceCircle.append(deviceCircleText);
      
          //const time = device.data.time > 120 ? 120 : device.data.time;
          const time = device.data.time;
      
          // initial start
          this.updateCircle(deviceCircleSvgCircle, deviceCircleText, time);
      
          if (device.data.state === 'running') {
            deviceTd.style.display = 'block';
            deviceCircleText.classList.add('bright');
            deviceCircleSvgCircle.setAttribute('stroke', '#0080fe');
            this.counters[deviceKey] = {
              time,
              interval: setInterval(() => {
      
                this.counters[deviceKey].time += 1;
      
                this.updateCircle(
                  deviceCircleSvgCircle,
                  deviceCircleText,
                  this.counters[deviceKey].time
                );
              }, 1000),
            };
          } else {
            deviceCircleText.classList.remove("bright");
            deviceCircleSvgCircle.setAttribute('stroke', '#aaa');
            setInterval(() => {
              deviceTd.style.display = "none";
            }, this.config.hideAfter * 1000);
          }
      
          const deviceLabel = document.createElement('div');
          deviceLabel.classList.add('title');
          deviceLabel.classList.add('small');
          deviceLabel.innerText = device.device[this.config.layout.title.key];
      
          const dataContainer = document.createElement('div');
          dataContainer.classList.add('small');
          dataContainer.classList.add('light');
          for (const key in this.config.layout.data.fields) {
            const data = this.config.layout.data.fields[key];
            const field = document.createElement('div');
            field.innerText = `${data.key}: ${device.data[data.key]}`;
            dataContainer.appendChild(field);
          }
      
          if (this.config.layout.title.position === 'top') {
            deviceTd.appendChild(deviceLabel);
          }
          if (this.config.layout.data.position === 'top') {
            deviceTd.appendChild(dataContainer);
          }
      
          deviceTd.appendChild(deviceCircle);
      
          if (this.config.layout.title.position === 'bottom') {
            deviceTd.appendChild(deviceLabel);
          }
          if (this.config.layout.data.position === 'bottom') {
            deviceTd.appendChild(dataContainer);
          }
      
          return deviceTd;
        },
      
        updateCircle(deviceCircleSvgCircle, deviceCircleText, time) {
          var secs = time % 60;
          deviceCircleText.innerText = Math.floor(time / 60) + ":" + (secs < 10 ? "0" + secs : secs);
      
          const radius = parseInt(deviceCircleSvgCircle.getAttribute('r'));
          const circumference = radius * 2 * Math.PI;
          if (time > 120) { time = 120; }
          const percent = (100 / 120) * time;
          const offset = circumference - percent / 100 * circumference;
          deviceCircleSvgCircle.style.strokeDasharray = `${circumference} ${circumference}`;
          deviceCircleSvgCircle.style.strokeDashoffset = offset;
        },
      
        start() {
          Log.info(`Starting module: ${this.name}`);
      
          this.devices = {};
          this.counters = {};
          this.loading = true;
      
          this.sendSocketNotification('FETCH_TOOTHBRUSHES', this.config);
        },
      
        socketNotificationReceived(notification, payload) {
          if (notification === 'FETCH_TOOTHBRUSHES_RESULTS') {
            Log.info('MMM-Toothbrush: Got toothbrush results');
            this.devices = payload;
      
            for (const counterKey in this.counters) {
              const counter = this.counters[counterKey];
              clearInterval(counter.interval);
            }
      
            if (this.loading) {
              this.loading = false;
              this.updateDom(1000);
            } else {
              this.updateDom(0);
            }
          }
        },
      });
      

      it’s also in the develop branch of my module

      posted in Development
      lavolp3L
      lavolp3
    • RE: Make Mirror brighter through custom.css

      @simphi yeah you can include these items in custom.css and play with them

      .dimmed {
      color: #ccc;
      }
      
      .normal {
      color: #eee;
      }
      
      .bright {
      color: #fff;
      }
      

      Color: #fff is white. You could also write it as #ffffff.
      #eee or #eeeeee is a very light grey.

      posted in Custom CSS
      lavolp3L
      lavolp3
    • RE: Changing the colour of all text on screen

      @boybay7 said in Changing the colour of all text on screen:

      Also I’m still confused with how to update the magicmirror, I think you need to use git stash? I don’t know

      You only need git stash when you have made changes to the source code that you want to keep while updating. So don’t worry about that for now.

      The usual update procedure is

      git pull
      npm install
      

      inside the MagicMirror folder.

      As a newbie you might want to check out @sdetweil 's scripts. Lots of automation in there.
      https://github.com/sdetweil/MagicMirror_scripts

      posted in Troubleshooting
      lavolp3L
      lavolp3
    • RE: Monitor external program...

      @BKeyport There is very likely an npm module for that.
      Like this one:
      https://www.npmjs.com/package/find-process

      posted in Development
      lavolp3L
      lavolp3
    • RE: MMM-DarkSkyForecast - Yet ANOTHER weather module

      @hansolo MMM-forecast-io has sunset and sunrise time integrated and both take data from the same source.

      0_1550518122660_d5321de8-3157-46fb-980b-87611dde45aa-image.png

      So yes, it’s possible. The data is there. But I’m out. I’m unfortunately currently sitting on other projects.

      posted in Utilities
      lavolp3L
      lavolp3
    • RE: Changing the colour of all text on screen

      @boybay7 said in Changing the colour of all text on screen:

      Also I couldn’t remove the fade off the weather forecast for some reason?

      For that you need to have a look at the module docs
      https://docs.magicmirror.builders/modules/weather.html#weather-forecast-options
      The weather module is a “stock module”, the docs for all stock modules are placed in the official MagicMirror docs. Any 3rd party modules have their own docs on the respective github site.

      At the above link you find the fade: option. Set that to false in your config.js
      Or set the fadepoint to a higher value: fadePoint: 0.5

      posted in Troubleshooting
      lavolp3L
      lavolp3
    • RE: Monitor external program...

      This seems to be a good solution as well.
      https://www.npmjs.com/package/ps-node

      posted in Development
      lavolp3L
      lavolp3
    • RE: MMM-forecast-io -- Localized up to the minute weather

      @code999 it’s in the MMM-forecast-io.js file.

      You can either try to comment out (//) or delete line 397

      forecastBar.appendChild(bar);
      

      (only the bar)
      or line 402

      forecastBarWrapper.appendChild(forecastBar);
      

      (with temps)

      But why are you trying to delete it? It really doesn’t make sense to me and will look kind of ugly I guess.

      posted in Utilities
      lavolp3L
      lavolp3
    • 1
    • 2
    • 9
    • 10
    • 11
    • 12
    • 13
    • 11 / 13