从本地脚本获取答案

发布于 2025-01-14 09:32:23 字数 348 浏览 4 评论 0原文

我正在寻找一种与我的 Google Home 设备交互的方法,如下所示:

我:下一班车什么时候到达?

助理:5 分钟后。

我的第一个想法是从我所在城市的官方公共交通网站上获取此类数据。但当我研究这个问题时,可以跳过此步骤,因为时间表始终相同并且可以保存在本地。那么只需要知道当前时间,就能得到正确的答案。

这里更大的问题是,我怎样才能让谷歌助手回答结果。我查看了 IFTTT,但找不到任何运行某些本地函数的方法。 IFTTT 或其他一些服务将是最好的解决方案,因为它不需要任何额外的硬件来运行。

当然,如果可行的话,我会尝试其他一些解决方案,包括额外的硬件。

I am looking for a way to interact with my Google Home devices as follows:

Me: When does the next bus arrive?

Assistant: In 5 minutes.

My first thought was to scrape such data from the official public transport website from my city. But as I looked into the issue, this step can be skipped, as the time schedule is always the same and can be saved locally. Then it would only require to know the current time, to have the right answer.

The bigger problem here is, how can I let the google assistant answer the result. I looked into IFTTT, but I could not find any way to run some local function.
IFTTT or some other service would be the best solution, as it would not require any additional hardware to run.

Of course I would try some other solutions including additional hardware, if it will work.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吹泡泡o 2025-01-21 09:32:23

如果您只是在手机上进行交互,则可以使用此信息构建一个简单的手机应用,并使用应用将数据发送到助手的操作

对于 Google Homes,您无法直接在硬件上本地运行逻辑。您可以做的是构建一个会话操作,向您控制的网络钩子,可以轻松响应所请求的信息。

If you are just interacting on a phone, you can build a simple phone app with this information and use App Actions to send the data to the Assistant.

For Google Homes, you cannot directly run logic locally on the hardware. What you can do is build a conversational action that sends out a request to a webhook you control which can easily respond back with the requested information.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文