Pet Feeder Entities

ok , found them, indeed looks the same

thnx

Hi @alexbeatle ,

Can i ask if you can share your yaml config code for your feeder setup please?

Thanks
Chris

He posted his yaml code

He only posted the dashboard code

Ah, ok, sorry, according to his Lovelace, he setup localtuya… Localtuya supports more entities then the Tuya cloud integration itself

I have it setup in the Local Tuya UI. It migrated away from yaml at some point…

Check out LocalTuya, it’s pretty easy to setup.

Sorry to ressurect this, but just bought the HoneyGuardian after seeing your confirmation it works.

So far so good, other than I’m still learning Home Assistant and I can’t figure out how you got the input_boolean.pet_feeder_feed_now along with input_number.feed_now entities. I have a number.feed_now that triggers a feeding if I change it, as per your first post but can’t get your two inputs for the card ui.

I had to read this thread just to see if anyone took it apart and reflashed it. Surprisingly no.

Andy

If you have the knowledge on how to, it would be awesome if you could share!

1 Like

Had to look back how I did it…

The feeder releases the food whenever you trigger the number.feed_now_portion_size from the integration. Even if you trigger with the same number. There’s no way to do that directly, I think. Even though I want to feed same portion size everyday…

So, I created input_boolean.pet_feeder_feed_now and input_number.pet_feeder_portion_size temp variables. Whenever I trigger input_boolean.pet_feeder_feed_now, it passes the value from input_number.pet_feeder_portion_size to number.feed_now_portion_size.

Defining temp variables in my configuration.yaml:

input_boolean:
    pet_feeder_feed_now:
        name: Pet Feeder. Feed Now
        icon: mdi:mother-nurse
input_number:
    pet_feeder_portion_size:
        name: Pet Feeder Portion Size
        step: 1
        min: 1
        max: 6
        mode: box

See these topics:

Tying the temp variables and the integration can be done in several ways. I like Node Red, so I did this… (it also notifies my phone when food is released and the portion size)

You can import this to Node Red…

[{"id":"a483fdd610caee7c","type":"tab","label":"Flow 2","disabled":false,"info":"","env":[]},{"id":"b6f851e73ae59ce8","type":"api-call-service","z":"a483fdd610caee7c","name":"release portion","server":"%%ID%%","version":5,"debugenabled":false,"domain":"number","service":"set_value","areaId":[],"deviceId":[],"entityId":["number.feed_now_portion_size"],"data":"{\"value\":\"{{payload}}\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":800,"y":220,"wires":[[]]},{"id":"8418ba4791e2f211","type":"server-state-changed","z":"a483fdd610caee7c","name":"feed now","server":"%%ID%%","version":4,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"input_boolean.pet_feeder_feed_now","entityidfiltertype":"exact","outputinitially":false,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":true,"for":"0","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":true,"ignorePrevStateUnavailable":true,"ignoreCurrentStateUnknown":true,"ignoreCurrentStateUnavailable":true,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"eventData"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":360,"y":240,"wires":[["a774a94246e09bcb"],[]]},{"id":"a774a94246e09bcb","type":"api-current-state","z":"a483fdd610caee7c","name":"get portion size","server":"%%ID%%","version":3,"outputs":1,"halt_if":"","halt_if_type":"str","halt_if_compare":"is","entity_id":"input_number.pet_feeder_portion_size","state_type":"str","blockInputOverrides":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"entityState"},{"property":"data","propertyType":"msg","value":"","valueType":"entity"}],"for":"0","forType":"num","forUnits":"minutes","override_topic":false,"state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":540,"y":200,"wires":[["397e93e4bb20b682","91d32c49d73ccf75","b6f851e73ae59ce8"]]},{"id":"a4d198e50427effe","type":"api-call-service","z":"a483fdd610caee7c","name":"Cancel \"feed now\"","server":"%%ID%%","version":5,"debugenabled":false,"domain":"input_boolean","service":"turn_off","areaId":[],"deviceId":[],"entityId":["input_boolean.pet_feeder_feed_now"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":990,"y":320,"wires":[[]]},{"id":"397e93e4bb20b682","type":"delay","z":"a483fdd610caee7c","name":"","pauseType":"delay","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":780,"y":320,"wires":[["a4d198e50427effe"]]},{"id":"91d32c49d73ccf75","type":"api-call-service","z":"a483fdd610caee7c","name":"Notify Huawei","server":"%%ID%%","version":5,"debugenabled":false,"domain":"notify","service":"mobile_app_myhuawei","areaId":[],"deviceId":[],"entityId":[],"data":"{\"message\":\"Feeding {{payload}} portions\",\"title\":\"Pet Feeder\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","output_location":"payload","output_location_type":"msg","x":780,"y":100,"wires":[[]]},{"id":"%%ID%%","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30,"areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]

For some reason my pet calling function stopped working, but my cats hear it for miles when the food hits the metal bowls. So never went back to figure out why it’s not working.

Hope this helps.

1 Like

Ah sweet, that makes sense. Thanks!

I’ve just got this cheap XTUOES pet feeder and I’m trying to figure out the IDs


Copy
{
  "result": {
    "category": "cwwsq",
    "functions": [
      {
        "code": "meal_plan",
        "dp_id": 1,
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "manual_feed",
        "dp_id": 3,
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":1,\"max\":20,\"scale\":0,\"step\":1}"
      },
      {
        "code": "factory_reset",
        "dp_id": 9,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "light",
        "dp_id": 19,
        "type": "Boolean",
        "values": "{}"
      }
    ],
    "status": [
      {
        "code": "meal_plan",
        "dp_id": 1,
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "manual_feed",
        "dp_id": 3,
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":1,\"max\":20,\"scale\":0,\"step\":1}"
      },
      {
        "code": "factory_reset",
        "dp_id": 9,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "battery_percentage",
        "dp_id": 11,
        "type": "Integer",
        "values": "{\"unit\":\"%\",\"min\":0,\"max\":100,\"scale\":0,\"step\":1}"
      },
      {
        "code": "charge_state",
        "dp_id": 12,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "feed_report",
        "dp_id": 15,
        "type": "Integer",
        "values": "{\"unit\":\"\",\"min\":0,\"max\":20,\"scale\":0,\"step\":1}"
      },
      {
        "code": "light",
        "dp_id": 19,
        "type": "Boolean",
        "values": "{}"
      }
    ]
  },
  "success": true,
  "t": 1679839030186,
  "tid": "1a370a3ecbde11eda2718e524cafdb21"
}

3 - manual feed
11 - battery %
12 - charge state
14 - ?
15 - last feed portion size?
19 - WiFi indicator light
101 - AC power indicator
103 - ?
112 - Volume (1 to 3)

Not sure how to get it to trigger a feed. If I try and call dp3 with value 1 it says key not provided

I have another brand of this pet feeder, the end-points according to debug mode on Tuya IoT plaform

  • Meal Plan - EndPoint “1”
  • Manual Feed - EndPoint “3”
  • Factory Reset - EndPoint “9”
  • Battery Percentage - EndPoint “11”
  • Charge State - EndPoint “12”
  • Fault - EndPoint “14”
  • Feed Report - EndPoint “15”
  • Light - EndPoint “19”
  • Power Status - EndPoint “101”
  • Mode - EndPoint “103”
  • Volume - EndPoint “112”
  • Battery - EndPoint “116”

Use the service number.set_value to “instant feed”. I made a small script for this, where the additional “portion_size” is used to give as many servings as wanted

alias: PetFeeder-Serve Portions
sequence:
  - service: number.set_value
    data:
      value: "{{ states('input_number.portion_size') }}"
    target:
      entity_id: number.instant_feed
mode: single

See also here:

Thanks, I just did it this way and it works!

1 Like

I just want to say thank you to the helpful tips here on how to set up those pet feeders, esp. @kirbby for the easy debug info and the different posts on how to create scripts/switches even though you just have an input number and no dedicated switch to feed.
I got a Rojeco Smart Pet Feeder and it is completely the same as others have mentioned here.
One switch to turn on/off the status lights, one status sensor, one bucket empty sensor and one input number for the portions, for the other values I could not identify if/how they would help me (esp. boolean values for “quick feed” and “slow feed”, where I initially expected to get a switch that triggers feeding).

Got the same one and this is close but not quite…

using the Tuya APIs you can actually get a detailed model of the device attributes

1 - Meal plan schedule (not visible in localtuya)
Translated description (google)

Synchronized to the local device side, even if the device is offline, it can still feed and output normally. The feeding plan supports 6 groups, a total of 30 bytes, and zeros are filled for insufficient positions.
Raw format convention: implement local timing according to “period + time + number of feedings + switch”, as follows

  1. The first 7 bits represent Monday to Sunday, binary to hexadecimal, occupying one byte, 0 means not set, 1 means set, such as 0000001, which means Sunday is effective, converted to hexadecimal is 01
  2. The time is in hour and minute format, occupying 2 bytes, minutes and hours, converted from decimal to hexadecimal, such as 18:50, converted to hexadecimal to 1232
  3. Number of servings, range 1-48. Occupies 1 byte, convert decimal to hexadecimal, such as 12, convert to hexadecimal to 0c
  4. Switch, occupying 1 byte, 00 means off, 01 means on
    For the above example, the result sent by the APP is 0112320c01, which means Sunday, 18:50, feed 12 servings, and turn on.

3 - manual feeding
6 - slow feed mode toggle
14 - faults - pretty generic and doesnt really give any info. Hints at a food sensor but this doesnt seem to be real. (not visible in localtuya)
18 - voice recording play times
Full response:
101 - report feedings - shows last feeding portion

Used to record the number of servings. After each successful feeding, the mcu needs to report the number of feedings. The panel is displayed on the record page.

102 - 12/24 hour clock toggle
103 - battery level enum
104 - “style” I think it has to do with the theme in the app? (not visible in localtuya)

Full response

{
  "result": {
    "model": {
      "modelId": "000003ys3u",
      "services": [
        {
          "actions": [],
          "code": "",
          "description": "",
          "events": [],
          "name": "默认服务",
          "properties": [
            {
              "abilityId": 1,
              "accessMode": "rw",
              "code": "meal_plan",
              "description": "同步到设备端本地,即使设备离线,仍能正常喂食出粮,喂食计划支持6组,共30字节,不足位补零。\nraw格式约定:按照“周期+时间+喂食份数+开关”来实现本地定时,具体如下\n1,前7个比特位代表周一到周日,二进制转十六进制,占用一 个字节,0代表未设置,1代表设置,如0000001,表示周日生效,转换为16进制就是01\n2,时间按照小时分钟格式,占用2个字节,分钟 和小时,十进制转16进制,如18:50,转为16进制为1232\n3,喂食份数,范围1-48.占用1个字节,十进制转16进制,如12,转为16进制 为0c\n4,开关,占用1个字节,00表示关闭,01表示开启\n上述举例,对于APP端时间下发的结果为0112320c01,表示周日,18:50,喂 食12份,开启。",
              "extensions": {
                "iconName": "icon-dp_time3",
                "attribute": "96",
                "trigger": "direct"
              },
              "name": "喂食计划",
              "typeSpec": {
                "maxlen": 128,
                "type": "raw"
              }
            },
            {
              "abilityId": 3,
              "accessMode": "rw",
              "code": "manual_feed",
              "description": "手动喂食份数",
              "extensions": {
                "iconName": "icon-icon-test13",
                "trigger": "direct"
              },
              "name": "手动喂食",
              "typeSpec": {
                "max": 6,
                "min": 1,
                "scale": 0,
                "step": 1,
                "type": "value",
                "typeDefaultValue": 1,
                "unit": ""
              }
            },
            {
              "abilityId": 6,
              "accessMode": "rw",
              "code": "slow_feed",
              "description": "",
              "extensions": {
                "iconName": "icon-dp_wash",
                "trigger": "direct"
              },
              "name": "慢放喂食",
              "typeSpec": {
                "type": "bool",
                "typeDefaultValue": false
              }
            },
            {
              "abilityId": 14,
              "accessMode": "ro",
              "code": "fault",
              "description": "",
              "extensions": {
                "iconName": "icon-dp_notice",
                "scope": "fault",
                "trigger": "direct"
              },
              "name": "故障告警",
              "typeSpec": {
                "label": [
                  "food_run_out",
                  "ERR1",
                  "ERR3",
                  "ERR5"
                ],
                "maxlen": 4,
                "type": "bitmap",
                "typeDefaultValue": 0
              }
            },
            {
              "abilityId": 18,
              "accessMode": "rw",
              "code": "voice_times",
              "description": "",
              "extensions": {
                "attribute": "224"
              },
              "name": "语音播放次数",
              "typeSpec": {
                "max": 10,
                "min": 0,
                "scale": 0,
                "step": 1,
                "type": "value",
                "typeDefaultValue": 0
              }
            },
            {
              "abilityId": 101,
              "accessMode": "ro",
              "code": "record",
              "description": "用于记录喂食份数。每次喂食成功后mcu需要上报喂食份数。面板显示在记录页面。",
              "extensions": {
                "trigger": "direct"
              },
              "name": "喂食记录",
              "typeSpec": {
                "max": 48,
                "min": 1,
                "scale": 0,
                "step": 1,
                "type": "value",
                "typeDefaultValue": 1,
                "unit": ""
              }
            },
            {
              "abilityId": 102,
              "accessMode": "rw",
              "code": "hour",
              "description": "false为12小时制(默认),true为24小时制",
              "name": "24小时制",
              "typeSpec": {
                "type": "bool",
                "typeDefaultValue": false
              }
            },
            {
              "abilityId": 103,
              "accessMode": "ro",
              "code": "battery",
              "description": "",
              "name": "备用电池",
              "typeSpec": {
                "range": [
                  "empty",
                  "low",
                  "high",
                  "full"
                ],
                "type": "enum",
                "typeDefaultValue": "empty"
              }
            },
            {
              "abilityId": 104,
              "accessMode": "rw",
              "code": "style",
              "description": "",
              "name": "风格",
              "typeSpec": {
                "range": [
                  "1",
                  "2",
                  "3",
                  "4",
                  "5"
                ],
                "type": "enum",
                "typeDefaultValue": "1"
              }
            }
          ]
        }
      ]
    }
  },
  "success": true
}

No need to install anything IF you want to get DPS just go to IOT platform

CLOUD>>API EXPLORER>>DEVICE CONTROL>>QUERY PROPERTIES
and put the device ID which can be found on Cloud Development Project Under Devices TAB

QUESTION

How to get the time”: 1692008334153 of feed_report and put it as attribute

{
“code”: “feed_report”,
“custom_name”: “”,
“dp_id”: 15,
“time”: 1692008334153,
“value”: 3
}
]

i jast create these repository but i must complet it.
All the disponible entity are present for Honeygaridan S56

give a look

1 Like