Build an App for iOS to Manage Fingerbot

Last Updated onInvalid date

Overview

Recently, there has been a buzz all over the world about Fingerbots from Adaprox. Fingerbots can be used to switch on or off lights with a few taps on your app, and remotely power on your office PC with a voice assistant. Fingerbots support remote control of various switches and buttons.

Fingerbots are the ideal, cost-effective choice for you to retrofit your non-smart appliances into IoT devices with a few simple steps.

Materials

Hardware (2)Software (1) Others (1)
  • Smart gateway

    Count:1

    The basic function of a gateway is to convert the communication protocols to achieve communication between devices with different protocols. Cloud connection capability and protocol type are two basic attributes of the gateway.more

  • Fingerbot

    Count:1

    Fingerbot is the tool which can make the original non-smart devices Smart with Remote control, Voice control, Timing features at a Low Cost.more

Steps

Preparation

  • A smart gateway
  • A Fingerbot

Step 1: Get the key information of the App SDK

Build an app on the Tuya IoT Platform, get the values of AppKey and AppSecret, and then download the security image of the App SDK.

  1. Log in to the Tuya IoT Platform.

  2. Click App in the left-side navigation bar.

  3. Choose App > App SDK > SDK Development and click Create App.

    1. Enter information about the app.
      • App Name: Enter a name for the app.
      • App Package for iOS: Enter a name for the app package for iOS, such as com.testapp.smartiot.
      • App Package for Android: Enter a name for the app package for Android, such as com.testapp.smartiot.
      • Channel ID: Optional. If you do not set the value, the system automatically generates a channel ID according to the package name.
    1. Click OK.

    2. Click the created app to enter the detail page. Click Get Key to check the values of AppKey AppSecret, and App Security Image for Android.

Step 2: Configure and run the sample file

Configure the sample file with the key information, and install a third-party library.

  1. Open Terminal and run sudo gem install cocoapods && pod setup to instal CocoaPods。

  2. Download the Github sample project tuya-ios-fingerbot-demo for iOS.

  3. Open Terminal and run Pod install in a local directory to install the third-party library.
    image.png

  4. Open tuya-fingerbot-ios-objc.xcworkspace via Xcode.

  5. Enter the name of the app package for iOS in Signing & Capabilities > Bundle Identifier. image.png

  6. Name the iOS security image in the App SDK key information as t_s.bmp and save it in the tuya-ios-fingerbot-objc directory.

  7. Choose tuya-ios-fingerbot-objc > Example for tuya-ios-fingerbot-objc > AppKey.h, configure the APP_SECRET_KEY and APP_KEY fields of the App SDK with the values of AppKey and AppSecret.

    image.png

Step 3: Remotely control the Fingerbot that is connected through a gateway

After you add the Fingerbot to your app by using a gateway, you can remotely control the Fingerbot on the app.

  1. Run the sample in Xcode.
    Image

  2. Register and log in to Fingerbot Sample app.

  3. Select your home.

    1. Tap New Home to create a home.
    2. Tap Current Home to select the newly created home.
  4. Select the Bluetooth Low Energy mode to connect the Fingerbot and the gateway to the Fingerbot Sample app.

  5. The following video tutorial shows how to add the Fingerbot to your app.

Operation result

Now, you can remotely control the Fingerbot on the app.

  • When the switch mode is disabled, you can tap the switch. Then, the Fingerbot runs in clicking mode and performs a clicking task.

  • When the switch mode is enabled, you can tap the switch. Then, the Fingerbot runs in switching mode and goes up or down.

  • Up and Down: the range in which the Fingerbot can go up or down.

  • Duration: the duration in which the Fingerbot clicks and holds a button in clicking mode.

Device control implementation procedure

  1. Log in to the Tuya IoT Platform, create a Fingerbot product, and then click Export Function on the Function Definition page to get the DP information.

    Note: For more information about product creation, see Create Products.

    image.png
    Image

  2. Get the values of TuyaSmartDevice by deviceID. The schemaArray in the TuyaSmartDeviceModel property stores information about DPs and relevant operations.

    image.png

  3. The control panel receives DP updates and sends the updates to the device.

    Image

  4. Implement TuyaSmartHomeDelegate to synchronize DP updates of the device to the control panel. For example, the data is synchronized when the device is manually controlled or DP linkage is triggered.

    Image