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.

    Hi, there is a new Alexa Module

    Scheduled Pinned Locked Moved General Discussion
    98 Posts 13 Posters 32.1k Views
    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.
    • rubenixR
      rubenix
      last edited by

      Hey man!! many thanks will try it asap and tell you how it goes.
      I found another solution to show my google calendar using an iframe (had to make it public tho and do not want this)

      So pretty good news if I make it to work.

      Many thanks!!!

      1 Reply Last reply Reply Quote 0
      • rubenixR
        rubenix
        last edited by

        Yehaaaa. Got it working with no issues at all.
        I think I tried before as per your link instructions but I think I put it without the notifications of page increment and page decrement. I made a fatal mix indeed…and thats why mirror was doing weird things…

        Thanks so much, I’ve been in touch with MMM-Page developer but yours it has been the best indication indeed.
        I’ve been playing with MMM-Notification-Trigger as I needed for interact with a groove sensor to fire QUERY_PAGE_NUMBER and got it working too. Very productive weekened indeed :face_savouring_delicious_food:

        So now pages rotates by itself ; I can change them by AlexaControl and with a gesture too!!! Lovely
        Thats what I wanted; reverting back calendar as private!!!

        Thanks so much @JoChef2 I owe you a beer:clinking_beer_mugs:

        1 Reply Last reply Reply Quote 0
        • rubenixR
          rubenix
          last edited by

          Hello again! I’ve another question…
          I want to power off USB power at the same time I power off monitor from alexa module.

          I’ve seen on line 199 of node_helper.js the following:

           exec("vcgencmd display_power 0", opts, (error, stdout, stderr) =>
          

          Tried to add the command: echo ‘1-1’ |sudo tee /sys/bus/usb/drivers/usb/unbind (cut power from usb ports)
          like that:

           exec("vcgencmd display_power 0 && echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind", opts, (error, stdout, stderr) =>
          

          Command does not work (I think theres a syntax error) monitor powers off but usb power still on.
          Command works from commandline.
          Also tried to put it on a separate exec function without succeed.

          Can you give me a hand with this @JoChef2

          Thanks!

          1 Reply Last reply Reply Quote 0
          • rubenixR
            rubenix
            last edited by

            Also created a couple of scripts (monitor_on.sh & monitor_off.sh) --> with 2 commands I mentioned before on them.
            Both works from bash but cannot execute them from node_helper.js
            any thoughts? sorry about asking but am not a coder & cannot find an answer anywere…

            Thanks!

            S J 2 Replies Last reply Reply Quote 0
            • S
              sdetweil @rubenix
              last edited by

              @rubenix what do the scripts look like? if u replaced the vcgencmd strin with the scripts, they should work…

              where are the scripts? they MUST be on the path, or have the full path specified in the command too

              Sam

              How to add modules

              learning how to use css

              1 Reply Last reply Reply Quote 0
              • J
                JoChef2 Module Developer @rubenix
                last edited by

                @rubenix Hi, I don’t really know why it doesn’t work. The syntax seems to be right. That’s the hole edit part around line 199. Maybe it helps. I tested this and it works great.

                 device.handler = function(action) {     
                    if(action === 1){
                        exec("vcgencmd display_power 1 && echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/bind", opts, (error, stdout, stderr) => {
                            _this.checkForExecError(error, stdout, stderr); 
                        });
                    }if(action === 0){
                        exec("vcgencmd display_power 0 && echo '1-1' |sudo tee /sys/bus/usb/drivers/usb/unbind", opts, (error, stdout, stderr) => {
                            _this.checkForExecError(error, stdout, stderr); 
                        });
                    }
                }
                
                S 1 Reply Last reply Reply Quote 0
                • S
                  sdetweil @JoChef2
                  last edited by

                  @JoChef2 its because the exec() is launching A program… but the program is NOT a shell (sh., bash etc), and only THEY understand the | and && syntax… vcgencmd does not… it executes what it knows ‘display_power 1’ ,and ignores the rest

                  now, you CAN execute a script directly as long as it contains the processor name at the front
                  #!/bin/sh or #!/bin/bash

                  exec(“/home/pi/MagicMirror/modules/MMM-AlexaControl/scriptname”)

                  or the script has to be in the path environment varible.
                  (unlike windows, the ‘current directory’ is NOT included in the path (for security reasons))

                  if the script does NOT contain the processor path&name
                  then you have to launch the shell

                  exec(“/bin/bash -c “command string with pipe and logic chars””)

                  Sam

                  How to add modules

                  learning how to use css

                  1 Reply Last reply Reply Quote 0
                  • rubenixR
                    rubenix
                    last edited by

                    got it working thanks!

                    if(action === 1){
                                exec('/home/pi/monitor_on.sh');
                                }if(action === 0){
                                exec('/home/pi/monitor_off.sh');                         
                    

                    forgot to put the path :confounded_face:

                    Thanks buds!

                    1 Reply Last reply Reply Quote 0
                    • M
                      minomit
                      last edited by

                      Hi, mmm-alexacontrol is ok, i’m change pages,etc.
                      Can I ask alexa for something and alexa replies in the compliments module?
                      thanks

                      J 1 Reply Last reply Reply Quote 0
                      • J
                        JoChef2 Module Developer @minomit
                        last edited by

                        @minomit Hi, no that’s not directly possible with my module because it emulates only smart home devices and haven’t anything to do with the speech of Alexa. It’s possible that you add to the compliments module notification support and then you can create devices with my module that sends notifications to the compliments module. You can complete this with routines in the Alexa app. So then you have a few sentences. But I think that’s not the thing you asked for. If you want to see all the answers of Alexa you should use MMM-awesome-alexa. I’m not sure if my module works with it but that’s the only way I see to realize that. Maybe someone else have a better idea.

                        S 1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 6
                        • 7
                        • 8
                        • 9
                        • 10
                        • 9 / 10
                        • 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