make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.41k stars 542 forks source link

Request support for Pet Feeder #2413

Closed gaspuas closed 1 month ago

gaspuas commented 1 month ago

Log message

2024-10-18 12:18:29.080 DEBUG (MainThread) [custom_components.localtuya.config_flow] [eb8...ct2 - Alimentador para Mascotas] Detected DPS: {}
2024-10-18 12:18:29.080 DEBUG (MainThread) [custom_components.localtuya.config_flow] [eb8...ct2 - Alimentador para Mascotas] Manual DPS Setting: 232 (['232'])
2024-10-18 12:18:29.087 DEBUG (MainThread) [custom_components.localtuya.core.pytuya] [eb8...ct2] Connection lost: None

DPS information

{
  "result": {
    "model": "{\"modelId\":\"000004hcg3\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[{\"abilityId\":103,\"accessMode\":\"rw\",\"code\":\"basic_flip\",\"description\":\"设备设置页面-基本功能设置\\n使直播画面垂直翻转,true打开翻转,false关闭翻转\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1024\"},\"name\":\"Flip\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":106,\"accessMode\":\"rw\",\"code\":\"motion_sensitivity\",\"description\":\"0-2,灵敏度依次增加;仅为灵敏度,0并不是关闭移动侦测报警;规定0为低灵敏度,1为中灵敏度,2为高灵敏度。\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1024\"},\"name\":\"Motion detector sensitivity\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"0\",\"1\",\"2\"]}},{\"abilityId\":108,\"accessMode\":\"rw\",\"code\":\"basic_nightvision\",\"description\":\"0:自动\\n1:关\\n2:开\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1024\"},\"name\":\"Night Vision\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"0\",\"1\",\"2\"]}},{\"abilityId\":109,\"accessMode\":\"ro\",\"code\":\"sd_storge\",\"description\":\"单位改为kb\\n---\\n3503775744|778977280|2718158848\\n其中第一字符串是总容量,第二个字符串是已使用的容量,第三个是剩余容量\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"获取存储卡容量\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},{\"abilityId\":110,\"accessMode\":\"ro\",\"code\":\"sd_status\",\"description\":\"status:sd卡状态,1-正常,2-异常,3-空间不足,4-正在格式化,5-无SD卡;\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"存储卡状态\",\"typeSpec\":{\"type\":\"value\",\"max\":5,\"min\":1,\"scale\":0,\"step\":1}},{\"abilityId\":111,\"accessMode\":\"rw\",\"code\":\"sd_format\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"存储卡格式化\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":115,\"accessMode\":\"ro\",\"code\":\"movement_detect_pic\",\"description\":\"该功能实现请参考SDK\\n---------------\\n{\\\"dp_id\\\",\\\"bucket;object;key\\\"}/{\\\"dp_id\\\",\\\"bucket;object;\\\"}\\n\\nbucket:根文件夹;objcet:文件路径;key:加密\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"检测到移动\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":117,\"accessMode\":\"ro\",\"code\":\"sd_format_state\",\"description\":\"返回错误码:\\n-2000:SD卡正在格式化\\n-2001:SD卡格式化异常\\n-2002:无SD卡\\n-2003:SD卡错误\\n\\n//正数为格式化进度\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"格式化状态\",\"typeSpec\":{\"type\":\"value\",\"max\":200000,\"min\":-20000,\"scale\":0,\"step\":1,\"unit\":\"\"}},{\"abilityId\":134,\"accessMode\":\"rw\",\"code\":\"motion_switch\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"移动侦测\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":150,\"accessMode\":\"rw\",\"code\":\"record_switch\",\"description\":\"设备设置页面-存储卡设置\\nSD卡录像开关,true为打开,false为关闭\\n功能关闭时,不录像到SD卡\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"SD卡录像开关\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":151,\"accessMode\":\"rw\",\"code\":\"record_mode\",\"description\":\"设备设置页面-存储卡设置\\nSD卡录像模式选择,1为事件录像(检测到移动再录像到SD卡),2为连续录像\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"录像模式\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"1\",\"2\"]}},{\"abilityId\":231,\"accessMode\":\"rw\",\"code\":\"feed_num\",\"description\":\"返回数值说明:0:投食失败,1-20为投食的数量,若下发的投食3分,都投成功了,则返回3,APP则显示投食成功。\",\"name\":\"手动投食\",\"typeSpec\":{\"type\":\"value\",\"max\":10,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"\"}},{\"abilityId\":232,\"accessMode\":\"ro\",\"code\":\"food_weight\",\"description\":\"每份食物的重量,单位g\\t\",\"name\":\"每份食物重量\",\"typeSpec\":{\"type\":\"value\",\"max\":100,\"min\":1,\"scale\":0,\"step\":1,\"unit\":\"g\"}},{\"abilityId\":233,\"accessMode\":\"ro\",\"code\":\"realtime_data\",\"description\":\"0:余粮不足 1:出粮口有异物\",\"name\":\"实时数据\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"0\",\"1\"]}},{\"abilityId\":234,\"accessMode\":\"rw\",\"code\":\"history_data\",\"description\":\"\",\"name\":\"历史记录\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":235,\"accessMode\":\"rw\",\"code\":\"feed_voice_record\",\"description\":\"1:开启录音\\n0:关闭录音\",\"name\":\"短音录制\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"0\",\"1\"]}},{\"abilityId\":236,\"accessMode\":\"rw\",\"code\":\"schedule\",\"description\":\"面板将一个单任务用15个字节表示,然后转为string类型下发给设备端。前9位为有效位,后6位000000。\\n注意:设备端收到指令后先转换格式,byte2~byte8转为十进制整型数,byte0~byte1按照十六进制处理。\",\"name\":\"定时\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}}]}]}"
  },
  "success": true,
  "t": 1729265254048,
  "tid": "7f5e5ef98d6511efb6fd0ed0c88d1e4f"
}

Product ID

xlsmy6egamnjlaga

Product Name

Alimentador para Mascotas Smart HD

Information about how the device functions

This pet feeder works with 1 to 10 portions of 10g. It has a camera, but it doesn’t need to function if connected without the internet. The main thing is that it fulfills the purpose of feeding.

make-all commented 1 month ago

I need the log from THIS integration, not localtuya. The latter is not logging the details that I need.

gaspuas commented 1 month ago

My bad

2024-10-22 09:14:52.060 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Device count: 12 2024-10-22 09:14:52.062 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Hub count: 3 2024-10-22 09:14:58.227 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Scanning network to get IP address for eb8ecbff48918d23ccect2. 2024-10-22 09:15:01.450 DEBUG (MainThread) [custom_components.tuya_local.config_flow] Found: {'ip': '192.168.68.103', 'version': '3.3', 'id': 'eb8ecbff48918d23ccect2', 'product_id': 'xlsmy6egamnjlaga', 'data': {'ip': '192.168.68.103', 'gwId': 'eb8ecbff48918d23ccect2', 'active': 2, 'encrypt': True, 'productKey': 'xlsmy6egamnjlaga', 'version': '3.3', 'token': True, 'name': '', 'key': '', 'mac': '', 'id': 'eb8ecbff48918d23ccect2', 'ability': 0, 'wf_cfg': '', 'dev_type': 'default', 'origin': 'broadcast'}} 2024-10-22 09:15:03.962 DEBUG (MainThread) [custom_components.tuya_local.device] Refreshing device state for Test 2024-10-22 09:15:03.962 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-10-22 09:15:09.010 DEBUG (SyncWorker_16) [custom_components.tuya_local.device] Test refreshed device state: null 2024-10-22 09:15:09.012 DEBUG (MainThread) [custom_components.tuya_local.device] Retrying after exception <class 'TypeError'> argument of type 'NoneType' is not iterable (0/3) 2024-10-22 09:15:09.013 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-10-22 09:15:14.050 DEBUG (SyncWorker_12) [custom_components.tuya_local.device] Test refreshed device state: null 2024-10-22 09:15:14.052 DEBUG (MainThread) [custom_components.tuya_local.device] Retrying after exception <class 'TypeError'> argument of type 'NoneType' is not iterable (1/3) 2024-10-22 09:15:14.053 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3 2024-10-22 09:15:19.100 DEBUG (SyncWorker_17) [custom_components.tuya_local.device] Test refreshed device state: null 2024-10-22 09:15:19.102 DEBUG (MainThread) [custom_components.tuya_local.device] Retrying after exception <class 'TypeError'> argument of type 'NoneType' is not iterable (2/3) 2024-10-22 09:15:19.103 ERROR (MainThread) [custom_components.tuya_local.device] Failed to refresh device state for Test. 2024-10-22 09:15:19.103 INFO (MainThread) [custom_components.tuya_local.device] Setting protocol version for Test to 3.3

make-all commented 1 month ago

It seems this device does not return any dps locally. Meaning it cannot be supported.

tuya-local log: Test refreshed device state: null localtuya log: Detected DPS: {}

I suspected the localtuya log might mean that, but I wasn't sure if it was logging the same thing I was expecting.

gaspuas commented 1 month ago

There is nothing i can do? Is it a problem only from my petfeeder? is there a way that it can show local dps? i can personally talk with the people that make this petfeeder thats not a problem

BenJamesAndo commented 3 weeks ago

My brother has a Tuya Pet feeder and it's facing the same issue. It doesn't reveal its dps values when queried locally. The only way I've managed to get it partially working is with local tuya and manually adding in one dps value. Then using LocalTuya: Set DP Value Action to issue commands to the various dps values such as dispensing food.

I could create a Tuya Local .yaml file for the device but there doesn't seem to be any way to force add a Tuya device to use a .yaml file. When I try to add it in Tuya Local I get Unable to connect to your device with those details. It could be an intermittent issue, or they may be incorrect.