『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 1683|回复: 2

[求助] 涂鸦设备通过localtuya接入ha,但是DP值对不上

[复制链接]
回帖奖励 28 金钱 回复本帖可获得 1 金钱奖励! 每人限 1 次(中奖概率 80%)

1

主题

17

帖子

88

积分

注册会员

Rank: 2

积分
88
金钱
71
HASS币
0
发表于 2023-5-14 00:06:13 | 显示全部楼层 |阅读模式
本帖最后由 clan 于 2023-5-14 00:06 编辑

我有一个涂鸦的猫砂盆一直想接入home assistant 但是从lot获取到的DP值一直与localtuya上给我提供的DP值对不上,少了很多数值。先贴一下我获取到的设备的所有DP和对应名称、类型和取值范围。
{
  "result": {
    "category": "msp",
    "functions": [
      {
        "code": "switch",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "auto_clean",
        "dp_id": 4,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "delay_clean_time",
        "dp_id": 5,
        "type": "Integer",
        "values": "{"unit":"min","min":2,"max":60,"scale":0,"step":2}"
      },
      {
        "code": "manual_clean",
        "dp_id": 9,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "sleep",
        "dp_id": 10,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "light",
        "dp_id": 16,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "deodorization",
        "dp_id": 17,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "factory_reset",
        "dp_id": 23,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "status",
        "dp_id": 24,
        "type": "Enum",
        "values": "{"range":["standby","pet_near","pet_into","wait_clean","cleaning","deodorization","sleep","enpty"]}"
      },
      {
        "code": "filter_reset",
        "dp_id": 101,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "lock",
        "dp_id": 104,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "periodic_cleaning",
        "dp_id": 105,
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "sleep_time",
        "dp_id": 106,
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "automatic_purity",
        "dp_id": 107,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "periodic_purity",
        "dp_id": 108,
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "empty",
        "dp_id": 109,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "pause",
        "dp_id": 110,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "continue",
        "dp_id": 111,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "ball_reset",
        "dp_id": 112,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "empty_cancel",
        "dp_id": 115,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "t_d_sw",
        "dp_id": 117,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "t_cleasw",
        "dp_id": 118,
        "type": "Boolean",
        "values": "{}"
      }
    ],
    "status": [
      {
        "code": "switch",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "auto_clean",
        "dp_id": 4,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "delay_clean_time",
        "dp_id": 5,
        "type": "Integer",
        "values": "{"unit":"min","min":2,"max":60,"scale":0,"step":2}"
      },
      {
        "code": "cat_weight",
        "dp_id": 6,
        "type": "Integer",
        "values": "{"unit":"g","min":0,"max":30000,"scale":0,"step":1}"
      },
      {
        "code": "excretion_times_day",
        "dp_id": 7,
        "type": "Integer",
        "values": "{"unit":"times","min":0,"max":200,"scale":0,"step":1}"
      },
      {
        "code": "excretion_time_day",
        "dp_id": 8,
        "type": "Integer",
        "values": "{"unit":"s","min":0,"max":600,"scale":0,"step":1}"
      },
      {
        "code": "manual_clean",
        "dp_id": 9,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "sleep",
        "dp_id": 10,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "light",
        "dp_id": 16,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "deodorization",
        "dp_id": 17,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "notification",
        "dp_id": 21,
        "type": "Bitmap",
        "values": "{"label":["M_C_complete","A_C_complete","T_C_complete","M_C_cancel","M_D_complete","A_D_complete","T_D_complete","empty_complete","weight_reset","checking_OK","key_lock","key_unlock","light_on","light_off","cleaning_pause","sleep_open","sleep_off","empty_cancel","chang_litter"],"maxlen":19}"
      },
      {
        "code": "fault",
        "dp_id": 22,
        "type": "Bitmap",
        "values": "{"label":["top_cover_fault","drawer_fault","drawer_full","stuck_cat","checking_fault","stay_long","trouble_removal"],"maxlen":7}"
      },
      {
        "code": "factory_reset",
        "dp_id": 23,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "status",
        "dp_id": 24,
        "type": "Enum",
        "values": "{"range":["standby","pet_near","pet_into","wait_clean","cleaning","deodorization","sleep","enpty"]}"
      },
      {
        "code": "filter_reset",
        "dp_id": 101,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "filter_days",
        "dp_id": 102,
        "type": "Integer",
        "values": "{"unit":"day","min":0,"max":30,"scale":0,"step":1}"
      },
      {
        "code": "average_times",
        "dp_id": 103,
        "type": "Integer",
        "values": "{"unit":"s","min":1,"max":600,"scale":0,"step":1}"
      },
      {
        "code": "lock",
        "dp_id": 104,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "periodic_cleaning",
        "dp_id": 105,
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "sleep_time",
        "dp_id": 106,
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "automatic_purity",
        "dp_id": 107,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "periodic_purity",
        "dp_id": 108,
        "type": "Raw",
        "values": "{}"
      },
      {
        "code": "empty",
        "dp_id": 109,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "pause",
        "dp_id": 110,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "continue",
        "dp_id": 111,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "ball_reset",
        "dp_id": 112,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "cleaned_complete",
        "dp_id": 113,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "reser_complete",
        "dp_id": 114,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "empty_cancel",
        "dp_id": 115,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "toilet_record",
        "dp_id": 116,
        "type": "String",
        "values": "{"maxlen":255}"
      },
      {
        "code": "t_d_sw",
        "dp_id": 117,
        "type": "Boolean",
        "values": "{}"
      },
      {
        "code": "t_cleasw",
        "dp_id": 118,
        "type": "Boolean",
        "values": "{}"
      }
    ]
  },
  "success": true,
  "t": 1683976213873,
  "tid": "bbd61517f17e11ed866f1a91535b7199"
}
第一个"code": "switch",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
是控制猫砂盆清理猫砂的开关,但是到添加开关的时候,localtuya给我提供的DP值就是没有1,如下图

然后我发现了这个地方,填写了一下数字到了后面的菜单,发现有1这个值了,但是后面的value很明显不是我要的。
2.PNG 3.PNG
但我还是添加了一下这个实体,果不其然显示不可用
4.PNG
后续我想着我自己加个括号好了,结果那个(value:-1)还是会出现,搞不懂怎么搞了
5.PNG
回复

使用道具 举报

11

主题

78

帖子

792

积分

高级会员

Rank: 4

积分
792
金钱
709
HASS币
20
发表于 2023-5-17 09:28:26 | 显示全部楼层

回帖奖励 +1 金钱

本帖最后由 hkjqy123 于 2023-5-17 09:30 编辑

直接填写1试试,你这个涂鸦iot平台如何获取的{
        "code": "switch",
        "dp_id": 1,
        "type": "Boolean",
        "values": "{}"
      },我的里面没有"dp_id": 1,
回复

使用道具 举报

1

主题

17

帖子

88

积分

注册会员

Rank: 2

积分
88
金钱
71
HASS币
0
 楼主| 发表于 2023-5-28 21:13:04 | 显示全部楼层
hkjqy123 发表于 2023-5-17 09:28
直接填写1试试,你这个涂鸦iot平台如何获取的{
        "code": "switch",
        "dp_id": 1,

直接写1是什么意思,是我写1,23的地方只写个1?如果是这样的话,也是不可用的。获取DP值参考https://bbs.hassbian.com/forum.php?mod=viewthread&tid=18489
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-24 16:27 , Processed in 0.282203 second(s), 29 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表