在IFTTT中的两个动作之间创建切换 [英] Create a toggle between two actions in IFTTT
问题描述
我有一个简单的设备(
我想出了一种方法,可以通过名为 bln_light_on 的变量.将其默认值设置为 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 ( The problem is that, since I can only pass the one event ( 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. 这篇关于在IFTTT中的两个动作之间创建切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! false
条件>布尔条件的新条件
.将其命名为 cnd_light_on
. True
的 bln_light_on
. name
下创建一个条件为 cnd_light_on
的 lgc_light_on
名称,并将条件链接设置为 Simple AND
操作链下>积极结果的操作
输入 button_on
执行模式
下,选择立即
.在高级选项>下自动评估
选择在任何已连接变量更改时评估此逻辑块
.现在,在IFTTT中,创建一个 New Applet>网页挂钩>如果是制造商事件"button_press"
,则> Web挂钩>发出网络请求
在URL字段中,您将输入在Apilio中设置的 bln_light_on
布尔变量中的切换URL.您可以通过单击 Boolean Variables>看到此内容.bln_light_on>从菜单中显示
.最后,在Nordic Thingy Web App中,发送事件 button_press
button_press
), which I am currently using to then trigger the Smart Life service's "Turn Off" or "Turn On" action. 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."
bln_light_on
. Set its default value to false
Conditons > New Condition for Boolean
. Call it cnd_light_on
. bln_light_on
with a required state of True
.name
create a name of lgc_light_on
with conditon cnd_light_on
, with Condition Linking set to Simple AND
Action Chains > Actions for Positive Result
enter button_on
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