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.

    sleep and wake tv with motion

    Scheduled Pinned Locked Moved Troubleshooting
    3 Posts 2 Posters 1.9k Views 2 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.
    • C Offline
      costascontis
      last edited by costascontis

      Re: [Motion Detection with RaspiCam](Non-Module version)
      i have setup motion running and mm as well.My mirror is a LGtv .I edit motion.conf like:

      # 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 vcgencmd display_power 1
      
      # 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 vcgencmd display_power 0
      
      

      that works pretty well sleeping and waking my mirror.My problem is that “vcgencmd display_power 0” doesnt blank my screen and so my tv goes into that horrible screensaver mode with the cube…
      But then playing around i noticed that giving

      /opt/vc/bin/tvservice -p
      

      at the Lxterminal instead of waking up my hdmi screen goes to a blank state and its like turned off!!!I thought thats nice plus typing:

      /opt/vc/bin/tvservice -p && sudo chvt 6 && sudo chvt 7
      

      it wakes up allright.So my linux noob thinking said lets put those commands at motion.

      # 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 /opt/vc/bin/tvservice -p && sudo chvt 6 && sudo chvt 7
      
      # 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 /opt/vc/bin/tvservice -p
      

      It sleeps ok like i want to but it doesnt wake up.Seems like motion “on_event_start” is giving " /opt/vc/bin/tvservice -p" and not all the command like “/opt/vc/bin/tvservice -p && sudo chvt 6 && sudo chvt 7”.
      What can i do my linux experts?

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

        @costascontis u should ask the motion guys. My module does all that under the covers. I posted an update cause the command execution was throwing an error.

        Well, actually, I know how…

        The & is a shell operation, so u would have to invoke sh or bash, and pass it the tvservice string u listed

        My module has the same problem, now that you mention it… I can’t fix til late today

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • C Offline
          costascontis
          last edited by

          actually i got it to work,starting the motion with sudo motion -n it executes the comands just fine.My screen is turning on and off just fine.I just want to find out how to start motion with pm2 now .

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • 1 / 1
          • 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