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

    gonzonia

    @gonzonia

    6
    Reputation
    220
    Profile views
    134
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    gonzonia Unfollow Follow

    Best posts made by gonzonia

    • RE: Wayland question

      @sdetweil I think that worked. I was able to start it with pm2.

      posted in Troubleshooting
      G
      gonzonia
    • RE: new update/upgrade script, ready for testing

      @sdetweil

      I’m just going to rebuild. I’ll let you know if I hit any snags. Thanks again.

      posted in General Discussion
      G
      gonzonia
    • RE: MMM-MealViewer

      @cowboysdude Thanks! I might switch to that. I’ve had to rework it a little because the URL wasn’t getting set except at the first call. I just moved setup for that into the getMenuData and I think it’s all working now. I’ll give it a day to run and see what happens tomorrow before I try messing with it again and update the file on github.

      -updated to fix grammar

      posted in Development
      G
      gonzonia
    • RE: MMM-BMW-DS (A different kind of weather module)

      With the end of DarkSky API, I’ve forked this and updated it to use PirateWeather. https://github.com/gonzonia/MMM-BMW-PW

      All coding credit goes to @Mykle1 . I pretty much just changed the name and a URL. Pirateweather does not support languages though and that was removed.

      posted in Utilities
      G
      gonzonia
    • Updated MMM-Dynamic-Modules

      If anyone’s interested I updated MMM-Dynamic-Modules and added some functionality.

      Orginal module by Toreke (https://github.com/Toreke/)

      Magic Mirror² Module: MMM-Dynamic-Modules

      MMM-Dynamic-Modules moves modules without need to restart Magic Mirror. Module also allows to hide or show modules. Module has method to change configured positions back. Can also dynamically adjust based on screen orientation and update based on notifications received that aren’t sent specifically to the module.

      Example

      These use the same config file and only minimal changes to CSS for landscape. My primary screen that’s on all the time is in portrait. The clock and MMM-BMW-PW was shifted from top_bar to upper_third. The newsfeed was moved from bottom_left to bottom_bar. MMM-News-QR was moved from bottom_right to bottom_bar. More drastic maneuvirng can be accomplished by incorporating CSS changes like the example posted here https://forum.magicmirror.builders/topic/13197/change-the-regions-positions

      PORTRAIT:
      Screenshot portrait.png
      LANDSCAPE:
      Screenshot landscape.png
      Installation

      cd ~/MagicMirror/modules
      git clone https://github.com/gonzonia/MMM-Dynamic-Modules.git
      Config
      

      The entry in config.js can include the following options:

      Option	                       |                           Description
      swapOrientation	       |    true or false, whether to move modules based on the screen orientation            
      LandscapeConfig	       |  JSON string for moving/hiding when in landscape
      PortraitConfig	       |  JSON string for moving/hiding when in portrait
      UpdateNotifications |   List of notifications that will trigger the update based on orientation. (Will always include the system, "DOM_OBJECTS_CREATED")
      
      {
      	module: "MMM-Dynamic-Modules",
      	classes: 'SceneFamily SceneSam',
      	config: {
      		swapOrientation: true,
      		LandscapeConfig: '{"newsfeed":{"position": "bottom_bar","visible": true},"MMM-News-QR":{"position":"bottom_bar"},"MMM-BMW-PW":{"position":"upper_third"},"clock":{"position": "upper_third"}}',
      		UpdateNotifications:"NEWS_FEED_UPDATE"
      	},
      },
      

      How to use

      Module can be used by sending an change notification with a payload:

      this.sendNotification('CHANGE_POSITIONS', 
      	modules = {
      		'clock':{
      			visible: 'true',
      			position: 'top_right',
      		},
      		'MMM-WeeklySchedule':{
      			visible: 'true',
      			position: 'top_left',
      		},
      		'MMM-AirQuality':{
      			visible: 'true',
      			position: 'bottom_bar',
      		}
      	}
      );
      

      Sending a notification to reset to positions according to your config:

      this.sendNotification(CHANGE_POSITIONS_DEFAULTS);
      

      OR move based on orientation the Config passed to LanscapeConfig or PortraitConfig must be valid JSON in a format like the one below. The slightest typo and it won’t work.

      swapOrientation: true,
      LandscapeConfig: '{"newsfeed":{"position": "bottom_bar","visible": true},"MMM-News-QR":{"position":"bottom_bar"},"MMM-BMW-PW":{"position":"upper_third"},"clock":{"position": "upper_third"}}',
      

      Order of the modules matters. If there is multiple modules in the same position, first module will be top, second module under it, and so on. If multiple instances of a module are being used, they will ALL be moved or hidden.

      Tips: Best when used in conjunction with CSS. Use

      @media (orientation: landscape) { 
      
      }
      

      and

      @media (orientation: portrait) {
      
      }
      

      to create stylesheets for specific screen orientations.

      You can also add

      and (max-width: 3840px) 
      

      to either one if you want to create something that is for 4K. This would come in handy if say your main mirror is 1080p but you want to have a separate browser somewhere else showing the mirror on a TV or higher resolution monitor.

      posted in System
      G
      gonzonia
    • RE: MMM-CalendarExt3

      @sdetweil Just to close the loop on this. I updated MMM-Pir (there was another update soon after I posted) and switched to the updated MMM-Scenes2 and everything seems stable now.

      posted in Utilities
      G
      gonzonia

    Latest posts made by gonzonia

    • RE: Periodic Table of Elements

      @Divis you wouldn’t need to make a module. You could use even use the default newsfeed module. You’d just need to create the XML file in the right format with the content to display.

      https://www.rssboard.org/rss-specification

      posted in Requests
      G
      gonzonia
    • RE: Periodic Table of Elements

      @Divis said in Periodic Table of Elements:

      friend that is a chemist. I have done extensive digging but cannot seem to find any modules that are related to chemistry. My ideal module would be something that would go through the periodic table of elements and randomly choose an element to give facts, history, and/or a story on its discovery. Something similar to the “today in history” but not time associate

      If you want to create the data, you can probably use an RSS reader to go through it

      posted in Requests
      G
      gonzonia
    • RE: Wayland question

      @sdetweil I think that worked. I was able to start it with pm2.

      posted in Troubleshooting
      G
      gonzonia
    • RE: Wayland question

      @sdetweil said in Wayland question:

      MagicMirror/installers/mm.sh

      I have a theory…I did the install via ssh and not directly on the pi. Maybe that broke it?

      posted in Troubleshooting
      G
      gonzonia
    • RE: Wayland question

      @sdetweil

      WAYLAND_DISPLAY=wayland-0
      
      posted in Troubleshooting
      G
      gonzonia
    • Wayland question

      I know this has been fixed (at least I think it has) I just can’t find what the fix is. My SD got corrupted so I’m re-installing. Clean install of PiOS on a Pi4b. Used @sdetweil script to install.

      Starting with npm run start:wayland seems to work but when I reboot and it tries to start it doesn’t work.

      What do I need to change?

      posted in Troubleshooting
      G
      gonzonia
    • Updated MMM-Dynamic-Modules

      If anyone’s interested I updated MMM-Dynamic-Modules and added some functionality.

      Orginal module by Toreke (https://github.com/Toreke/)

      Magic Mirror² Module: MMM-Dynamic-Modules

      MMM-Dynamic-Modules moves modules without need to restart Magic Mirror. Module also allows to hide or show modules. Module has method to change configured positions back. Can also dynamically adjust based on screen orientation and update based on notifications received that aren’t sent specifically to the module.

      Example

      These use the same config file and only minimal changes to CSS for landscape. My primary screen that’s on all the time is in portrait. The clock and MMM-BMW-PW was shifted from top_bar to upper_third. The newsfeed was moved from bottom_left to bottom_bar. MMM-News-QR was moved from bottom_right to bottom_bar. More drastic maneuvirng can be accomplished by incorporating CSS changes like the example posted here https://forum.magicmirror.builders/topic/13197/change-the-regions-positions

      PORTRAIT:
      Screenshot portrait.png
      LANDSCAPE:
      Screenshot landscape.png
      Installation

      cd ~/MagicMirror/modules
      git clone https://github.com/gonzonia/MMM-Dynamic-Modules.git
      Config
      

      The entry in config.js can include the following options:

      Option	                       |                           Description
      swapOrientation	       |    true or false, whether to move modules based on the screen orientation            
      LandscapeConfig	       |  JSON string for moving/hiding when in landscape
      PortraitConfig	       |  JSON string for moving/hiding when in portrait
      UpdateNotifications |   List of notifications that will trigger the update based on orientation. (Will always include the system, "DOM_OBJECTS_CREATED")
      
      {
      	module: "MMM-Dynamic-Modules",
      	classes: 'SceneFamily SceneSam',
      	config: {
      		swapOrientation: true,
      		LandscapeConfig: '{"newsfeed":{"position": "bottom_bar","visible": true},"MMM-News-QR":{"position":"bottom_bar"},"MMM-BMW-PW":{"position":"upper_third"},"clock":{"position": "upper_third"}}',
      		UpdateNotifications:"NEWS_FEED_UPDATE"
      	},
      },
      

      How to use

      Module can be used by sending an change notification with a payload:

      this.sendNotification('CHANGE_POSITIONS', 
      	modules = {
      		'clock':{
      			visible: 'true',
      			position: 'top_right',
      		},
      		'MMM-WeeklySchedule':{
      			visible: 'true',
      			position: 'top_left',
      		},
      		'MMM-AirQuality':{
      			visible: 'true',
      			position: 'bottom_bar',
      		}
      	}
      );
      

      Sending a notification to reset to positions according to your config:

      this.sendNotification(CHANGE_POSITIONS_DEFAULTS);
      

      OR move based on orientation the Config passed to LanscapeConfig or PortraitConfig must be valid JSON in a format like the one below. The slightest typo and it won’t work.

      swapOrientation: true,
      LandscapeConfig: '{"newsfeed":{"position": "bottom_bar","visible": true},"MMM-News-QR":{"position":"bottom_bar"},"MMM-BMW-PW":{"position":"upper_third"},"clock":{"position": "upper_third"}}',
      

      Order of the modules matters. If there is multiple modules in the same position, first module will be top, second module under it, and so on. If multiple instances of a module are being used, they will ALL be moved or hidden.

      Tips: Best when used in conjunction with CSS. Use

      @media (orientation: landscape) { 
      
      }
      

      and

      @media (orientation: portrait) {
      
      }
      

      to create stylesheets for specific screen orientations.

      You can also add

      and (max-width: 3840px) 
      

      to either one if you want to create something that is for 4K. This would come in handy if say your main mirror is 1080p but you want to have a separate browser somewhere else showing the mirror on a TV or higher resolution monitor.

      posted in System
      G
      gonzonia
    • RE: Change layout based on orientation?

      @sdetweil I’m going to make it more dynamic. There’s actually screen.orientation.type that works to get landscape vs portrait

      posted in Development
      G
      gonzonia
    • RE: Change layout based on orientation?

      @sdetweil Maybe. I find it easier to build on someone else’s code. After I have some basic stuff functioning, I’ll look for a module template to work from. I’m also not sure the dynamic module will work (it’s 7 years old) so it might need to be updated anyhow.

      posted in Development
      G
      gonzonia
    • RE: Change layout based on orientation?

      @sdetweil That’s a thought. I think I can probably adapt the Dynamic Modules to allow for a config option to adjust based on orientation and that gets triggered at the ALL_MODULES_STARTED notification from the core.

      Let me fork that and see if I can make that work.

      posted in Development
      G
      gonzonia