Google home to return the outcome of a command

  • Hello...

    I'm still testing the application with my raspberry pi and so far everything looks amazing and working really well.
    But I have a funny question: Has anyone tried, somehow to run a command and return the outcome of it to google? I know trigger cmd will not do it, but I could for example put the result in a dropbox file? I know it will require some ifttt work as well..
    What I'm trying to do at the moment is to run a script that reads the temperature and humidity from the raspi thermometer and somehow get those results with voice or a dropbullet, worst case scenario.


  • @gutopa, here's one suggestion for you. It's not as ideal as having Google or Alexa reply with the results of the command, but it might be adequate.

    Also, can you send a link to that "dropbullet" you referred to? I googled it and none of the results seem to fit.

    The idea is to have your Raspberry Pi run a curl command that would have your Windows computer say the temperature and humidity out loud using nircmd.

    curl -X POST -H "authorization: Bearer `cat ~/.TRIGGERcmdData/token.tkn`" -d "trigger=speak&computer=ds&params=\"Temp 32\""

    Or you could use the tcmd go client, but then you need to use %20's instead of spaces. So you could write out your sentence in a text file, then read it into an environment variable with %20's instead of spaces, then use that variable in your tcmd command like this:

    echo "Temperature is 32 degrees and Humidity is 70" > /tmp/saythis.txt
    export SAY_THIS=$(cat /tmp/saythis.txt | sed -e 's/ /%20/g')
    ./tcmd -computer ds -trigger speak -params "\"${SAY_THIS}\""


  • Thank you Russ.
    I'll give a go another day. My idea is still use everything from one raspberry pi and avoid having to create different clients.
    Do you have any example of passing parameters?
    Like. If I want to read the temperature in different RPI but with the same command?
    IE, Temperature + PiKitchen or PiBedroom

    I meant push bullet, sorry. :)


  • @gutopa, if all of your Pi's are on your network, you could use authorized_keys to allow one Pi to run remote commands on the other Pi's using ssh. The original Pi could capture the output of those commands. Then you could compile all of the output and send it to yourself via pushbullet or email. Just brainstorming here..

  • @gutopa, I've been thinking about your question and how I'd implement a solution. Please look here for what I'm thinking.

Log in to reply