ifttt
Have you ever wished your lights would turn off on their own when you went to sleep? Or that they’d change color when your favorite sporting team scored? With LIFX smart light bulbs and IFTTT, we’re pretty close to that ideal and magical connected light bulb reality.
您是否曾经想过睡觉时灯会自动熄灭? 还是当您最喜欢的运动队得分时它们会改变颜色? 借助LIFX智能灯泡和IFTTT,我们已经非常接近理想和神奇的互联灯泡现实。
LIFX smart light bulbs are energy efficient LED bulbs that can change color and be controlled via smartphones and smartwatches. They are quite entertaining and rather easy to set up on your home Wi-Fi network.
LIFX智能灯泡是节能LED灯泡,可以改变颜色并可以通过智能手机和智能手表进行控制。 它们非常有趣,并且很容易在您的家庭Wi-Fi网络上进行设置。
To give our lights some autonomy, we’ll be using a service called IFTTT (short for “If This Then That”) which allows you to set rules based upon different internet connected devices and/or services. These rules can then trigger responses like your smart light bulbs changing color.
为了使灯光具有一定的自治性,我们将使用一项称为IFTTT的服务(“ If This Then That”的缩写),该服务可让您根据不同的Internet连接的设备和/或服务来设置规则。 然后,这些规则可以触发响应,例如您的智能灯泡改变颜色。
In this article, we’ll explore how to set up a LIFX smart bulb and then we’ll explore connecting it to IFTTT. Within IFTTT, we will set our lights to turn off when our Jawbone UP24 is in sleep mode. Afterwards we will look at how to set the bulb to change color if our favourite sporting team is playing.
在本文中,我们将探讨如何设置LIFX智能灯泡,然后将其连接至IFTTT。 在IFTTT中,当Jawbone UP24处于睡眠模式时,我们将关闭灯光。 然后,如果我们最喜欢的运动队在比赛,我们将研究如何设置灯泡以改变颜色。
To get started, you’ll need to ensure your light bulbs are connected to your home network. You’ll need to run the iOS or Android LIFX app to set this up.
首先,您需要确保灯泡已连接到家庭网络。 您需要运行iOS或Android LIFX应用进行设置。
I’m on Android, so I’ve installed the LIFX Android app:
我使用的是Android,因此我已经安装了LIFX Android应用:
Open the app and click “Add Bulbs” to set up your LIFX light bulb. Make sure your LIFX light bulb is turned on otherwise it may not appear!
打开应用程序,然后单击“添加灯泡”以设置您的LIFX灯泡。 确保您的LIFX灯泡已打开,否则它可能不会出现!
Choose your bulb and your home Wi-Fi connection, then you’ll be greeted with this wonderful screen allowing you to name the location of your LIFX light bulb, assign it to a group and give it a name:
选择您的灯泡和家庭Wi-Fi连接,然后您会看到一个漂亮的屏幕,该屏幕允许您命名LIFX灯泡的位置,将其分配给一个组并为其命名:
Once it assigns all of those settings, you’ll see your new location and group in the LIFX menu with your bulb inside it. If you press the power button next to the location, group or individual LIFX light bulb, the light will turn off. If it turns off successfully, then you are ready to go!
分配了所有这些设置后,您将在LIFX菜单中看到新位置和组,并且灯泡就在其中。 如果按位置,组或单个LIFX灯泡旁边的电源按钮,则指示灯将熄灭。 如果成功关闭,则您准备好了!
You can click on the bulb name in the menu to open up the controls for your bulb. Here you can change the color of the light (either different shades of white or completely new colors like purple from the “Colors” button on the bottom left). You can also set up effects like a strobe light via the “Effects” button.
您可以单击菜单中的灯泡名称,以打开灯泡的控件。 在这里,您可以更改灯光的颜色(通过左下角的“颜色”按钮,可以选择不同的白色阴影或全新的颜色,例如紫色)。 您还可以通过“效果”按钮设置诸如频闪灯的效果。
Now you’ve had a bit of fun with those settings, let’s look into how to connect up the LIFX light bulb to other web triggers via IFTTT.
现在您对这些设置有了一些乐趣,让我们研究如何通过IFTTT将LIFX灯泡连接到其他Web触发器。
To create a new recipe, create an account on IFTTT and log in. Then, click your username in the top right and choose “Create”. This takes you to your New IFTTT Recipe Page.
要创建新食谱,请在IFTTT上创建一个帐户并登录。然后,单击右上角的用户名,然后选择“创建”。 这将带您进入新的IFTTT食谱页面 。
We are then taken to a screen saying “ifthisthenthat”, click the “this” link to begin our process:
然后,我们转到屏幕上说“ ifthisthenthat”,单击“ this”链接开始我们的过程:
In the “Choose Trigger Channel” section, type in “UP” and choose the UP icon that appears.
在“选择触发通道”部分中,键入“ UP”,然后选择出现的UP图标。
If you are new to IFTTT and haven’t previously connected your UP to the service (likely!), there’ll be a screen that shows a button saying “Connect”. Click that button and follow the prompts to give IFTTT permission to access your UP data.
如果您是IFTTT的新手,并且以前没有将UP连接到该服务(可能!),将出现一个屏幕,显示一个显示“连接”按钮。 单击该按钮,然后按照提示授予IFTTT权限以访问您的UP数据。
Once you are set up, choose “Sleep mode enabled” in the trigger options that appear.
设置完成后,在出现的触发选项中选择“启用睡眠模式”。
Finish it by clicking “Create Trigger”.
单击“创建触发器”完成它。
Now we’ll have “if UP Sleep mode enabled then that” awaiting us. Click “that” to set up our LIFX smart bulb.
现在,我们将等待“如果启用了UP睡眠模式”。 单击“ that”以设置我们的LIFX智能灯泡。
Type in “lifx” into the “Choose Action Channel” filter and click the LIFX icon. You are likely to need to connect up LIFX too, click the “Connect” button and go through the prompts to give IFTTT access to your LIFX account.
在“选择操作通道”过滤器中输入“ lifx”,然后单击LIFX图标。 您可能还需要连接LIFX,请单击“连接”按钮并按照提示进行操作,以使IFTTT可以访问您的LIFX帐户。
We’ll arrive at the “Choose an Action” section, here we select “Turn lights off”. This will set our light to be off when sleep mode is enabled.
我们将到达“选择操作”部分,在这里我们选择“关闭灯”。 启用睡眠模式后,这会将我们的灯关闭。
Before IFTTT can turn off our light, it needs to know which lights we’d like to turn off. You can choose individual light bulbs, or whole locations or groups. I chose the individual bulb.
在IFTTT关闭灯之前,它需要知道我们想关闭哪些灯。 您可以选择单个灯泡,也可以选择整个位置或组。 我选择了单个灯泡。
Next, we can set how long we’d like our lights to gently fade to the off state. I’d personally like to get straight to sleep in the wonderous glow of darkness, so I’ve selected “Instant”.
接下来,我们可以设置希望灯光逐渐淡入关闭状态的时间。 我个人想直接进入奇妙的黑暗中入睡,所以我选择了“即时”。
Then click “Create Action” to finish setting up this action.
然后单击“创建动作”以完成此动作的设置。
Now you can give your IFTTT recipe a name and set whether you want your phone to notify you each time it runs. I’d recommend not setting your phone to notify you here as this is something we’d like to happen silently so we can rest! Once you are happy with the name and notification settings, click “Create Recipe”.
现在,您可以为IFTTT配方命名,并设置是否希望手机在每次运行时都通知您。 我建议您不要将手机设置为在此处通知您,因为这是我们希望悄悄发生的事情,以便我们休息! 对名称和通知设置满意后,单击“创建配方”。
Once it has created your recipe, it will direct you back to your My Recipes page where you’ll see your new recipe ready and waiting to be tried out!
创建食谱后,它将引导您返回“ 我的食谱”页面,在该页面中,您会看到新食谱已准备就绪,正等待尝试!
Now for the fun part. Get our your Jawbone UP24 and set it to Sleep Mode. Your smart light bulb should automatically switch off!
现在是有趣的部分。 获取我们的Jawbone UP24并将其设置为“睡眠模式”。 您的智能灯泡应自动关闭!
If you wanted to set the light to turn on again when you wake up, you could set another recipe to do the opposite. For me though, it’s usually daylight outside when I wake up so I’d rather not turn my light on each morning unnecessarily.
如果您想将光设置为在唤醒时再次打开,则可以设置另一种方法进行相反的操作。 不过对我来说,起床通常是外面的日光,所以我不想每天早上都不必要地打开灯。
We can also use IFTTT to change the color of our light bulb depending on different triggers. Let’s explore triggering our light bulb color to change whenever our favourite sporting team is playing!
我们还可以根据不同的触发条件,使用IFTTT更改灯泡的颜色。 让我们探索一下每当我们最喜欢的运动队在比赛时触发我们的灯泡颜色发生变化!
Go through and create a new recipe as we did before, however this time for the “Choose Trigger Channel” section, find and select ESPN:
像以前一样完成并创建一个新配方,但是这次在“选择触发通道”部分中,找到并选择ESPN:
On the next screen, choose “New Game Start”:
在下一个屏幕上,选择“新游戏开始”:
Then choose the sport and team you’d like to trigger the action. I chose my favourite NBA team – the Phoenix Suns.
然后选择您要触发动作的运动和团队。 我选择了我最喜欢的NBA球队-凤凰城太阳队。
After that, choose LIFX again as the Action Channel, however rather than turning off our lights, choose “Change color of lights”.
之后,再次选择LIFX作为“动作通道”,但是不要关闭灯光,而是选择“更改灯光的颜色”。
Our options for this one are a lot more plentiful than the turning off light option! Here you can choose what color you’d like the light to change to, choose how bright you’d like it to be (or leave it at the brightness it already is), say whether you’d like this action to turn on the light if it isn’t already switched on (I chose “No” as Phoenix might be playing whilst I’m not home and I’d rather not cause a huge energy bill from an eager Phoenix Suns smart light bulb!) and then finally how long the transition should be (I chose “Instant” once again because I want it to happen straight away). Once you are happy with all those settings, click “Create Action”.
我们提供的这一选项比关闭灯光选项要丰富得多! 在这里,您可以选择要将灯光更改为哪种颜色,选择想要的亮度(或保持其已经存在的亮度),并说出是否要打开此功能。如果尚未打开,请点亮(我选择“否”,因为凤凰城可能在我不在家时正在播放,我宁愿不要从急切的凤凰城智能灯泡中产生巨额的电费!),然后最后过渡应该持续多长时间(我再次选择“即时”是因为我希望它立即发生)。 对所有这些设置满意后,请单击“创建操作”。
Finish it by clicking “Create Recipe” and surprise your friends when they come over to watch the next sporting match with you!
通过单击“创建食谱”来完成它,并让您的朋友来与您一起观看下一场体育比赛时为您带来惊喜!
Not every bit of IoT enabled functionality necessarily needs a truck load of coding! Thanks to services like IFTTT and devices like the LIFX smart light bulb, setting up delightful interactions with internet enabled devices can be simple and easy for even non-coders to complete! Have you got a favourite IoT based IFTTT recipe? Did you come up with a good alternative trigger for your own LIFX smart light bulbs? Leave a note in the comments or get in touch with me on Twitter (@thatpatrickguy), I’d love to hear about it.
并非所有支持IoT的功能都需要大量的编码! 借助IFTTT之类的服务以及LIFX智能灯泡之类的设备,即使是非编码人员,也可以轻松轻松地与支持Internet的设备建立令人愉快的交互! 您有最喜欢的基于IoT的IFTTT食谱吗? 您是否为自己的LIFX智能灯泡提出了一个很好的替代触发器? 在评论中留下笔记或在Twitter( @thatpatrickguy )上与我联系,我很乐意听到有关它的信息。
翻译自: https://www.sitepoint.com/connecting-lifx-light-bulbs-iot-using-ifttt/
ifttt