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-Pir toggling

    Scheduled Pinned Locked Moved Solved Troubleshooting
    22 Posts 3 Posters 1.5k 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.
    • S Offline
      sdetweil @ttt126
      last edited by

      @ttt126 that means you started MM AGAIN…

      if you are using PM2, then you need to use the pm2 commands

      pm2 status
      pm2 stop x
      where x is the name or number of the row of the app you want control
      and then pm2 start x

      or you can do

      pm2 restart x

      I STRONGLY recommend using manual start while you are developing your mm solution
      changing config, adding modules

      pm2 stop all
      
      cd ~/MagicMirror
      npm start 
      

      to stop MM in this mode, hit ctrl-q on the MM screen

      if you do this over ssh cause you have no keyboard on the mm system (like me all the time) press ctrl-c in the ssh window where you did npm start

      (if you do this when PM2 is controlling, it will do its job, “keep the app running”,
      you stop it, and pm2 will restart it… )

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      1 Reply Last reply Reply Quote 0
      • T Offline
        ttt126
        last edited by sdetweil

        so this is the aktual config
        the command python3 /home/pi/neu1.py is acting the relay if executed in termnal
        I use fire and exec both with no action.
        maybe there is no trigger natification.

        module: "MMM-NotificationTrigger",
                               config: {
                                 triggers:[
                                   {
                                      trigger: "USER_PRESENCE",
                                      fires: [
                                        {
                                          fire:"python3 /home/pi/neu1.py",
                                          exec: (payload) => {
                                            return "python3 /homr/pi/neu1.py " + payload.option
                                          }
                                        },
                                       ],
                                     },
                                   ]
                                 }
        
        1 Reply Last reply Reply Quote 0
        • T Offline
          ttt126
          last edited by

          I got it working, many thanks for your Help :-)

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

            @ttt126 what was the issue? might help others in the same predicament

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • T Offline
              ttt126
              last edited by

              @ttt126 said in MMM-Pir toggling:

              config: {
              triggers:[
              {
              trigger: “USER_PRESENCE”,
              fires: [
              {
              exec: (payload) => {
              return "python3 /homr/pi/neu1.py " + payload.option
              }
              },
              ],
              },
              ]
              }

              The pathon3 comand was missing. I´m not quite firm with programming.
              But a serce for executing a py script brought the answere!

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

                @ttt126 ok… two things…

                1. when posting config or logs info in the forum, please use the code-block wrapper

                to use

                paste the text you want to post, blank line above and below
                select the text you just pasted
                hit the </> button above the editor to add the wrapper

                1. on linux, you can specify the program to launch to execute a ‘script/program’
                  you do this by adding a special first line
                #!/path_to_executable/programname
                

                so in your case
                from a terminal window do

                which python3
                

                the which pgm returns the full path to the 1st instance of the program specified as located along the path . on my desktop that is

                which python3
                /home/sam/anaconda3/bin/python3
                

                then in you editor of your script, make this the 1st line

                #!path_from_which
                

                so it looks like this

                #!/home/sam/anaconda3/bin/python3
                

                the linux execution code does all this stuff under the covers, reads the 1st line and invokes that pgm with the arguments passed to the script
                and of course, if no #! then the script USER has to specify it like you did

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • S sdetweil has marked this topic as solved on
                • 1
                • 2
                • 3
                • 3 / 3
                • 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