question

Rachel_Z_123 avatar image
Rachel_Z_123 asked ·

Invoke Skill every 30 seconds without voice activation?

My current skill:

1 - User invokes Alexa skill

2 - Alexa navigates to HTTP server and returns either "ON" or "OFF"

What I am trying to achieve:

1 - User invokes Alexa skill ONCE

2 - Alexa navigates to HTTP server every 30 seconds until "ON" is returned.

I would appreciate any suggestions! I am trying to invoke the skill every 30 seconds without the user having to ask every time.

alexa skills kitalexa voice serviceskillvoice-user interface
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

desk avatar image
desk answered ·

Cloudwatch might be a way to achieve it. Have a look at this article,

https://read.acloud.guru/how-to-keep-your-lambda-functions-warm-9d7e1aa6e2f0

Its to keep your service warm by pinging every few minutes, but might work for your purposes too. You would just need to make sure to give it the right input json

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

NickG@Amazon avatar image
NickG@Amazon answered ·

Desk has a pretty good solution, but there's a few other ways to do it. If you're running on a web server, you can just do it directly and fork off a thread for each request which goes and makes the HTTP server calls. For lambda you could either create a timed lambda function via the SDK or have it call another lambda function. I'm curious though, why would you need to ping the server every 30 seconds? Would it be possible to do a push model instead where the server pings you when the state changes? That would be a lot easier to code if you could do it.

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.