Tuya - How to map data points? - Pet feeder

Hi all,

Yesterday I got a LSC Smart pet feeder and added it in Home Assistant with the integration Tuya
image

I noticed that the app has a lot more features than home assistant is viewing:


I saw online on how to get data points in Tuya development and pulled them for the pet feeder and ended up with:
{“103”:“Flip”,“106”:“Motion detector sensitivity”,“108”:“Night Vision”,“111”:“存储卡格式化”,“115”:“Motion Detection”,“117”:“格式化状态”,“134”:“Motion”,“150”:“SD卡录像开关”,“151”:“录像模式”,“231”:“Feed”,“232”:“Food Weight”,“233”:“Realtime Data”,“234”:“History Data”,“235”:“短音录制”}

I also pulled a more readable export from the api explorer with all DP’s:

{
  "result": {
    "category": "sp",
    "functions": [
      {
        "code": "basic_flip",
        "desc": "{}",
        "name": "反面翻转",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "motion_sensitivity",
        "desc": "{\"range\":[\"0\",\"1\",\"2\"]}",
        "name": "移动侦测灵敏度",
        "type": "Enum",
        "values": "{\"range\":[\"0\",\"1\",\"2\"]}"
      },
      {
        "code": "basic_nightvision",
        "desc": "{\"range\":[\"0\",\"1\",\"2\"]}",
        "name": "红外夜视",
        "type": "Enum",
        "values": "{\"range\":[\"0\",\"1\",\"2\"]}"
      },
      {
        "code": "sd_format",
        "desc": "{}",
        "name": "存储卡格式化",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "motion_switch",
        "desc": "{}",
        "name": "移动报警开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "record_switch",
        "desc": "{}",
        "name": "SD卡录像开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "record_mode",
        "desc": "{\"range\":[\"1\",\"2\"]}",
        "name": "录像模式",
        "type": "Enum",
        "values": "{\"range\":[\"1\",\"2\"]}"
      }
    ],
    "status": [
      {
        "code": "basic_flip",
        "name": "反面翻转",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "motion_sensitivity",
        "name": "移动侦测灵敏度",
        "type": "Enum",
        "values": "{\"range\":[\"0\",\"1\",\"2\"]}"
      },
      {
        "code": "basic_nightvision",
        "name": "红外夜视",
        "type": "Enum",
        "values": "{\"range\":[\"0\",\"1\",\"2\"]}"
      },
      {
        "code": "sd_storge",
        "name": "获取存储卡容量",
        "type": "String",
        "values": "{\"maxlen\":255}"
      },
      {
        "code": "sd_status",
        "name": "存储卡状态",
        "type": "Integer",
        "values": "{\"min\":1,\"max\":5,\"scale\":0,\"step\":1}"
      },
      {
        "code": "sd_format",
        "name": "存储卡格式化",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "movement_detect_pic",
        "name": "移动检测",
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "sd_format_state",
        "name": "格式化状态",
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":-20000,\"max\":200000,\"scale\":0,\"step\":1}"
      },
      {
        "code": "motion_switch",
        "name": "移动报警开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "record_switch",
        "name": "SD卡录像开关",
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "record_mode",
        "name": "录像模式",
        "type": "Enum",
        "values": "{\"range\":[\"1\",\"2\"]}"
      }
    ]
  },
  "success": true,
  "t": 1723719954134,
  "tid": "570f826e5af611ef883136d89ae34f8e"
}

But my question is, how do I correctly map these data points so I can use them in HA? If there is a guide or something, that would be great. I tried using local tuya but that doesn’t seem to work. I heard people talking about tuyalocal being better but i can’t seem to find that integration…

Prefferably I would add these dp’s in the tuya cloud integration since that seems to work the best, but I have no idea how.

Also if there are more people with this pet feeder, let me know what you figured out. :slight_smile:

Thanks!

I got a little further, I now got the DP ids from Iot Tuya

  "result": {
    "properties": [
      {
        "code": "basic_flip",
        "custom_name": "",
        "dp_id": 103,
        "time": 1723910842385,
        "type": "bool",
        "value": false
      },
      {
        "code": "motion_sensitivity",
        "custom_name": "",
        "dp_id": 106,
        "time": 1723813952722,
        "type": "enum",
        "value": "0"
      },
      {
        "code": "basic_nightvision",
        "custom_name": "",
        "dp_id": 108,
        "time": 1723813952760,
        "type": "enum",
        "value": "0"
      },
      {
        "code": "sd_storge",
        "custom_name": "",
        "dp_id": 109,
        "time": 1723813953033,
        "type": "string",
        "value": "896|896|0"
      },
      {
        "code": "sd_status",
        "custom_name": "",
        "dp_id": 110,
        "time": 1723813953079,
        "type": "value",
        "value": 5
      },
      {
        "code": "sd_format",
        "custom_name": "",
        "dp_id": 111,
        "time": 1723650126400,
        "type": "bool",
        "value": false
      },
      {
        "code": "movement_detect_pic",
        "custom_name": "",
        "dp_id": 115,
        "time": 1723650126400,
        "type": "raw"
      },
      {
        "code": "sd_format_state",
        "custom_name": "",
        "dp_id": 117,
        "time": 1723650130139,
        "type": "value",
        "value": 0
      },
      {
        "code": "motion_switch",
        "custom_name": "",
        "dp_id": 134,
        "time": 1723650129819,
        "type": "bool",
        "value": false
      },
      {
        "code": "record_switch",
        "custom_name": "",
        "dp_id": 150,
        "time": 1723650130038,
        "type": "bool",
        "value": true
      },
      {
        "code": "record_mode",
        "custom_name": "",
        "dp_id": 151,
        "time": 1723803105627,
        "type": "enum",
        "value": "1"
      },
      {
        "code": "feed_num",
        "custom_name": "",
        "dp_id": 231,
        "time": 1723878182225,
        "type": "value",
        "value": 4
      },
      {
        "code": "food_weight",
        "custom_name": "",
        "dp_id": 232,
        "time": 1723650173063,
        "type": "value",
        "value": 10
      },
      {
        "code": "realtime_data",
        "custom_name": "",
        "dp_id": 233,
        "time": 1723878177015,
        "type": "enum",
        "value": "0"
      },
      {
        "code": "history_data",
        "custom_name": "",
        "dp_id": 234,
        "time": 1723650126400,
        "type": "bool",
        "value": false
      },
      {
        "code": "feed_voice_record",
        "custom_name": "",
        "dp_id": 235,
        "time": 1723650126400,
        "type": "enum",
        "value": "0"
      },
      {
        "code": "schedule",
        "custom_name": "",
        "dp_id": 236,
        "time": 1723877353330,
        "type": "string",
        "value": "7f0820041000000"
      }
    ]
  },
  "success": true,
  "t": 1723910852986,
  "tid": "cf9e5aaf5cb211ef883136d89ae34f8e"
}

And I know which yaml is being used in TuyaLocal for this device, it’s “ceres_plus_petfeeder.yaml” so now I need to know how I can include some of these DP ids so I can enrich the entities in HA.

Anyone who can help me out?

Hi,

I’m in a similar boat. I bought a Kogan 4L pet feeder with camera and it seems to have the same DP Ids as yours. I have been trying to get it integrated into HA but without much luck.

I’ve also been trying with LocalTuya to manually send the command via DPId 231.

When going through the command setup, 231 is weirdly omitted from the list of available ones, so I tried adding it using the Manual DPS to add and setting it as a number (ranging from 0-10). When created, the entity has a value on “unavailable”, and manually setting the state via HA DevTools changes the value to 1, but it doesn’t seem to send the command to the device.

If I login to iot.tuya.com and navigate to “Debug Device”, set feed_num to 1, and hit “Send Instruction”, then it does trigger a feed. To note, when I do it via the IOT website (or via the SmartLife app) it makes the entity in HA revert back to “unavailable”.

I don’t know where to go from here. I’m not so much fussed about getting the camera entities working (though that would be nice), I would just like to be able to send a “feed” command via HA and not have to go via the SmartLife app.

If anyone has any suggestions on how to try this, please let me know

Screenshot of the IoT area where I can Send the feed_num Instruction

1 Like