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

    Posts

    Recent Best Controversial
    • RE: YouTube Subscriber Counter

      @choffmann - nice module.

      Here’s a similar one I put together last year - https://github.com/ianperrin/MMM-YouTubeChannelStats

      alt text

      posted in Requests
      I
      ianperrin
    • RE: [MMM-NetworkScanner] disable logging

      @binderth, @pugsly

      There is a (currently undocumented) debug config option in the module which minimises the logging. By default it should be set to false, but you can explicitly set it yourself

      i.e. debug: false,

      In earlier versions it had little effect, but in the latest commit, it should significantly reduce the volume of logging.

      See how it goes

      posted in Troubleshooting
      I
      ianperrin
    • RE: MMM-ModuleScheduler - Module Schedules and Notifications

      @Alvinger interesting, I’ll check it out.

      You may also be interested in taking a look at MMM-Remote-Control. It contains a heap of functions to control your mirror (including turning the monitor off and on, rebooting the pi, restarting the MM process etc) remotely.

      I’ve been working with @Jopyth to expose this functionality via the use of sendNotification.

      This should allow schedules like:

      notification_schedule: [
          {notification: 'REMOTE_ACTION', schedule: '30 9 * * *', payload: {action: 'MONITOROFF'}},
          {notification: 'REMOTE_ACTION', schedule: '30 18 * * *', payload: {action: 'MONITORON'}}
      ]
      

      Check out the repository on GitHub - the latest code includes this capability

      posted in System
      I
      ianperrin
    • RE: assign a symbol to a module

      You could also consider making the icon configurable via the options,

      First add the default values for the options

      	defaults: {
      		max: 5,
      		format: false,
      		types: {
      			INFO: "dimmed",
      			WARNING: "normal",
      			ERROR: "bright"
      		},
      		icons: {
      			INFO: "info",
      			WARNING: "exclamation",
      			ERROR: "exclamation-triangle"
      		}
      	},
      

      Then change the code to create the icon (and for bonus points, set class for the icon to the same as the message.

      		var iconCell = document.createElement("td");
      		var icon =  document.createElement("i");
      		if(this.config.icons.hasOwnProperty(this.messages[i].type)){
      			icon.classList.add("fa", "fa-" + this.config.icons[this.messages[i].type]);
      		} else {
      			icon.classList.add("fa", "fa-question");
      		}
      		if(this.config.types.hasOwnProperty(this.messages[i].type)){
      			icon.classList.add(this.config.types[this.messages[i].type]);
      		}
      		iconCell.appendChild(icon);
      		callWrapper.appendChild(iconCell);
      
      

      Warning - this code was entered directly here in the comment so may contain TyoPs ;)

      posted in Troubleshooting
      I
      ianperrin
    • RE: [MMM-NetworkScanner] disable logging

      @binderth

      Did you restart the mirror after the upgrade?
      Are there any errors in the browser console?
      What happens if debug is set to true?

      posted in Troubleshooting
      I
      ianperrin
    • RE: MMM-ModuleScheduler - Module Schedules and Notifications

      @MichMich - some great ideas, keep them coming.

      I’ve created issues (or rather enhancements) for these on GitHub - https://github.com/ianperrin/MMM-ModuleScheduler/issues. Feel free to review, comment etc.

      posted in System
      I
      ianperrin
    • RE: assign a symbol to a module

      Hi @dominic

      The simplest approach would be to add a “br” element between the temperature and humidity.

      However, I would consider putting them in an unordered list and take advantage of the inbuilt layout controls within FontAwesome. E.g.

      getDom: function() {
      	var wrapper = document.createElement("div");
      	if(this.dataFile){
      
      		var humidityRegExp = /Humidity = (.*?) %/ig;
      		var humidity = humidityRegExp.exec(this.dataFile)[1];
      
      		var temperatureRegExp = /Temperature = (.*?) *C/ig;
      		var temperature = temperatureRegExp.exec(this.dataFile)[1];
      
      		var list = document.createElement("ul");
      		list.classList.add("fa-ul");
      
      		// add temperature
      		var temperature_item = document.createElement("li");
      		var temperature_symbol =  document.createElement("i");
      		temperature_symbol.classList.add("fa", "fa-li", "fa-home");
      		temperature_item.appendChild(temperature_symbol);
      		temperature_item.appendChild(document.createTextNode(" " + temperature + "°C"));
      		list.appendChild(temperature_item);
      
      		// add humidity 
      		var humidity_item = document.createElement("li");
      		var humidity_symbol =  document.createElement("i");
      		humidity_symbol.classList.add("fa", "fa-li", "fa-tint");
      		humidity_item.appendChild(humidity_symbol);
      		humidity_item.appendChild(document.createTextNode(" " + humidity + "%"));
      		list.appendChild(humidity_item);
      
      		wrapper.appendChild(list);
      
      	} else {
      		wrapper.innerHTML = "No data";
      	}
      	return wrapper;
      },
      
      posted in Troubleshooting
      I
      ianperrin
    • RE: MMM-NetworkScanner Icons

      @zdenek the module currently only supports font awesome 4 so try video-camera.

      Unfortunately, raspberry-pi is only available in font awesome 5 so you won’t be able to use it just yet. However, once the fix to an issue with font awesome compatibility has been released, which is expected in version 2.7, you should be able to use all font awesome 5 free icons

      posted in Troubleshooting
      I
      ianperrin
    • RE: MMM-ModuleScheduler - Module Schedules and Notifications

      @Mitchfarino said in MMM-ModuleScheduler:

      @cowboysdude @ianperrin how would would I implement a schedule so that a module appeared for 5 minutes, then disappear and reappear in 5 minutes time?

      Try this

      module_schedule: {from: '0/10 * * * *',  to: '5/10 * * * *'}, 
      

      Which should equate to the module being

      • shown every 10 minutes starting from 0 minutes past the hour, i.e. 0, 10, 20 etc
      • hidden every 10 minutes starting from 5 minutes past the hour, i.e. 5, 15, 25 etc
      posted in System
      I
      ianperrin
    • RE: 2nd Page

      @dominic - there’s no functionality within MagicMirror out of the box to achieve this, but I can think of two options

      • MMM-Carousel which allows modules to be displayed in a rotating carousel
      • MMM-ModuleScheduler which allows you to schedule when modules should be shown and hidden
      posted in Troubleshooting
      I
      ianperrin
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 5 / 7