在IFTTT中的两个动作之间创建切换 [英] Create a toggle between two actions in IFTTT

查看:68
本文介绍了在IFTTT中的两个动作之间创建切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的设备(

解决方案

我想出了一种方法,可以通过名为 bln_light_on 的变量.将其默认值设置为 false

  • 转到条件>布尔条件的新条件.将其命名为 cnd_light_on .
  • 在变量下,选择状态为 True bln_light_on .
  • name 下创建一个条件为 cnd_light_on lgc_light_on 名称,并将条件链接设置为 Simple AND
  • 操作链下>积极结果的操作输入 button_on
  • 在操作链下>负结果操作输入button_off
  • 执行模式下,选择立即.在高级选项>下自动评估选择在任何已连接变量更改时评估此逻辑块.现在,在IFTTT中,创建一个 New Applet>网页挂钩>如果是制造商事件"button_press" ,则> Web挂钩>发出网络请求在URL字段中,您将输入在Apilio中设置的 bln_light_on 布尔变量中的切换URL.您可以通过单击 Boolean Variables>看到此内容.bln_light_on>从菜单中显示.最后,在Nordic Thingy Web App中,发送事件 button_press
  • I have a simple device (Nordic Thingy 52) with a push button which can trigger the Maker Webhooks service in order to pass an event (button_press), which I am currently using to then trigger the Smart Life service's "Turn Off" or "Turn On" action.

    The problem is that, since I can only pass the one event (button_press), I have to choose whether that event triggers either "Turn Off" or "Turn On". But what I want is to add some logic to say, "If the previous request was to turn off the Smart Life device, make the next one turn on the smart life device."

    Wasn't sure how to do this. An AWS Lambda function? Chaining some other preexisting service? A filter that utilizes local storage or somehow handles state logic?

    Any pointers for where to start searching would be appreciated.

    解决方案

    I figured out a way to do this with a service called apilio.

    Process:

    Head to apilio.io and register for an account.

    • Enter your IFTTT token in your user profile page.
    • Go to Boolean Variables and enter a variable called bln_light_on. Set its default value to false
    • Go to Conditons > New Condition for Boolean. Call it cnd_light_on.
    • Under variable select bln_light_on with a required state of True.
    • Under name create a name of lgc_light_on with conditon cnd_light_on, with Condition Linking set to Simple AND
    • Under Action Chains > Actions for Positive Result enter button_on
    • Under Action Chains > Actions for Negative Result enter button_off
    • Under Execution Mode select Immediate. Under Advanced Options > Automatic Evaluation select Evaluate this logicblock when any connected variable changes. Now, in IFTTT, create a New Applet > Web Hooks > If maker Event "button_press", then > Web Hooks > make a web request In the URL field you’ll enter the Toggle URL from the bln_light_on Boolean Variable you set up in Apilio. You can see this by clicking Boolean Variables > bln_light_on > show from the menu. Lastly, in the Nordic Thingy Web App, send the event button_press

    这篇关于在IFTTT中的两个动作之间创建切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆