Passing numbers as parameters from alexa
-
{ 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
-
@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
-
Thats delightfuly simple Ill just toss that in my xboxvol script Thanks