MagicMirror² v2.8.0 is available! For more information about this release, check out this topic.

Total Beginner - MM2 with MacMini


  • Project Sponsor

    Must pm2 be installt in Magic Mirror directory?


  • Project Sponsor

    install pm2 on Mac is my biggest problem 😭



  • @sdetweil Thank you for your reply and sorry for my late reply. I’m not able to get it to work with my Mac mini ;o) I have a USB Camera and a mac mini 2012. Would it be possible for you to write a step by step instruction? Many thanks in advance!!



  • @Stoffbeuteluwe good point! But I will use a camera behind the mirror to have a clean build.



  • @trividar the motion project installs a new program that runs in the background, and uses the camera.

    it can record video, take pictures, and notify of those kinds of events. in general, it has nothing to do with MagicMirror.

    but I had used it for another mirror runtime, and wanted the same capability here…

    in the motion.conf, you set the notifier for motion start and stop to execute the script i provide in the MMM-SleepWake module.

    on my odroid system that looks like this
    (on pi it would be /home/pi/, on mac it would be /Users/??? where ??? is the user where MagicMirror is installed)

    # Command to be executed when an event starts. (default: none)
    # An event starts at first motion detected after a period of no motion defined by event_gap
    on_event_start /home/odroid/MagicMirror/modules/MMM-SleepWake/external_motion start
    
    # Command to be executed when an event ends after a period of no motion
    # (default: none). The period of no motion is defined by option event_gap.
    on_event_end /home/odroid/MagicMirror/modules/MMM-SleepWake/external_motion end
    

    i just tested the motion detection script on mac and it needed work, thanks!
    I have updated the repo on github…
    just do a

    git pull
    

    from the MMM-SleepWake folder, to get the update



  • @sdetweil thanks! I will try it later this week!



  • @sdetweil So I have tried to get your module to work, but unfortunately without success. Could you please help me?
    So what I have done:

    1. Cloned motion-project into my folder Mirror (there are now two folder, MagicMirror and motion)

    2. Created motion.conf and made those changes:

    # Command to be executed when an event starts. (default: none)
    # An event starts at first motion detected after a period of no motion defined by event_gap
    ; on_event_start ‎⁨/Users/..../Mirror/MagicMirror/modules/MMM-SleepWake/external_motion start
    
    # Command to be executed when an event ends after a period of no motion
    # (default: none). The period of no motion is defined by option event_gap.
    ; on_event_end /Users/..../Mirror/MagicMirror/modules/MMM-SleepWake/external_motion end
    
    1. Configured my ~/MagicMirror/config/config.js file:
    	{
        module: 'MMM-SleepWake',
        delay:  1,               // default (one minute just for testing)
        source: 'external'
        
    },
    
    1. Started my MM without error, but SleepWake don’t do anything my MM just shows everything without going to sleep!

    So did I miss something? (My hardware: Mac Mini (late 2012) Monitor over HDMI connected.
    Thank you!



  • @trividar I need to know how to turn off display,
    So we need mode:

    See the readme

    I have only three modes at the moment, hide ( hide all modules, don’t turn off display), dpms (use the dpms commands), and pi( which uses the pi only tvservice command)

    I would try mode: ‘hide’ first.

    I don’t know how to turn off/andon the Mac display.



  • researching, i found supposedly

    pmset displaysleepnow
    

    should work

    it does not on my mac virtual machine…

    does it work on real mac?

    man pmset 
    

    should show the help for this

    displaysleepnow - causes display to go to sleep immediately.
    


  • @sdetweil

    using MMM-SleepWake with mode: ‘Hide’ works (any case is allowed)

    executing the external script wakes up

    /Users/.../MagicMirror/modules/MMM-SleepWake/external_motion start
    

    that is like what u have configured.

    you should see the camera motion events in /var/log/motion/motion.log
    (motion has to be running of course)