Pet Camera Configurations

Last Updated on : 2022-11-24 09:20:12download

This topic describes the pet camera configurations for smart pet feeders. Built on top of the IP camera (IPC), the pet camera enables features including feeding schedule, manual feeding, feeding record, and voice message recording.

Create a product

Go to Tuya IoT Development Platform > Product > Tuya OS > Development, and click Create > Standard Category > IP Camera > Smart Camera > Custom Solution. Then, complete the required product information. The platform will automatically generate a product IP (PID).

For more information about product creation, see Create Products.

Pet Camera Configurations

Standard function

You can select the standard function as needed. The icon of the selected function will be displayed on the control panel and device setting page in the mobile app.

Pet Camera Configurations

Motion detection

Pet Camera Configurations

The DP definitions are described in the following table.

DP name Identifier Data transfer type Data type Property Remarks
DP 115
Motion detected
movement_detect_pic Report only (read-only) Raw N/A For more information about the DP implementation, see Motion detection (general).
DP 134
Motion alert
motion_switch Send and report (read-write) Boolean N/A N/A

DP 134 controls the motion detection switch. When moving objects are detected, the SDK and DP 115 are used to report the motion detection images. The user can then receive and view the motion alerts on the Message tab of the app. The motion alerts need to be configured in Device Notification. DP 115 can be replaced with DP 185.

Others

You can add more standard functions. For more information, see IPC Basic Configurations.

Custom function

The features including feeding schedule, manual feeding, feeding record, and voice message recording are custom functions. You need to manually configure the DPs to implement these features on the app. For more information, see Custom Function.

Pet Camera Configurations

Manual feeding

The DP definitions are described in the following table.

DP name Identifier Data transfer type Data type Property Remarks
Send feeding feed_publish Send only (write-only) Value
  • Value range: 1 to 20
  • Pitch: 1
  • Scale: 0
  • Unit: servings
  • Send the DP to define the number of servings for feeding.
    Report feeding feed_report Report only (read-only) Value
  • Value range: 0 to 20
  • Pitch: 1
  • Scale: 0
  • Unit: servings
  • Description of return values:
    • 0: failed to feed.
    • 1 to 20: the number of servings. For example, if the sent DP defines three servings and all of them are delivered, the value 3 is returned, and the app shows that feeding is successful.
    Weight per serving food_weight Report only (read-only) Value
  • Value range: 1 to 100
  • Pitch: 1
  • Scale: 1
  • Unit: g
  • The weight of food to be delivered per serving. Unit: g.

    Fed successfully

    Pet Camera Configurations

    Failed to feed

    Pet Camera Configurations

    Feeding record

    The DP definitions are described in the following table.

    DP name Identifier Data transfer type Data type Property Remarks
    Feeding record history_data Send and report (read-write) Boolean Add this DP to show the Record icon.
    Report feeding feed_report Report only (read-only) Value
  • Value range: 0 to 20
  • Pitch: 1
  • Scale: 0
  • Unit: servings
  • Description of return values:
    • 0: failed to feed.
    • 1 to 20: the number of servings. For example, if the sent DP defines three servings and all of them are delivered, the value 3 is returned, and the app shows that feeding is successful.

    Control with the app:

    Tap the Record icon to view the feeding records. The feeding statistics can be calculated by day, week, and month.

    Pet Camera Configurations

    These records are reported by the DP identifier feed_report. You need to contact Tuya’s project manager to add this identifier to implement the statistics.

    Voice message recording

    The DP definitions are described in the following table.

    DP name Identifier Data transfer type Data type Property Remarks
    Voice message recording feed_voice_record Send and report (read-write) Enumeration Enum values: 0 and 1
  • 1: enable recording
  • 0: disable recording
  • Control panel

    Pet Camera Configurations

    Feeding schedule

    Two types of feeding schedules are supported: online and offline. Their differences are described as follows:

    • Online feeding schedule: The device needs to be connected to the internet. This feature is controlled with the identifiers feed_puslish and feed_report.
    • Offline feeding schedule: The device does not require access to the internet, but needs to be powered by batteries. In the case of network failure or power failure, the microcontroller unit (MCU) drives the motor to run feeding schedules.

    Description of offline feeding schedule

    The DP definitions are described in the following table.

    DP name Identifier Data transfer type Data type Property Remarks
    Schedule schedule Send and report (read-write) String The panel represents a command with 15 bytes, converts the command into the string type, and then sends it to the device. The first 9 bytes are valid bytes and the last 6 bytes are 000000.

    After the command arrives, the device processes its format first: byte2 to byte8 are converted into decimal integers and byte0 to byte1 are converted into hexadecimal numbers.

    These bytes are described in the following table.

    Field Property Description
    byte0 to byte1 Week Treat byte0 to byte1 as a byte in the hexadecimal format and parse the bits of the byte.
    byte2 to byte3 Hour Byte2 × 10 + byte3.
    byte4 to byte5 Minute Byte4 × 10 + byte5.
    byte6 to byte7 Number of servings A value from 01 to 20 represents the number of servings.
    byte8 Task on/off
  • 1: The task is valid.
  • 0: The task is invalid.
  • byte9 Reserved 0
    byte10 Reserved 0
    byte11 Reserved 0
    byte12 Reserved 0
    byte13 Reserved 0
    byte14 Reserved 0

    byte0 to byte1 are described in the following table.

    bit0 bit1 bit2 bit3 bit4 bit5 bit6
    Sunday Monday Tuesday Wednesday Thursday Friday Saturday
    • bit0 to bit6 represent each day in a week from Sunday to Saturday. The task is run on the day with the bit value of 1.
    • If all bits are 0, the task is run only once.

    Example:

    Send the following command to the device:
    002325121000000

    • 00: only once
    • 23: the hour number 23
    • 25: the minute number 25
    • 12: 12 servings
    • 1: valid task
    • 000000: reserved, unused

    Meaning: 12 servings are delivered at 23:25 on the current day.

    Panel design

    1. Open the product development wizard and go to the Device Interaction step.

    2. Select Panel Control > All-in-One Panel > IPC General Panel (App minimum version 3.17.0).

      Pet Camera Configurations

    Hardware development

    The IPC SDK must be integrated to implement a pet camera. Perform the following steps:

    1. Check if the SDK for your cross-compilation toolchain in use is available. You can download it from GitHub. If you do not find the required SDK, contact the project manager and request the SDK.
    2. Develop with the SDK as instructed by the IPC SDK Development Guide.

    Push notification settings

    You can set rules to trigger an automated push notification. For example, set a threshold for a function. If the preset value is reached, the user will receive an alert from the mobile phone.

    The following figure shows how to access push notification settings on the Tuya IoT Development Platform:

    Pet Camera Configurations

    Push notification is available to accounts of the premium version or ultimate version.

    Configure the push notification as needed and adapt to the firmware. After you finish the configuration, contact the project manager for approval. For more information, see Configure Push Notification.

    Successful manual feeding (DP feed_report)

    Pet Camera Configurations

    Failed manual feeding (DP feed_report)

    Pet Camera Configurations

    Insufficient food (DP realtime_data)

    The custom DP definitions are described in the following table.

    DP name Identifier Data transfer type Data type Property Remarks
    Real-time data realtime_data Send and report (read-write) Enumeration Enum values: 0 and 1
  • 1: An error has occurred while dispensing food.
  • 0: The remaining food is insufficient.
  • Examples of trigger conditions

    Pet Camera Configurations

    Food dispensing error (DP realtime_data)

    Pet Camera Configurations

    Quick creation

    Check out the Pet Camera solution. Click Start OEM to get started.