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.

    MMM-Buttons calling MMM-Remote config help

    Scheduled Pinned Locked Moved Unsolved Troubleshooting
    2 Posts 1 Posters 1.7k Views 1 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.
    • G Offline
      grantc66
      last edited by grantc66

      Hi, bit new to linux only got a pi 3 months ago and its been a bit of a steep learning curve.

      I’m having a bit of trouble understanding how to configure config.js What I’m trying to do is get MMM-Buttons to send a message to MMM-Remote to hide a module.

      Everything runs ok (remote hides modules when access from my phone), but pressing the button does nothing. I’m guessing I’ve misunderstood how to configure the payload.

      Config for Buttons looks like this:

      {module: 'MMM-Buttons',
          config: {
              buttons: [
                  {
                      pin: 32,
                      name: "monitor_control",
                      longPress: {
                          notification: "REMOTE_ACTION",
                          payload: {action: "HIDE", "moduleData":[
          {"hidden":true,"name":"clock","identifier":"module_1_clock","position":"top_left"},],},},
                      shortPress: {
                          notification: "REMOTE_ACTION",
                          payload: {action: "SHOW","moduleData":[
          {"hidden":false,"name":"clock","identifier":"module_1_clock","position":"top_left"},],},}		    
           		}]
      },
      

      config for remote section (same file config.js)

      {
          module: 'MMM-Remote-Control',
      position: "bottom_bar"
          // uncomment the following line to show the URL of the remote control on the mirror
          // , position: 'bottom_left'
          // you can hide this module afterwards from the remote control itself
      },
      

      Any advice would be appreciated.

      Thanks.
      Grant
      :::

      Spoiler Text

      :::

      1 Reply Last reply Reply Quote 0
      • G Offline
        grantc66
        last edited by grantc66

        I was thinking that MMM-Remote-Control was sending the notification, hence the confusion.

        Cleaned the config up to look like this:

        {module: 'MMM-Buttons',
            config: {
                buttons: [
                    {
                        pin: 32,
                        name: "monitor_control",
                        longPress: {
                            notification: "REMOTE_ACTION",
                            payload: {"action": "HIDE", "module": "module_1_clock"}
        		},
                        shortPress: {
                            notification: "REMOTE_ACTION",
                            payload: {"action": "SHOW", "module": "module_1_clock"}
        		}		    
             		}
        	]
        }},``
        

        Can I add another payload from the same action i.e. hide clock & calendar?

        Not had any success with that so far, can somebody give me a pointer to the syntax.

        Ta.

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          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