Functionalities of Hello Thing-IF

This topic explains what you can do with Thing Interaction Framework and what is implemented in Hello Thing-IF.

Basic Functionalities of Thing Interaction Framework

Thing Interaction Framework is a framework for implementing IoT solutions. It models best practice functionalities in the IoT field and you can use these functionalities through the Thing-IF SDK.

The most basic functionality in Thing Interaction Framework is to transfer commands and state information.

The mobile app user remotely controls the managed thing via the Internet by sending commands to the thing. In the opposite direction, the mobile app user can browse the internal status of the thing such as sensor values and settings as state information.

Relation between the Kii Cloud SDK and the Thing-IF SDK

The Thing-IF SDK is positioned above the Kii Cloud SDK. It is a combination of selected functionalities of the Kii Cloud SDK to accelerate IoT solutions.

The Kii Cloud SDK allows you to combine various functional elements in the mobile app to deliver necessary functionalities. In contrast, Thing Interaction Framework has predefined usage models as mentioned above and provides necessary functionalities based on the models. Therefore, you can deliver desired functionalities quicker with Thing Interaction Framework than the Kii Cloud SDK, with which you need to develop processes, for example, for transferring commands and state information.

The predefined models support various situations to be addressed by IoT solutions. However, the models might not address all of your challenges. In that case, you can develop the desired solution by combining functionalities of the Kii Cloud SDK.

As you will see in the topic of mobile app implementation, you need to use the Kii Cloud SDK for some tasks such as user registration in order to use the functionalities of the Thing-IF SDK.

Structure of Hello Thing-IF

Hello Thing-IF transfers commands and state information as one of its basic functionalities.

Hello Thing-IF consists of a mobile app and a thing program. These components work together with the same application on Kii Cloud. The thing program simulates a smart LED light with a motion sensor and runs on Linux. The mobile app operates the power unit and brightness level of the smart LED light.

Mobile App

The mobile app consists of the login screen and the command screen.

  • Login screen

    In the login screen, the user associates themselves with the thing on Kii Cloud by onboarding. For safe control, the user needs to specify a thing that they have the permission to operate because the application on Kii Cloud could have numerous users and things.

    In the login screen, the user specifies themselves with the username and password and the target thing with its ID and password. Clicking the ONBOARD button triggers the onboarding process which associates the user and the thing and creates an ownership relation between these two.

    The owner can operate the smart LED light via the mobile app.

  • Command screen

    In the command screen, the owner remotely controls and gets state information of the smart LED light with the permission of the owner specified in the onboarding process.

    This screen has a checkbox to turn on and off the power and a slider to adjust the brightness level. Clicking the SEND COMMAND button after setting these controls sends a command to the thing. The mobile app can get the result of the command sent to the thing after the mobile app receives a push notification.

    Clicking the REFRESH STATE button gets and displays the latest state information on the mobile app.

Thing Program

The thing program receives commands and sends state information.

Thing Interaction Framework transfers commands from the mobile app to the target thing. When the thing receives a command, the Thing-IF SDK calls a function registered as an action handler, which gets necessary parameters from the command and controls the LED bulb, though the sample program only simulates such behaviors for display on the mobile app.

The thing program also sends state information to Thing Interaction Framework. Hello Thing-IF handles the following state data:

  • The content of the command that the thing received most recently

    The power on/off status and the brightness level are registered as state information.

  • The motion sensor value

    The value of the motion sensor is registered as state information. The sample program uses a pseudo sensor value which repeatedly increments from 0 to 10 every time the state information is registered, for example, 0 → 1 → 2 … → 9 → 10 → 0 → ….

The thing program of Hello Thing-IF sends state information to Thing Interaction Framework at one-minute intervals. It also sends state information when it receives a command.


What's Next?

You will learn the details of commands and state information of Hello Thing-IF and how to design them.

Go to Designing Commands and State Information.

If you want to learn more...

  • See the Hello Kii tutorial to know more about the Kii Cloud SDK, which is positioned below the Thing-IF SDK.
  • Thing Interaction Framework has more functionalities including automatic command execution according to conditions. See Functional Model for the complete set of available functionalities.