• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Seperate Config for Web Access

Scheduled Pinned Locked Moved Tutorials
7 Posts 2 Posters 941 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    cweinhofer
    last edited by Sep 7, 2022, 8:50 PM

    TL;DR Is there a way to have a different config when the MM is accessed remotely via web vs what shows on the local display?

    My magic mirror is set up to show clock data, weather data, info from a few temp sensors I have around the house. But I also use https://github.com/darickc/MMM-BackgroundSlideshow so it does double duty as a photo frame.

    I also display the same info, minus the BackgroundSlideshow, on smaller screens that I have around the house (typically old tablets) using the web access. In order to not run the BackgroundSlideshow module on these secondary screens, I have to run a second instance – similar to what is described here: https://forum.magicmirror.builders/topic/15123/multiple-instances – which means my temp sensors have to send their data twice, my weather app has to make API calls twice, etc.

    It would be great if there was a way to have only one MM instance, but display it’s info in two different configurations – one for local and one for remote.

    S 1 Reply Last reply Sep 8, 2022, 1:27 AM Reply Quote 0
    • S Away
      sdetweil @cweinhofer
      last edited by sdetweil Sep 8, 2022, 2:13 AM Sep 8, 2022, 1:27 AM

      @cweinhofer currently there is no way to have a different display output from the same config.

      you can force a local css, which could hide some things, but weather on each will call into API twice

      local css info
      https://www.lostsaloon.com/technology/using-a-custom-stylesheet-in-a-web-browser/

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • C Offline
        cweinhofer
        last edited by Sep 11, 2022, 11:13 AM

        @sdetweil Thanks for the suggestion. I was hopeful as the style inspector showed that I could pretty much do what I wanted with

        .MMM-BackgroundSlideshow {
            display: none;
        }
        

        Unfortunately, I wasn’t able to get it working based on the info in the link you sent. I did a little more digging and it looks like both Chrome and Firefox removed support for user stylesheets a few years back. My guess is that even if I could re-enable it (or find some extension that mimiced it) on the desktop, doing so on the mobile browser would probably be much difficult and/or impossible.

        Do you know if the ability to have multiple configurations has been suggested before as a feature request? I’ve been mulling it over and I think I might have a way to implement this (in a limited sense) in a simpler way that wouldn’t require multiple config.js files.

        S 2 Replies Last reply Sep 11, 2022, 12:14 PM Reply Quote 0
        • S Away
          sdetweil @cweinhofer
          last edited by sdetweil Sep 11, 2022, 12:52 PM Sep 11, 2022, 12:14 PM

          @cweinhofer I have not seen such a request

          the code loads all the modules and style sheets once

          only thing I can think of is to have another module that can determine the client IP identity and use that to show/hide modules. as that is all mm can do currently

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          1 Reply Last reply Reply Quote 0
          • S Away
            sdetweil @cweinhofer
            last edited by sdetweil Sep 14, 2022, 2:24 AM Sep 11, 2022, 1:35 PM

            @cweinhofer try this… this what I was thinking before

            https://www.trysmudford.com/blog/chrome-local-overrides/

            it still works

            then u could do like MMM-Pages

            specify extra classes:

            for the modules U want to show on client 1, and client 2

            then in the overrides custom.css show that class

            I think css is top down, so you could hide all of them (display:none)
            and show only the one u care about here later (further down)

            takes a bit of setup on each client… make the folder, add the subfolders, turn it on in dev window for that url

            one thing, if you use the display: none approach, the apis will still be called, and the module will still create the content, and then the browser will be told not to display it. the module does not know it’s content is hidden

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • S sdetweil referenced this topic on Sep 12, 2022, 1:27 PM
            • S sdetweil referenced this topic on Sep 22, 2022, 11:26 AM
            • C Offline
              cweinhofer
              last edited by Sep 22, 2022, 11:27 AM

              @sdetweil Thanks for the updated alternative.

              Unfortunately, it seems like this feature is only available on the desktop. In my case I’m using Android phones and/or tablets for my remote displays. I’ll be interested to see what the guy using the FireTVs and/or AndroidTVs is able to do.

              Anyway, I wrote up a feature suggestion that would allow for what I want and posted it in that category.

              https://forum.magicmirror.builders/topic/17226/seperate-config-for-web-access

              S 1 Reply Last reply Sep 22, 2022, 12:59 PM Reply Quote 0
              • S Away
                sdetweil @cweinhofer
                last edited by Sep 22, 2022, 12:59 PM

                @cweinhofer as mentioned over there, open an issue on GitHub for the project owners to examine

                many old I* devices don’t support the es6 JavaScript operators that most of us are using and going to. so the code won’t run. don’t know about android, but would expect the same problem

                I know there was a PR a couple years ago to restore the old operator based code, but it was not selected

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • 1 / 1
                1 / 1
                • First post
                  1/7
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Sam, technical setup by Karsten.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy