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.

    Hide Rain-Modul with MMM-Alexa-Control and MMM-Remote-Control

    Scheduled Pinned Locked Moved Troubleshooting
    8 Posts 2 Posters 1.1k Views 3 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.
    • R Offline
      radioman
      last edited by

      Hello
      I have a question about the Alexa Control Module:
      I am using the remote module and the Alexa control module.
      I would like to show the RainRadar module and hide what works with the remote module.
      There is a code in the rain module

      
      ///// Add this function to the modules you want to control with voice //////
      
      notificationReceived: function (notification, payload) {
      if (notification === 'HIDE_RADAR') {
      this.hide (1000);
      } else if (notification === 'SHOW_RADAR') {
      this.show (1000);
      }
      
      },
      
      })
      
      
      

      I would like to know where to insert this code in the config
      and whether I can take it over because of the syntax

      I would be grateful for help

      S 1 Reply Last reply Reply Quote 0
      • S Offline
        sdetweil @radioman
        last edited by

        @radioman you would have to make a custom device with your action

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • R Offline
          radioman
          last edited by

          I don’t know what you mean by costum device
          Can you give me a code example or can I do it like that

          notifications: [
              {
                  name: 'Notification 2',
                  port: 11101,
                  OnOff: true,
                  notification: [["NOTIFICATION ON", "PAYLOAD ON"],["NOTIFICATION OFF", "PAYLOAD OFF"]]
              }
          ]
          

          Then the question what does a notification and a payload look like in my case

          I got this example from the Githup Homepage with the MMM-Alexa control module

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @radioman
            last edited by

            @radioman you didn’t read the rest

            Notification devices
            Notification devices allows you to send notifications to other modules.
            You can send the same notification when you turn the device on and off like this:
            Note: You have to put the notifications array you chose inside the config part.
            
            notifications: [
                {
                    name: 'Notificaition 1',
                    port: 11100,
                    OnOff: false,
                    notification: ["NOTIFICATION", "PAYLOAD"]
                }
            ]
            You can send different notifications when you turn a device on or off like this:
            
            notifications: [
                {
                    name: 'Notification 2',
                    port: 11101,
                    OnOff: true,
                    notification: [["NOTIFICATION ON", "PAYLOAD ON"],["NOTIFICATION OFF", "PAYLOAD OFF"]]
                }
            ]
            Note: NOTIFICATION ON and NOTIFICATION OFF stay for the different notifications you can send when you turn on or off the device. The same thing applies to PAYLOAD ON and PAYLOAD OFF.
            
            These are the configuration options for a notification device:  / < ===================================
            Note: They are all necessary.
            
            Option	Description
            name	Here you can name your device. Make sure you didn't used the name before. Delete first the old device.
            port	Here you can give the device a static Port. I suggest that to you because then there aren't overlaps. Preferably start with the port 11100.
            OnOff	If you want to send the same notification when you turn a device on and off chose true. Otherwise if you want to send different notifications chose false.
            Possible values: true and false
            notification	If OnOff is true:
            notification: [["NOTIFICATION ON","PAYLOAD"],["NOTIFICATION OFF", "PAYLOAD"]]
            Replace the notifications and the payloads.
            If OnOff is false:
            notification: ["NOTIFICATION", "PAYLOAD"]
            Replace the notification and payload.
            

            further down there is a Command Device
            and beyond that is Custom Device

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              sdetweil @sdetweil
              last edited by sdetweil

              @radioman

              and he provided a sample for a notification device in the config section of the module def

              notifications: [
                  {
                      name: 'Notification 2',
                      port: 11101,
                      OnOff: true,
                      notification: [["NOTIFICATION ON", "PAYLOAD ON"],["NOTIFICATION OFF", "PAYLOAD OFF"]]
                  }
              

              so a sample config with this

              
              		{
              			module: "MMM-AlexaControl",
              			disabled: false,
              			position: "bottom_left",
              			config: {
              				deviceName: "desk",
              				image: false,
              				pm2ProcessName: "MagicMirror",
              				vcgencmd: "hide",
              				monitorToggle: true,
              				startPort: 16000,
              				reboot: true,
              				shutdown: true,
              				stop: true,
                                              notifications: [
                                                             {
                                                                 name: 'Notification 2',
                                                                 port: 11101,
                                                                 OnOff: true,
                                                                 notification: [["NOTIFICATION ON", "PAYLOAD ON"],["NOTIFICATION OFF", "PAYLOAD OFF"]]
                                                                 }
                                             ]
              			},
              		},
              

              and u have

              if (notification === 'HIDE_RADAR') {
              this.hide (1000);
              } else if (notification === 'SHOW_RADAR') {
              this.show (1000);
              

              remember this is a dumb electric outlet, on or off, what do you want to send when?

              so I assume as u have no payload check
              on = HIDE_RADAR, and off means SHOW_RADAR

               notification: [["HIDE_RADAR", null],["SHOW_RADAR", null]]
              

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • R Offline
                radioman
                last edited by

                Ok, I have now entered that

                {
                            module: 'MMM-AlexaControl',
                            position: 'bottom_left',
                            config:{
                                image: false,
                                pm2ProcessName: "mm",
                                refresh: true,
                                restart: true,
                                reboot: false,
                                monitorToggle: true,
                                vcgencmd: 'vcgencmd',
                                deviceName: "Spiegel",
                                startPort: 12000,
                                   notifications: [
                    {
                        name: 'Radar',
                        port: 12101,
                        OnOff: true,
                        notification: [["NOTIFICATION ON", "SHOW_RADAR"],["NOTIFICATION OFF", "HIDE_RADAR"]]
                    }
                ]
                          
                         }
                        },	
                
                

                Alexa also finds a device but I can’t control it
                What would I have to enter with notificaton and with Payload

                Or am I not allowed to change the payload

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil @radioman
                  last edited by

                  @radioman I gave u the sample above w your notification!?

                  and you say Alexa turn off Radar, or Alexa turn on Radar

                  it’s an outlet device on or off

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • R Offline
                    radioman
                    last edited by

                    OK
                    I read your post again carefully and have now understood it
                    and it works.
                    Many thanks

                    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