MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    1. Home
    2. MilkShake
    M
    • Profile
    • Following 1
    • Followers 0
    • Topics 6
    • Posts 51
    • Best 1
    • Controversial 0
    • Groups 0

    MilkShake

    @MilkShake

    1
    Reputation
    132
    Profile views
    51
    Posts
    0
    Followers
    1
    Following
    Joined Last Online

    MilkShake Unfollow Follow

    Best posts made by MilkShake

    • RE: Syntax of MMM-NotificationTrigger

      @MilkShake Got it to work using:

      {
         module: "MMM-NotificationTrigger",
         config: {
           useWebhook:true,
      	 triggers:[
      	   {
      	      trigger: "PLAY_SOUND",
      		  fires: [
      		    {
      			fire: "USER_PRESENCE",
      			payload: function(payload) {
                        return false
                      }
      			}
      		  
      	   ]
      	 },
      	 {
      	    trigger: "OPEN_GATE",
      		fires: [
      		   {
      		   fire: "OPENING_THE_GATE",
      		   exec: "sudo python /home/pi/open_gate.py"
      		   }
      		]
      	 },
         ]
        }
      },
      
      posted in General Discussion
      M
      MilkShake

    Latest posts made by MilkShake

    • RE: Syntax of MMM-NotificationTrigger

      @MilkShake Got it to work using:

      {
         module: "MMM-NotificationTrigger",
         config: {
           useWebhook:true,
      	 triggers:[
      	   {
      	      trigger: "PLAY_SOUND",
      		  fires: [
      		    {
      			fire: "USER_PRESENCE",
      			payload: function(payload) {
                        return false
                      }
      			}
      		  
      	   ]
      	 },
      	 {
      	    trigger: "OPEN_GATE",
      		fires: [
      		   {
      		   fire: "OPENING_THE_GATE",
      		   exec: "sudo python /home/pi/open_gate.py"
      		   }
      		]
      	 },
         ]
        }
      },
      
      posted in General Discussion
      M
      MilkShake
    • RE: [Guide] Control MM via Google Home

      @MilkShake
      Got it to work using:

      {
         module: "MMM-NotificationTrigger",
         config: {
           useWebhook:true,
      	 triggers:[
      	   {
      	      trigger: "PLAY_SOUND",
      		  fires: [
      		    {
      			fire: "USER_PRESENCE",
      			payload: function(payload) {
                        return false
                      }
      			}
      		  
      	   ]
      	 },
      	 {
      	    trigger: "OPEN_GATE",
      		fires: [
      		   {
      		   fire: "OPENING_THE_GATE",
      		   exec: "sudo python /home/pi/open_gate.py"
      		   }
      		]
      	 },
         ]
        }
      },
      
      posted in General Discussion
      M
      MilkShake
    • RE: [Guide] Control MM via Google Home

      Hi, Thanks for the guide. I got it working as IFTTT actually sends a webrequest to my mirror. I am having trouble with the syntax of NotificationTrigger. I already use that module to turn on my Mirror if my gate button is pushed and display an alert.

      I would like to execute a script when the trigger OPEN_GATE is received. Here is my current config:

      {
      module: "MMM-NotificationTrigger",
            config: {
                triggers:[
                {
                  trigger: "PLAY_SOUND",
                  fires: [
                    {
                      fire:"USER_PRESENCE",
                      payload: function(payload) {
                        return false
      
                      }
                    },
      
                    {
                      fire:"SHOW_ALERT",
                      payload: function(payload) {
                        return {
                          type: "notification",
                          title: "Porten",
                          message: "Der er nogen ved porten!"
                          }
                      },
                    }
                  ],
                },
      
              ]
            }
      },
      

      Can anyone help with the syntax to add a trigger for “OPEN_GATE” notification that fires a script?

      posted in General Discussion
      M
      MilkShake
    • RE: Syntax of MMM-NotificationTrigger

      @MilkShake So IFTTT makes a webrequest that looks like this:

      URL: https://MMPUBLICURL/webhook
      Method: POST
      Content type: application/json
      Body: { “sender”: { “name”:“IFTTT” }, “notification”: “OPEN_GATE”}

      I thought I could do something like:

      {
      module: "MMM-NotificationTrigger",
            config: {
              useWebhook: true,
              triggers:[
                {
                  trigger: "PLAY_SOUND",
                  fires: [
                    {
                      fire:"USER_PRESENCE",
                      payload: function(payload) {
                        return false
                      }
                    },
      
                    {
                      fire:"SHOW_ALERT",
                      payload: function(payload) {
                        return {
                          type: "notification",
                          title: "Porten",
                          message: "Der er nogen ved porten!"
                          }
                      },
                    }
                  ],
                },
      		  {
      			trigger: "OPEN_GATE",
      			fires: [
      				exec: "home/pi/open_gate.py"
      			],
      		  
      		  
      		  },
              ]
            }
      },
      

      What is the correct syntax to fire a script?

      posted in General Discussion
      M
      MilkShake
    • Syntax of MMM-NotificationTrigger

      Hi,
      I am having difficulties with the syntax of MMM-NotificationTrigger. I have this syntax working (semi):

      {
      module: "MMM-NotificationTrigger",
            config: {
              triggers:[
                {
                  trigger: "PLAY_SOUND",
                  fires: [
                    {
                      fire:"USER_PRESENCE",
                      payload: function(payload) {
                        return false
      
                      }
                    },
      
                    {
                      fire:"SHOW_ALERT",
                      payload: function(payload) {
                        return {
                          type: "notification",
                          title: "Porten",
                          message: "Der er nogen ved porten!"
                          }
                      },
                    }
                  ],
                },
      
              ]
            }
      },
      

      I need to add a trigger using webhook for the notification “Open_Gate” that fires a local script. Every time I change the syntax it seems to get broken. Can anyone help?

      posted in General Discussion
      M
      MilkShake
    • RE: Ideas Needed

      @Bugsounet Thanks Bugs! I will look into that when I have time for it.

      posted in General Discussion
      M
      MilkShake
    • RE: Ideas Needed

      I went the way of dataplicity.io/wormhole, NGINX, IFTTT and MMM-NotificationTrigger. That way I should be able to use a webhook to execute the python script.

      posted in General Discussion
      M
      MilkShake
    • RE: Ideas Needed

      @retroflex The mirror and the gate are on the same LAN. The assistant understands the “Open Gate” command and replies with “Ok, Opening the gate”, but if I were to use a Google Action to do the GET, it would come from the internet.

      I don’t know how to catch the event locally on the mirror. If I did, I would just call the python script and the gate would open.

      posted in General Discussion
      M
      MilkShake
    • RE: Ideas Needed

      @sdetweil my whole point is, since the action happens on the google assistant I would need to do port forwards in my firewall to be able to call a LAN URL with a GET method. I guess it would be possible to catch the event locally on the mirror and then call the python script or do the GET method in some other manner, but I don’t know how to do that.

      One option would be to just add a physical button to the raspberry pi and when pressed it runs the GET method. It just annoys me that you can make the assistant understand a command, but not utilize it locally on LAN.

      posted in General Discussion
      M
      MilkShake
    • RE: Ideas Needed

      @sdetweil I’m not following your point. I get it that I could do the GET from javascript instead of running a script, but the rest you might elaborate a bit more on 🙂

      posted in General Discussion
      M
      MilkShake