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

Hear stock quotes from Google Assistant or Alexa

Windows
windows
3
4
876
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.
  • R
    Russ
    last edited by Russ Nov 21, 2019, 12:47 AM Nov 21, 2019, 12:39 AM

    This Powershell script calls the API and sends the result back to TRIGGERcmd so Alexa or Google Assistant can speak the price.

    The "demo" API key can only lookup Microsoft, so you'll want to get a free API key from https://www.alphavantage.co to lookup your own stocks.

    I added this as an example in Browse Examples in the GUI editor.
    This only works on Windows, but let me know if you want me to do a Mac or Linux version of this script.

    $symbol="MSFT"
    $apikey="demo"
    $resource="https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=$symbol&apikey=$apikey"
    $response=Invoke-RestMethod -Method Get -Uri $resource
    $price=$response.'Global Quote'.'05. price'
    $cmd="$env:USERPROFILE\.TRIGGERcmdData\sendresult.bat"
    cmd /c $cmd $price
    

    Configure the Voice Reply field like this:

    241c0cb1-bdda-4832-9ddc-a48f4f466af2-image.png

    There are a few other data points besides just price at this endpoint:
    https://www.alphavantage.co/query?function=GLOBAL_QUOTE&symbol=MSFT&apikey=demo

    Russell VanderMey

    1 Reply Last reply Reply Quote 0
    • C
      Colin M
      last edited by Nov 22, 2024, 11:41 AM

      I'm trying to use TC to run a Python script that generates and returns a text phrase that I then want Google Home to speak. I was hoping this could be done using "Voice Reply" section in GUI editor - I have it set to (without quotes) "The script response is {{result}}" but this is not working - no response at all from GH. Thought I could test the voice reply using this Stock quotes example but doesn't appear to be in "Browse Examples". Is this functionality still available for GH or has the removal of "Conversational skills" by google removed it?

      R 1 Reply Last reply Nov 22, 2024, 1:09 PM Reply Quote 0
      • R
        Russ @Colin M
        last edited by Nov 22, 2024, 1:09 PM

        @Colin-M Google's removal of the conversational Google action removed the voice reply capability for Google Home, but you could still do it with the Alexa Triggercmd skill.

        Russell VanderMey

        C 1 Reply Last reply Nov 22, 2024, 2:04 PM Reply Quote 1
        • C
          Colin M @Russ
          last edited by Nov 22, 2024, 2:04 PM

          @Russ Many thanks. Unfortunately I don't own an Alexa so I'm going to need to find an alternative. I can get GH to speak custom phrases on command using "assistant.command.Broadcast" with Google's Web based Automations script editor but that is just a fixed phrase. Guess I'm going back to Gemini for more ideas! Good to see TC still going strong - I first used it 5 years ago!

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