1

I want to write a Google Home action that tells the latest value of a field in a DB table. (Another service will keep updating the DB.)

How do I make Google Home speak the update automatically every 10 seconds without further user utterance after the Action is launched?

Interaction would be like this:
User: "OK Google, start Progress Updater"
Google Home: (Every X seconds) "10 percent."
Google Home: "19 percent"
...
Google Home: "100 percent."
Google Home: *"Task is complete!"
End of interaction

I know how to do it if a user has to say every time "Google Home, get me update". Is there a way to do it in an automatic loop?

Tried following code based on response from @Prisoner

conv.ask(new MediaObject({
    name: 'Jazz in Paris',
    url: 'https://storage.googleapis.com/automotive-media/Jazz_In_Paris.mp3',
    description: 'A funky Jazz tune',
    icon: new Image({
      url: 'https://storage.googleapis.com/automotive-media/album_art.jpg',
      alt: 'Media icon',
    }),
  }));
});
Prisoner
  • 49,922
  • 7
  • 53
  • 105
  • You've shown the code that has the problem, but showing the surrounding code, or the entire handler function, can help. please also include the error message you're getting in the question. Since this is a slightly different problem than your original question (an error message, rather than a "how do I" question), you may also want to ask it as a new Question. – Prisoner Jul 27 '20 at 10:05
  • Found why was it not working. Thanks a lot for your help! – user3088190 Jul 27 '20 at 23:06
  • Sharing what didn't work and why may help another user who runs into the same problem. – Prisoner Jul 28 '20 at 10:50
  • @Prisoner The MEDIA_STATUS approach worked for a couple of days. Yesterday *same code* stopped working. Now media status is called only once, after that the conversation ends with "". Unlimited looping does not happen. As if Google mysteriously discovered the unintended use of their API and fixed the loophole. Would appreciate any ideas. – user3088190 Aug 02 '20 at 10:24

1 Answers1

0

The best tool that we have to do this is the Media prompt.

Under this scheme, when you return any progress except for "complete", you'll include a Media object with a 10 second audio. When the audio finishes playing, you'll get a MEDIA_STATUS result, indicating the audio has finished. You can then check the status and reply accordingly, possibly including another Media in your prompt.

Prisoner
  • 49,922
  • 7
  • 53
  • 105