Note: We have updated this post for ARTIK Cloud. Read it here!
As you know, SAMI rules. SAMI can start talking to your devices in seconds, generate insights from all these devices, and send them commands. You can design SAMI to do things like detect fire and read the weather. This week, SAMI became even more capable. You can now quickly and intuitively define rules for triggering device Actions based on SAMI messages. We call this feature: SAMI Rules.
With Rules, the SmartSense Motion sensor can turn on the Hue lights. The lights can send you an email when they’re left on overnight. And the Withings scale can set your lights to gray when your weight goes up (and hopefully discourage you from overeating!). True interoperability is a handful of clicks away:
In our recent IoT demo you watched Luc connect our DIY flame detector to SAMI and view its data in the User Portal. You will have also spotted Luc using Rules to very quickly create a fire alarm and an email notification from the sensor data. Let’s learn how he did it.
Below is your official Rules tour, so go ahead and click on “Rules” in the nav bar of the User Portal.
What’s in a Rule
If you haven’t yet defined any Rules, you will see this:
Let’s change that. Click through to create a new Rule. Everything that goes into your Rule is contained on this page. In the IF pane, you can bring up a list of all your devices connected to SAMI.
Select one of these devices to begin your Rule—I’ll use the SmartThings motion sensor—and you will see a list of all the fields defined in its Manifest.
Let’s append the device name with the “motion” field. The next dialog will have the choices “is equal to” and “is not equal to”, which indicates that the value should be a string such as “moving”.
(Other data fields might bring up other options, like so:)
For the THEN pane I’ll use a SmartThings On/Off Button Tile. The motion sensor can then send an “on” state when its motion field equals “moving”.
Note that the Rule description is automatically written as you build the Rule. Once you are finished defining it, all that’s left is to name your Rule.
Why stop there?
Clicking “Save Rule” brings you to your newly populated Rules page, which lists your Rules and when they were created and last run. Above each Rule are buttons that allow you to do things like edit, test and deactivate your Rule. The Clone option is useful for assembling a set of complementary Rules:
This opens a duplicate of the Rule that you may then modify into a new Rule. Here I’ve quickly written a Rule that sends an “off” state when the motion sensor is not “moving”.
This is all it takes to turn your various devices into a responsive network of sensors. With Rules, a lot is already possible using the standard fields and Actions available in SAMI. Open the windows if a smoke detector is triggered, or play music that complements the hues of your smart lights. If you already own a number of smart devices, Rules can give your home an instant IQ boost.
What Rules do you want to write? Send us a tweet, and check back soon as we update the feature!