TRIGGERcmd
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Passing numbers as parameters from alexa

    General Discussion
    2
    3
    172
    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.
    • F
      fennectech
      last edited by

      { trigger: 'volume', id: '5fb025388293770019882f6f', params: 'five' }
      Running trigger: volume  Command: xboxvol five
      Reported: Command Ran
      { trigger: 'volume', id: '5fb025388293770019882f6f', params: 'twelve' }
      Running trigger: volume  Command: xboxvol twelve
      Reported: Command Ran
      { trigger: 'volume', id: '5fb025388293770019882f6f', params: 'twelve' }
      Running trigger: volume  Command: xboxvol twelve
      Reported: Command Ran
      { trigger: 'volume', id: '5fb025388293770019882f6f', params: 'eight' }
      Running trigger: volume  Command: xboxvol eight
      

      Ive figured out how to get triggercmd working but the parameters are being sent as words which is not usable for what I'm trying to do

      RussR 1 Reply Last reply Reply Quote 0
      • RussR
        Russ @fennectech
        last edited by

        @fennectech, we're at the mercy of what Alexa hears and sends to the TRIGGERcmd servers. You could use a script that does word-to-number conversion for you, something this:

        #!/bin/bash
        
        case $1 in
            "one" )
                NUMBER=1 ;;
            "two" )
                NUMBER=2 ;;
            "three" )
                NUMBER=3 ;;
            "four" 
                NUMBER=4 ;;
            "five" )
                NUMBER=5 ;;
            "six" )
                NUMBER=6 ;;
            "seven" )
                NUMBER=7 ;;
            "eight" )
                NUMBER=8 ;;
            "nine" )
                NUMBER=9 ;;
            "ten" )
                NUMBER=10 ;;
        esac
        
        xboxvol $NUMBER
        

        Russell VanderMey

        1 Reply Last reply Reply Quote 0
        • F
          fennectech
          last edited by

          Thats delightfuly simple Ill just toss that in my xboxvol script Thanks

          1 Reply Last reply Reply Quote 1
          • First post
            Last post