• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
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.

Ideas Needed

Scheduled Pinned Locked Moved General Discussion
17 Posts 5 Posters 2.6k Views 5 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
    retroflex Project Sponsor Module Developer @MilkShake
    last edited by Jun 4, 2020, 3:56 PM

    @MilkShake Isn’t the mirror on the same LAN? In that case you don’t have to do any port forwards.

    M 1 Reply Last reply Jun 4, 2020, 7:42 PM Reply Quote 0
    • S Offline
      sdetweil @MilkShake
      last edited by Jun 4, 2020, 4:46 PM

      @MilkShake right, but now you gotta figure out how to execute it and u can’t do that from the browser, so now you need a node_helper and all that communication, and launching the ting in the background, etc,etc,etc)

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      M 1 Reply Last reply Jun 4, 2020, 7:09 PM Reply Quote 0
      • M Offline
        MilkShake @sdetweil
        last edited by Jun 4, 2020, 7:09 PM

        @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 :)

        S 1 Reply Last reply Jun 4, 2020, 7:12 PM Reply Quote 0
        • S Offline
          sdetweil @MilkShake
          last edited by Jun 4, 2020, 7:12 PM

          @MilkShake show me your script that is called when the action occurs

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          M 1 Reply Last reply Jun 4, 2020, 7:36 PM Reply Quote 0
          • M Offline
            MilkShake @sdetweil
            last edited by MilkShake Jun 4, 2020, 7:37 PM Jun 4, 2020, 7:36 PM

            @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.

            S 1 Reply Last reply Jun 4, 2020, 7:59 PM Reply Quote 0
            • M Offline
              MilkShake @retroflex
              last edited by Jun 4, 2020, 7:42 PM

              @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.

              1 Reply Last reply Reply Quote 0
              • S Offline
                sdetweil @MilkShake
                last edited by sdetweil Jun 4, 2020, 8:03 PM Jun 4, 2020, 7:59 PM

                @MilkShake the actions run locally on the mirror, they are TRIGGERED from the module… not as callbacks I don’t think
                (i haven’t done that myself, but it seemed logical before) the old recipe stuff

                you just create a little script in maybe the new A2D but old assistant had it to to trigger events…

                here is fiddling with the radio on the mirror

                https://github.com/bugsounet/MMM-Assistant2Display/wiki/Radio_help

                Sam

                How to add modules

                learning how to use browser developers window for css changes

                1 Reply Last reply Reply Quote 0
                • B Offline
                  BKeyport Module Developer
                  last edited by BKeyport Jun 4, 2020, 11:29 PM Jun 4, 2020, 11:28 PM

                  How I do URL calls in python is through urllib.request - import that library then:

                  urllib.request.urlopen("http://pi.hole:60001/remote?action=MONITORTOGGLE")
                  

                  Depends on how far outside you wanna go outside the MM ecosystem.

                  edit: reminds me, I gotta re-write that for the new config, pi-hole and the mirror being two different units now.

                  The "E" in "Javascript" stands for "Easy"

                  S 1 Reply Last reply Jun 4, 2020, 11:41 PM Reply Quote 1
                  • S Offline
                    sdetweil @BKeyport
                    last edited by Jun 4, 2020, 11:41 PM

                    @BKeyport but u have to use a helper to launch the python code…
                    way overhead for a fetch or post

                    Sam

                    How to add modules

                    learning how to use browser developers window for css changes

                    B 1 Reply Last reply Jun 4, 2020, 11:53 PM Reply Quote 0
                    • B Offline
                      BKeyport Module Developer @sdetweil
                      last edited by Jun 4, 2020, 11:53 PM

                      @sdetweil True, if you’re staying in the MM ecosystem - in my case, I couldn’t get the modules I wanted to work the way I wanted, so I wrote up a python script to cover it, and it runs independently of MM

                      He wanted a python method, so I gave him options.

                      The "E" in "Javascript" stands for "Easy"

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