MagicMirror² v2.12.0 is available! For more information about this release, check out this topic.

Looking for a module to show and hide different modules



  • Hello, i looking for a module to show and hide different modules.

    This is for the Spotify-Module with the compliment module. When I hear a song this is displayed to me with the Spotify module. In the middle of my Magic Mirror is the compliment Modul. Now i want show me the spotify module in the middle when I hear a song. the compliment module should then be hidden.
    When then nothing is played on Spotify the spotify module should be hidden and the compliment modul should then show me the compliments in the middle of my Magic Mirror.

    To hide the spotify module if nothing is played i have already added in my custom.css this code:

    .MMM-NowPlayingOnSpotify .NPOS_nothingIsPlayingContent {
    width: 100%;
    display: none;
    }

    This works fine.

    I hope someone can help me!

    0_1526671013260_MM_Spotify.JPG !

    MM with Spotify. When played a song. At the moment.

    0_1526671020740_MM_without_Spotify.JPG !

    MM without Spotify. No song is played



  • a module to show/hide would not be hard… but, how will you KNOW that spotify is playing (or has ended)…

    does the spotify playing module send notifications of these events?



  • I found in the code of the spotify module this html code:

    .NPOS_nothingIsPlayingContent

    This code worked when no song is played. So i can say when no song is played nothing are shown.



  • the question was, how do you KNOW that music is playing? what code tells u?

    I would expect the spotify playing module to do a sendNotification(“spotify_Playing”,something);

    so that other modules might know… it does not do that (looking at the code)…

    you could fork the existing code and add the 2 lines (one playing, one not) of code and submit an enhancement (pull) request to the module owner…


Log in to reply