make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.07k stars 435 forks source link

Request support for Diivoo DWV010 #1929

Open brokkolo opened 1 month ago

brokkolo commented 1 month ago

Log Message

2024-05-18 08:11:56.576 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches asc_wifi_circuit_breaker with quality of 12%. DPS: {"updated_at": 1716012708.2212594, "1": false, "7": 100, "10": "cancel", "11": 600, "12": "idle", "101": "time_irri", "110": "L", "111": "C", "112": 0, "113": "2024/05/18 08:01", "115": "24H", "121": false, "124": "cancel", "125": 600, "126": "idle", "128": "time_irri"}

Information about DPS mappings

{
  "result": {
    "model": "{\"modelId\":\"000004vfpu\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[{\"abilityId\":1,\"accessMode\":\"rw\",\"code\":\"switch\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_power2\",\"attribute\":\"1664\"},\"name\":\"左阀阀门开关\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":4,\"accessMode\":\"ro\",\"code\":\"fault\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-baojing\",\"scope\":\"fault\",\"attribute\":\"1216\"},\"name\":\"故障上报\",\"typeSpec\":{\"type\":\"bitmap\",\"label\":[\"low_battery\",\"no_water\",\"left_leak\",\"right_leak\"],\"maxlen\":4}},{\"abilityId\":5,\"accessMode\":\"ro\",\"code\":\"water_once\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1216\"},\"name\":\"左阀单次水量\",\"typeSpec\":{\"type\":\"value\",\"max\":999999,\"min\":0,\"scale\":1,\"step\":1,\"unit\":\"L\"}},{\"abilityId\":6,\"accessMode\":\"ro\",\"code\":\"water_total\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_mode\",\"attribute\":\"1216\"},\"name\":\"左阀当日耗水总量\",\"typeSpec\":{\"type\":\"value\",\"max\":999999,\"min\":0,\"scale\":1,\"step\":1,\"unit\":\"L\"}},{\"abilityId\":7,\"accessMode\":\"ro\",\"code\":\"battery_percentage\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_battery\",\"attribute\":\"1216\"},\"name\":\"电池电量\",\"typeSpec\":{\"type\":\"value\",\"max\":100,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"%\"}},{\"abilityId\":10,\"accessMode\":\"rw\",\"code\":\"weather_delay\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_light2\",\"attribute\":\"1248\"},\"name\":\"左阀天气延时\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"cancel\",\"24h\",\"48h\",\"72h\"]}},{\"abilityId\":11,\"accessMode\":\"rw\",\"code\":\"countdown\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_time2\",\"attribute\":\"1728\"},\"name\":\"左阀灌溉剩余时长\",\"typeSpec\":{\"type\":\"value\",\"max\":604800,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"s\"}},{\"abilityId\":12,\"accessMode\":\"ro\",\"code\":\"work_state\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-zhuangtai\",\"attribute\":\"1248\"},\"name\":\"左阀工作状态\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"auto\",\"manual\",\"idle\",\"delay\"]}},{\"abilityId\":15,\"accessMode\":\"ro\",\"code\":\"use_time_one\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_time3\",\"attribute\":\"1216\"},\"name\":\"左阀单次使用时间\",\"typeSpec\":{\"type\":\"value\",\"max\":604800,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"s\"}},{\"abilityId\":16,\"accessMode\":\"rw\",\"code\":\"cycle_timing\",\"description\":\"自定义协议\",\"extensions\":{\"iconName\":\"icon-dp_time3\",\"attribute\":\"96\"},\"name\":\"周期灌溉\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":17,\"accessMode\":\"rw\",\"code\":\"timer\",\"description\":\"自定义协议\",\"extensions\":{\"iconName\":\"icon-timer1\",\"attribute\":\"96\"},\"name\":\"普通定时\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":28,\"accessMode\":\"rw\",\"code\":\"no_irrigation_timing\",\"description\":\"自定义协议\",\"extensions\":{\"iconName\":\"icon-dp_time3\",\"attribute\":\"96\"},\"name\":\"非灌溉时间\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":101,\"accessMode\":\"ro\",\"code\":\"work_mode_1\",\"description\":\"设置左阀工作时是按量灌溉还是按时灌溉,0:按时灌溉  1:按量灌溉\",\"name\":\"左阀工作模式\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"time_irri\",\"flow_irri\"]}},{\"abilityId\":102,\"accessMode\":\"ro\",\"code\":\"next_time_1\",\"description\":\"下次开始时间:开始的月份1个字节,开始的日1个字节,开始的小时1字节,开始的分钟1字节\",\"name\":\"左阀下次开始时间\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":103,\"accessMode\":\"rw\",\"code\":\"flow_countdown_1\",\"description\":\"\",\"name\":\"左阀定量灌溉剩余流量\",\"typeSpec\":{\"type\":\"value\",\"max\":99999,\"min\":1,\"scale\":0,\"step\":1,\"unit\":\"L\"}},{\"abilityId\":104,\"accessMode\":\"ro\",\"code\":\"total_work_time_1\",\"description\":\"\",\"name\":\"左阀按时灌溉总时长\",\"typeSpec\":{\"type\":\"value\",\"max\":604800,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"s\"}},{\"abilityId\":105,\"accessMode\":\"ro\",\"code\":\"total_work_flow_1\",\"description\":\"\",\"name\":\"左阀按量灌溉总量\",\"typeSpec\":{\"type\":\"value\",\"max\":99999,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"L\"}},{\"abilityId\":106,\"accessMode\":\"ro\",\"code\":\"last_work_time_flow_1\",\"description\":\"前四字节单次使用时间,单位:s\\n后四字节单次使用流量,单位:0.1L\",\"name\":\"左阀单次用水量及使用时间\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":110,\"accessMode\":\"rw\",\"code\":\"flow_unit_set\",\"description\":\"流量单位设置,0:升,1:美制加仑\",\"name\":\"流量单位选择\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"L\",\"GAL\"]}},{\"abilityId\":111,\"accessMode\":\"rw\",\"code\":\"temp_unit_set\",\"description\":\"温度单位设置  0:摄氏度,1:华氏度\",\"name\":\"温度单位选择\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"C\",\"F\"]}},{\"abilityId\":112,\"accessMode\":\"ro\",\"code\":\"water_comsumption_total\",\"description\":\"\",\"name\":\"累计耗水总量\",\"typeSpec\":{\"type\":\"value\",\"max\":9999999,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"L\"}},{\"abilityId\":113,\"accessMode\":\"ro\",\"code\":\"equiment_time\",\"description\":\"\",\"name\":\"当前设备时间\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},{\"abilityId\":115,\"accessMode\":\"rw\",\"code\":\"time_format_set\",\"description\":\"\",\"name\":\"时间制式选择\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"12H\",\"24H\"]}},{\"abilityId\":121,\"accessMode\":\"rw\",\"code\":\"switch_2\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-dp_power2\"},\"name\":\"右阀阀门开关\",\"typeSpec\":{\"type\":\"bool\"}},{\"abilityId\":122,\"accessMode\":\"ro\",\"code\":\"water_once_2\",\"description\":\"\",\"name\":\"右阀单次水量\",\"typeSpec\":{\"type\":\"value\",\"max\":999999,\"min\":0,\"scale\":1,\"step\":1,\"unit\":\"L\"}},{\"abilityId\":123,\"accessMode\":\"ro\",\"code\":\"water_total_2\",\"description\":\"\",\"name\":\"右阀当日耗水总量\",\"typeSpec\":{\"type\":\"value\",\"max\":999999,\"min\":0,\"scale\":1,\"step\":1,\"unit\":\"L\"}},{\"abilityId\":124,\"accessMode\":\"rw\",\"code\":\"weather_delay_2\",\"description\":\"\",\"name\":\"右阀天气延时\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"cancel\",\"24h\",\"48h\",\"72h\"]}},{\"abilityId\":125,\"accessMode\":\"rw\",\"code\":\"countdown_2\",\"description\":\"\",\"name\":\"右阀灌溉剩余时长\",\"typeSpec\":{\"type\":\"value\",\"max\":86400,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"s\"}},{\"abilityId\":126,\"accessMode\":\"ro\",\"code\":\"work_state_2\",\"description\":\"\",\"name\":\"右阀工作状态\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"auto\",\"manual\",\"idle\",\"delay\"]}},{\"abilityId\":127,\"accessMode\":\"ro\",\"code\":\"use_time_one_2\",\"description\":\"\",\"name\":\"右阀单次使用时间\",\"typeSpec\":{\"type\":\"value\",\"max\":86400,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"s\"}},{\"abilityId\":128,\"accessMode\":\"ro\",\"code\":\"work_mode_2\",\"description\":\"设置右阀工作时是按量灌溉还是按时灌溉,0:按时灌溉  1:按量灌溉\",\"name\":\"右阀工作模式\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"time_irri\",\"flow_irri\"]}},{\"abilityId\":129,\"accessMode\":\"ro\",\"code\":\"next_time_2\",\"description\":\"下次开始时间:开始的月份1个字节,开始的日1个字节,开始的小时1字节,开始的分钟1字节\",\"name\":\"右阀下次开始时间\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},{\"abilityId\":130,\"accessMode\":\"rw\",\"code\":\"flow_countdown_2\",\"description\":\"\",\"name\":\"右阀定时灌溉剩余流量 \",\"typeSpec\":{\"type\":\"value\",\"max\":99999,\"min\":1,\"scale\":0,\"step\":1,\"unit\":\"\"}},{\"abilityId\":131,\"accessMode\":\"ro\",\"code\":\"total_work_time_2\",\"description\":\"\",\"name\":\"右阀按时灌溉总时长\",\"typeSpec\":{\"type\":\"value\",\"max\":604800,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"s\"}},{\"abilityId\":132,\"accessMode\":\"ro\",\"code\":\"total_work_flow_2\",\"description\":\"\",\"name\":\"右阀按量灌溉总量\",\"typeSpec\":{\"type\":\"value\",\"max\":99999,\"min\":0,\"scale\":0,\"step\":1,\"unit\":\"L\"}},{\"abilityId\":133,\"accessMode\":\"ro\",\"code\":\"last_work_time_flow_2\",\"description\":\"前四字节单次使用时间,单位:s \\n后四字节单次使用流量,单位:0.1L\",\"name\":\"右阀单次用水量及使用时间\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}}]}]}"
  },
  "success": true,
  "t": 1716014558558,
  "tid": "d15ae3da14e111ef90338e378115604f"
}

Product ID

r6ya07uz

Information about how the device functions

https://www.amazon.com/Diivoo-Wireless-Sprinkler-Watering-Leakproof/dp/B0CPPFV35T

brokkolo commented 1 month ago

not sure i posted the correct dps mapping, this is what i get from iot.tuya -> "querry properties":

{ "result": { "properties": [ { "code": "switch", "custom_name": "", "dp_id": 1, "time": 1716013133000, "value": false }, { "code": "fault", "custom_name": "", "dp_id": 4, "time": 1715944749000, "value": 0 }, { "code": "water_once", "custom_name": "", "dp_id": 5, "time": 1715937485628, "value": 0 }, { "code": "water_total", "custom_name": "", "dp_id": 6, "time": 1664603774000, "value": 0 }, { "code": "battery_percentage", "custom_name": "", "dp_id": 7, "time": 1716013134000, "value": 100 }, { "code": "weather_delay", "custom_name": "", "dp_id": 10, "time": 1716013135000, "value": "cancel" }, { "code": "countdown", "custom_name": "", "dp_id": 11, "time": 1716013139000, "value": 600 }, { "code": "work_state", "custom_name": "", "dp_id": 12, "time": 1716013138000, "value": "idle" }, { "code": "use_time_one", "custom_name": "", "dp_id": 15, "time": 1715937485628, "value": 0 }, { "code": "cycle_timing", "custom_name": "", "dp_id": 16, "time": 1716013138000, "value": "AA==" }, { "code": "timer", "custom_name": "", "dp_id": 17, "time": 1716013138000, "value": "AQIAAQwpAAoAAAAKAAAAAA==" }, { "code": "no_irrigation_timing", "custom_name": "", "dp_id": 28, "time": 1716011831252 }, { "code": "work_mode_1", "custom_name": "", "dp_id": 101, "time": 1716013140000, "value": "time_irri" }, { "code": "next_time_1", "custom_name": "", "dp_id": 102, "time": 1716011834000, "value": "BRMMKQ==" }, { "code": "flow_countdown_1", "custom_name": "", "dp_id": 103, "time": 1715937485628, "value": 1 }, { "code": "total_work_time_1", "custom_name": "", "dp_id": 104, "time": 1715942493000, "value": 600 }, { "code": "total_work_flow_1", "custom_name": "", "dp_id": 105, "time": 1715937485628, "value": 0 }, { "code": "last_work_time_flow_1", "custom_name": "", "dp_id": 106, "time": 1664603775000, "value": "AAAABAAAAAA=" }, { "code": "flow_unit_set", "custom_name": "", "dp_id": 110, "time": 1716013140000, "value": "L" }, { "code": "temp_unit_set", "custom_name": "", "dp_id": 111, "time": 1716013140000, "value": "C" }, { "code": "water_comsumption_total", "custom_name": "", "dp_id": 112, "time": 1716013139000, "value": 0 }, { "code": "equiment_time", "custom_name": "", "dp_id": 113, "time": 1716012112658, "value": "2024/05/18 08:01" }, { "code": "time_format_set", "custom_name": "", "dp_id": 115, "time": 1716013140000, "value": "24H" }, { "code": "switch_2", "custom_name": "", "dp_id": 121, "time": 1716013133000, "value": false }, { "code": "water_once_2", "custom_name": "", "dp_id": 122, "time": 1715937485628, "value": 0 }, { "code": "water_total_2", "custom_name": "", "dp_id": 123, "time": 1664603780000, "value": 0 }, { "code": "weather_delay_2", "custom_name": "", "dp_id": 124, "time": 1716013139000, "value": "cancel" }, { "code": "countdown_2", "custom_name": "", "dp_id": 125, "time": 1716013139000, "value": 600 }, { "code": "work_state_2", "custom_name": "", "dp_id": 126, "time": 1716013138000, "value": "idle" }, { "code": "use_time_one_2", "custom_name": "", "dp_id": 127, "time": 1715937485628, "value": 0 }, { "code": "work_mode_2", "custom_name": "", "dp_id": 128, "time": 1716013140000, "value": "time_irri" }, { "code": "next_time_2", "custom_name": "", "dp_id": 129, "time": 1716011834000, "value": "BRMMKQ==" }, { "code": "flow_countdown_2", "custom_name": "", "dp_id": 130, "time": 1715937485628, "value": 1 }, { "code": "total_work_time_2", "custom_name": "", "dp_id": 131, "time": 1715942501000, "value": 600 }, { "code": "total_work_flow_2", "custom_name": "", "dp_id": 132, "time": 1715937485628, "value": 0 }, { "code": "last_work_time_flow_2", "custom_name": "", "dp_id": 133, "time": 1664603781000, "value": "AAAAAgAAAAA=" } ] }, "success": true, "t": 1716015114560, "tid": "1ccd8ce414e311ef9a8e62f092a4528b" }

brokkolo commented 1 month ago

the log message in first post is missing some dps, this is what i get when no match is found: 2024-05-22 16:46:05.077 WARNING (MainThread) [custom_components.tuya_local.config_flow] Device matches None with quality of 0%. DPS: {"updated_at": 1716389164.9678242, "1": false, "4": 0, "6": 0, "7": 100, "10": "cancel", "11": 7200, "12": "idle", "101": "time_irri", "104": 7200, "110": "L", "111": "C", "112": 24, "113": "2024/05/21 20:45", "115": "24H", "121": false, "123": 0, "124": "cancel", "125": 600, "126": "idle", "128": "time_irri"}

brokkolo commented 1 month ago

Unfortunately I've returned this irrigation timer as it was choking the pressure in my system, thus I will not be able to test it. :(

jannisan commented 1 month ago

I just created a working yaml-file for the DWV010. It is still very basic with switches for the two valves and battery+water consumption information.

jannisan commented 1 month ago

right valve working mode: 128

zone left:1

right valve next start time : 129

right vlv irrigation residual flow: 130

total irrigation time of right vlv on time: 131

failure to report: 4

right vlv irr amount: 132

water once: 5

single water consumption and usage time of right vlv: 133

total daily water consumption: 6

battery: 7

weather delay: 10

irrigation time: 11

work state: 12

once using time: 15

cycle irrigation: 16

normal timer: 17

no-irrigation duration: 28

left vlv working mode: 101

next start time of left vlv: 102

left vlv quantitative irrigation residual flow: 103

total irrigation time of left vlv on time: 104

the left vlv is used for irrigation: 105

single water consumtion and usage time of left vlv: 106

flow unit selection: 110

temperature unit selection: 111

cumulative water consumtion: 112

current device time: 113

time format selection: 115

zone right: 121

right vlv single water volume: 122

total water consumption of right vlv on the day: 123

right vlv weather delay: 124

remaining irrigation time of right vlv: 125

right vlv working status: 126

right vlv single use time: 127

name: Dual water timer products:

jannisan commented 1 month ago

Just save as diivoo_dwv010.yaml and put into devices folder.

matmat85 commented 3 weeks ago

How did you add it i get key error in Local Tuya

jannisan commented 3 weeks ago

With the diivoo_dwv010.yaml in the tuya-local devices folder when adding a new device via tuya-local the valve is recognised as DWV010 with 8 entities instead of a simple switch.