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

Execute shell commands when AssistantMk2 starts or stops

Scheduled Pinned Locked Moved Solved Troubleshooting
4 Posts 3 Posters 1.1k 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.
  • A Offline
    acimail01
    last edited by Jun 23, 2019, 8:59 PM

    Hello,

    I have the modules MMM-Hotword and MMM-AssistantMk2 installed. And it works that far.
    Now I want to execute a shell command when the wizard starts to speak and execute another shell command when the wizard is quit.
    How should I proceed?

    ? 1 Reply Last reply Jun 24, 2019, 6:25 AM Reply Quote 0
    • ? Offline
      A Former User @acimail01
      last edited by Jun 24, 2019, 6:25 AM

      @acimail01
      There is no usable point about “Response starting”, usually "ASSISTANT_UNDERSTOOD" notification or "ASSISTANT_ACTIVATED" notification could be used for that purpose, but not exactly same time with Starting audio response
      For ending, you can use "ASSISTANT_RESPONSE_END"
      With those notifications, you can make your own module to receive those notifications and to do your own job, Or,…
      You can use MMM-NotificationTrigger which be already built for translate and chain notifications among the modules. It can execute external shell script.

      S A 2 Replies Last reply Jun 24, 2019, 12:03 PM Reply Quote 0
      • S Away
        sdetweil @Guest
        last edited by Jun 24, 2019, 12:03 PM

        on linux you can replace the command being executed to play audio with a shell script of the same name (and rename the old file and call it from the script) and then add your own behavior.

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • A Offline
          acimail01 @Guest
          last edited by Jun 25, 2019, 11:00 AM

          @Sean said in Execute shell commands when AssistantMk2 starts or stops:

          TANT_RESPONSE_END

          thank you!
          MMM-NotificationTrigger did the trick.

          {
            module: "MMM-NotificationTrigger",
            config: {
              triggers:[
                {
                  trigger: "ASSISTANT_RESPONSE_END",
                  fires: [{ fire:"MY_COMMAND1", exec: "sleep 1; ls -al" },],
                },
                {
                  trigger: "ASSISTANT_UNDERSTOOD",
                  fires: [{ fire:"MY_COMMAND2", exec: "sleep 1; ls -h" },],
                },
              ]
            }
          },
          
          1 Reply Last reply Reply Quote 0
          • 1 / 1
          1 / 1
          • First post
            1/4
            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