Filter results by

SAMI Rules: Your Devices Can Speak Up

Note: We have updated this post for ARTIK Cloud. Read it here!

In this post we discuss a SAMI Rules feature that is one of the least visible, yet most powerful. With this feature, device fields can be more than Rule triggers; you can also use them as parameter values in the commands sent to devices.

SAMI Rules

In the previous post I built a simple Rule from a SmartThings motion sensor (motion field) and button (on Action).

You may have discovered another feature while writing THEN conditions for your own Rules. Any device Action that has a parameter can use the values from device fields as parameter values. Here are two examples of using device fields in a parameter.

Motion sensor sends an email notification

Create a new Rule with the same IF condition we used the first time: SmartThings motion sensor motion is equal to “moving”.

SAMI Rules

Select “Send Email” for the THEN condition (it’s under Other Actions). In the dialog that expands below, notice the buttons next to “subject” and “body”. This button calls up a list of your devices, with recent devices (like the motion sensor we have just placed in the IF pane) sorted to the top.

SAMI Rules

Here we can select the same motion field used in the IF statement. The motion state will be the subject of the email. You can also mix the field with regular text, as shown here in the email body:

SAMI Rules

You can remove any device field in a parameter dialog by clicking the “X” control or simply pressing backspace.

In this way you can observe directly what values are changing on the device, rather than having to infer this from the Actions that result in other devices.

Below is how the Rule incorporates the motion sensor field:

IF SmartThings Fibaro Motion Sensor motion is moving THEN send email with to="","subject"="[SmartThings Fibaro Motion Sensor]motion","body"="Hello. You might want to know that [SmartThings Fibaro Motion Sensor]motion has been detected.

And here is how the Rule comes together:

SAMI Rules

Tizen TV displays a phone caller

In this Rule, a Tizen TV is instructed to display the incoming phone number when you receive calls.

The Rule is triggered whenever the callingNumber field of the MyCallerID device is not blank. This sends a setText Action to the Tizen TV. The “text” dialog can be populated with any text, but here we simply display the value of callingNumber itself.

SAMI Rules

Let us know what Rules you have created, and stay tuned for more about SAMI Rules!

Get the ARTIK Newsletter

You like your news fresh! Sign up now and you will be the first to know about our latest software releases, coding tips, upcoming events, blog posts, datasheet updates, and more.

By providing your contact information, you agree to our Privacy Policy and Terms of Use, confirm you are an adult 18 years or older, and authorize Samsung™ ARTIK to contact you by email with information about Samsung™ ARTIK products, events, and updates for Samsung IoT Solutions. You may unsubscribe at any time by clicking the link provided in our communications.