Switch power outlets on and off with home automation tools
If This Then That
A serious disadvantage of the device is obviously that it defines its own proprietary communication protocol. Unfortunately, this is the norm among home automation products. As a result, they only work with the individual manufacturer's not particularly original apps, and the open source community has either reverse-engineered the protocols used, had to dive into the details of a another quirky API, or been left out in the cold entirely.
However, fortunately, the trendy Internet company IFTTT [5] has set out to provide a convenient abstraction layer around this protocol confusion. Using the "If This Then That" paradigm, it lets you create logical connections between events. Integrating these events using an API would require a lot of brainpower and developer hours in the real world. Instead, the service generates rules from conditions (This), which in turn trigger actions (That). With just a few mouse clicks, you can permanently establish these rules.
The This clause defines an input channel, such as "At this time" or "When it rains" or "When this YouTube video goes viral." That refers to initiated actions such as "Send me an email" or "Post this tweet" or "Turn on this device." The example in Figure 5 illustrates how IFTTT sends email if it's going to rain tomorrow.

IFTTT has all sorts of ready-made channels that trigger an event: Weather Channel events like sunrise, rain, or sunshine are triggered as those natural phenomena occur at the user's location; various security components also trigger an alarm if a sensor in the house reports a break-in. Falling or rising stock prices can also trigger events.
People wanting to use a channel on access-controlled servers like GitHub or Gmail don't need to store a password on IFTTT.com; instead, you are guided properly through the OAuth web flow of these applications. The applications then prompt you to confirm that IFTTT.com may now perform selected actions under your user ID on the specific service. As usual with OAuth, you can withdraw permission at any time. The password never leaves the original service, and IFTTT.com works with tokens of limited validity.
Because programmers are often recruited from the open source scene to code the nitty gritty of the interface between IFTTT and a service (which the end user subsequently just has to select), the channels are consistently very good and implemented with the latest security guidelines in mind.
The arsenal of output actions triggered by events includes email and text messages, push notifications, on/off switches like WeMo, and more. The possible combinations of inputs and outputs, called "recipes," therefore appear to be almost unlimited, and the contributing developers imagination assumes astounding levels.
Setting Rules with a Mouse Click
Communication between the smartphone app and the Belkin server can only be achieved by use of an SDK, but the WeMo app already has built-in integration with IFTTT.com. If you want to switch the WeMo on and off using IFTTT, simply subscribe to the WeMo Switch channel and provide a PIN to IFTTT.com, which the WeMo app generates on request in the Settings menu (Figures 6 and 7 ).


Now, IFTTT has the keys to the kingdom of remotely controlling the WeMo switch. In conjunction with a triggering input channel, it can now switch on local electrical devices when predefined events occur, as well as with uncommon events, such as rising share prices, or the arrival of tweets.
Alarm for GitHub Issue
If you have a project on GitHub, you can now simply create a new IFTTT recipe to switch on a light or siren each time a new GitHub issue is created in your project. To do so, you need to subscribe to the GitHub channel and the WeMo Switch channel and then link the New Issue section of the GitHub channel as an input to the WeMo Switch channel as an output action (Figure 8).

The IFTTT server needs to continuously check many such recipes, so once the input is initiated, it might take a while for the output to be activated. In my tests, the delay between creating a GitHub issue and the switching action was about two minutes. Nevertheless, it is fascinating to see how easy this kind of link can be made and how many possibilities for home automation are opened this way.
« Previous 1 2 3 Next »
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Direct Download
Read full article as PDF:
Price $2.95
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
News
-
KDE Plasma 6 Looks to Bring Basic HDR Support
The KWin piece of KDE Plasma now has HDR support and color management geared for the 6.0 release.
-
Bodhi Linux 7.0 Beta Ready for Testing
The latest iteration of the Bohdi Linux distribution is now available for those who want to experience what's in store and for testing purposes.
-
Changes Coming to Ubuntu PPA Usage
The way you manage Personal Package Archives will be changing with the release of Ubuntu 23.10.
-
AlmaLinux 9.2 Now Available for Download
AlmaLinux has been released and provides a free alternative to upstream Red Hat Enterprise Linux.
-
An Immutable Version of Fedora Is Under Consideration
For anyone who's a fan of using immutable versions of Linux, the Fedora team is currently considering adding a new spin called Fedora Onyx.
-
New Release of Br OS Includes ChatGPT Integration
Br OS 23.04 is now available and is geared specifically toward web content creation.
-
Command-Line Only Peropesis 2.1 Available Now
The latest iteration of Peropesis has been released with plenty of updates and introduces new software development tools.
-
TUXEDO Computers Announces InfinityBook Pro 14
With the new generation of their popular InfinityBook Pro 14, TUXEDO upgrades its ultra-mobile, powerful business laptop with some impressive specs.
-
Linux Kernel 6.3 Release Includes Interesting Features
Although it's not a Long Term Release candidate, Linux 6.3 includes features that will benefit end users.
-
Arch-Based blendOS Features Cool Trick
If you're looking for a Linux distribution that blends Linux, Android, and web apps together, blendOS might be what you're looking for.