xZetsubou / hass-localtuya

🔹 A Home Assistant integration to handle Tuya devices locally "fork from localtuya"
https://xzetsubou.github.io/hass-localtuya/
GNU General Public License v3.0
366 stars 41 forks source link

Add support for Zigbee Gateway and Sub device Water Valve #143

Closed nunonup closed 6 months ago

nunonup commented 7 months ago

The problem

Please add support for configure Gateway Zigbee and sub device Water Valve

Environment

Steps to reproduce

Try to add device fail

DP dump

Zigbee Gateway: { "result": { "model": "{\"modelId\":\"000004hqz4\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[], \"name\":\"默认服务\",\"properties\":[{ \"abilityId\":101,\"accessMode\":\"ro\",\"code\":\"upward\",\"description\":\"\", \"name\":\"上行通道\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},{ \"abilityId\":102,\"accessMode\":\"wr\",\"code\":\"down\",\"description\":\"\", \"name\":\"下行通道\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}}]}]}" }, "success": true, "t": 1708008690458, "tid": "b4231cdbcc1111ee9d7cfe8b4d072f7e"

Subdevice { "result": { "model": "{\"modelId\":\"000004hgrn\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[], \"name\":\"默认服务\",\"properties\":[{ \"abilityId\":1,\"accessMode\":\"rw\",\"code\":\"switch\",\"description\":\"按时长或按容量\",\"extensions\":{\"iconName\":\"icon-dp_power2\",\"attribute\":\"128\"}, \"name\":\"模式\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}}, {\"abilityId\":2,\"accessMode\":\"rw\",\"code\":\"start\",\"description\":\"启动或停止\",\"extensions\":{\"iconName\":\"icon-dp_play\",\"attribute\":\"1152\"}, \"name\":\"启动\",\"typeSpec\":{\"type\":\"bool\",\"typeDefaultValue\":false}},{ \"abilityId\":101,\"accessMode\":\"rw\",\"code\":\"timestamp1\",\"description\":\"24小时内的时间戳\", \"name\":\"上次灌溉时间\",\"typeSpec\":{\"maxlen\":255,\"type\":\"string\",\"typeDefaultValue\":\"\"}},{ \"abilityId\":102,\"accessMode\":\"rw\",\"code\":\"timestamp2\",\"description\":\"24小时内的时间戳\", \"name\":\"下次灌溉时间\",\"typeSpec\":{\"maxlen\":255,\"type\":\"string\",\"typeDefaultValue\":\"\"}},{ \"abilityId\":103,\"accessMode\":\"rw\",\"code\":\"mode\",\"description\":\"0-99999次,其中0为单次灌溉,其它多次重复灌溉\", \"name\":\"实时灌溉方式(次数)\",\"typeSpec\":{\"max\":99999,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"次\"}},{ \"abilityId\":104,\"accessMode\":\"rw\",\"code\":\"num\",\"description\":\"如按时长则0-86399秒内,如按容量则6500L内(0实际上不允许)\",\"extensions\":{\"attribute\":\"4\",\"trigger\":\"direct\"}, \"name\":\"时长\",\"typeSpec\":{\"max\":86399,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"秒\"}},{ \"abilityId\":105,\"accessMode\":\"rw\",\"code\":\"interval\",\"description\":\"0-86399秒,即24小时内(0实际上不允许)\", \"name\":\"实时灌溉间隔(秒)\",\"typeSpec\":{\"max\":86399,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"秒\"}},{ \"abilityId\":106,\"accessMode\":\"rw\",\"code\":\"temp\",\"description\":\"数值范围: -50-100,单位: 摄氏度\", \"name\":\"当前温度(摄氏度)\",\"typeSpec\":{\"max\":100,\"min\":-50,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":-50,\"unit\":\"摄氏度\"}},{ \"abilityId\":107,\"accessMode\":\"rw\",\"code\":\"smart_weather\",\"description\":\"枚举值: sunny, cloudy, rainy, snowy, other\", \"name\":\"当前天气\",\"typeSpec\":{\"range\":[\"sunny\",\"cloudy\",\"rainy\",\"snowy\",\"other\"],\"type\":\"enum\",\"typeDefaultValue\":\"sunny\"}},{ \"abilityId\":108,\"accessMode\":\"rw\",\"code\":\"battery\",\"description\":\"数值范围: 0-100,单位: %\", \"name\":\"当前电量(%)\",\"typeSpec\":{\"max\":100,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"%\"}},{ \"abilityId\":109,\"accessMode\":\"rw\",\"code\":\"cyc_irriga_param\",\"description\":\"设置循环灌溉参数:模式(1byte),时长/容量(hour/min/sec 6byte),灌溉次数(1byte),间隔时长(时长(hour/min/sec 6byte)。\",\"extensions\":{\"trigger\":\"direct\"}, \"name\":\"循环灌溉参数\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},{ \"abilityId\":110,\"accessMode\":\"rw\",\"code\":\"counter1\",\"description\":\"数值范围: 0-86399, 单位: 秒\",\"extensions\":{\"trigger\":\"direct\"}, \"name\":\"实时累计时长(秒)\",\"typeSpec\":{\"max\":86399,\"min\":0,\"scale\":1,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"秒\"}},{ \"abilityId\":111,\"accessMode\":\"rw\",\"code\":\"counter2\",\"description\":\"数值范围: 0-99999, 单位: 升\",\"extensions\":{\"trigger\":\"direct\"}, \"name\":\"实时累计水量(升)\",\"typeSpec\":{\"max\":99999,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"升\"}},{ \"abilityId\":112,\"accessMode\":\"rw\",\"code\":\"other\",\"description\":\"备用\", \"name\":\"其它扩展\",\"typeSpec\":{\"maxlen\":255,\"type\":\"string\",\"typeDefaultValue\":\"\"}},{ \"abilityId\":113,\"accessMode\":\"rw\",\"code\":\"timer_custom\",\"description\":\"\",\"extensions\":{\"trigger\":\"direct\"}, \"name\":\"定时功能\",\"typeSpec\":{\"maxlen\":128,\"type\":\"raw\"}},{ \"abilityId\":114,\"accessMode\":\"rw\",\"code\":\"counter_custom\",\"description\":\"\",\"extensions\":{\"trigger\":\"direct\"}, \"name\":\"统计功能\",\"typeSpec\":{\"maxlen\":255,\"type\":\"string\",\"typeDefaultValue\":\"\"}},{ \"abilityId\":115,\"accessMode\":\"rw\",\"code\":\"time_zone\",\"description\":\"时区设置选择\", \"name\":\"时区\",\"typeSpec\":{\"max\":23,\"min\":0,\"scale\":0,\"step\":1,\"type\":\"value\",\"typeDefaultValue\":0,\"unit\":\"z\"}}]}]}" }, "success": true, "t": 1708009286196, "tid": "172a5f84cc1311eea1957edaaa357452" }

Provide Home Assistant traceback/logs

2024-02-15 15:16:12.989 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...xes] Failed to get status: DeviceID Not found Traceback (most recent call last): File "/config/custom_components/localtuya/core/pytuya/init.py", line 1199, in _decode_payload json_payload = json.loads(payload) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/localtuya/core/pytuya/init.py", line 1105, in detect_available_dps data = await self.status(cid=cid) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/core/pytuya/init.py", line 1024, in status status: dict = await self.exchange(command=DP_QUERY, nodeID=cid) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/core/pytuya/init.py", line 1009, in exchange payload = self._decode_payload(msg.payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/core/pytuya/init.py", line 1202, in _decode_payload raise ValueError("DeviceID Not found") ValueError: DeviceID Not found 2024-02-15 15:16:48.497 ERROR (MainThread) [custom_components.localtuya.core.pytuya] [bf5...xes] Failed to get status: DeviceID Not found Traceback (most recent call last): File "/config/custom_components/localtuya/core/pytuya/init.py", line 1199, in _decode_payload json_payload = json.loads(payload) ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/init.py", line 346, in loads return _default_decoder.decode(s) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 337, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/json/decoder.py", line 355, in raw_decode raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/config/custom_components/localtuya/core/pytuya/init.py", line 1105, in detect_available_dps data = await self.status(cid=cid) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/core/pytuya/init.py", line 1024, in status status: dict = await self.exchange(command=DP_QUERY, nodeID=cid) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/core/pytuya/init.py", line 1009, in exchange payload = self._decode_payload(msg.payload) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/localtuya/core/pytuya/init.py", line 1202, in _decode_payload raise ValueError("DeviceID Not found") ValueError: DeviceID Not found

Additional information

I try to add putting device ID directly of subdevice and with gatewat device id and subdevice option

nunonup commented 7 months ago

Zigbee Gateway product ID: plp0gnfcacdeqk5o

Water Valve productID: a7sghmms

xZetsubou commented 7 months ago

I think you are adding the device incorrectly, how do you add the device step by step? The gateway isn't necessary needed, in order to add the sub-devices, The Device ID is for the sub device ID not the Device ID of gateway. check entry diagnostics detect the issue. The sub-device should've auto discovered with the correct fields but I think you have your device in different sub-net? However if you added them manually ensure the you insert Device ID and Node ID correctly

nunonup commented 6 months ago

When I discovered devices Gateway appear but no subdevices are discovered. I try do add subdevice with its Id and local key (the same for gatway or subdevices) but all DPs are show as -1 - the same with DPs for gateway.

The device and home assistante are on same subnet.

I send you diagnosics in attachment.

Integration diagnostics: config_entry-localtuya-8f49530d14a51329c1c24dfae1e0a0b0 (2).json

Device diagnostics (GW): localtuya-8f49530d14a51329c1c24dfae1e0a0b0-GW-91a722646303c583297bd27daace3050.json

xZetsubou commented 6 months ago

Surprisely there is no cloud data at all in your diagnostics so I'm not really sure, maybe check the logs and search for "localtuya" and see if there is an errors I wonder if your Tuya IoT subscription is expired! tho it should shows in the logs if it does. Like I mentioned you haven't added a node id in order to add the sub-device

What you are trying to configure is the gateway it self not the sub-device which is wrong,

ADDING SUB DEVICE: The gateway isn't meant to add into localtuya to use your sub-devices however since the cloud for some reason doesn't works for you then you will need to get the node id and device id from Tuya IoT manually the, sub-devices are only sharing the "IP and localkey" with the gateway so you will need to insert the "node ID" for the sub-device you want to add e.g. my ZigBee switch. again this should've been automatically discovered if your cloud is working correctly!, Does this also includes the fact that you also pulled the localkey for the gateway manually?

toposilva commented 6 months ago

Hi. I can anwser because I'm helping @nunonup configuring this. We'll try to configure manually device as you post. DeviceID is the the device not gateway right? NodeID I hope its possible retrieve from TuyaIOT. The IoTTuya isn't expired.

We'll try and give you feedback

xZetsubou commented 6 months ago

If the IoT Tuya isn't expired then there is something wrong it should've pulled devices data if nothing goes wrong.

DeviceID is the the device not gateway right?

Yes Sub-Devices has it own Device ID and also Has Node ID it may also known as uuid some times.

toposilva commented 6 months ago

Hi again. We've tried manually configure subdevice with some success. We can put manually DPs and is possible to configure, but it's hard to us make correct configuration for every DP. We send you device diagnostics. localtuya-8f49530d14a51329c1c24dfae1e0a0b0-Down-763cad4d04e9b00a86ae86c2afa4bdad.json

Can you please help manually configure DPs based on device DPs { "result": { "model": "{"modelId":"000004hgrn","services":[{"actions":[],"code":"","description":"","events":[], "name":"默认服务","properties":[{ "abilityId":1,"accessMode":"rw","code":"switch","description":"按时长或按容量","extensions":{"iconName":"icon-dp_power2","attribute":"128"}, "name":"模式","typeSpec":{"type":"bool","typeDefaultValue":false}}, {"abilityId":2,"accessMode":"rw","code":"start","description":"启动或停止","extensions":{"iconName":"icon-dp_play","attribute":"1152"}, "name":"启动","typeSpec":{"type":"bool","typeDefaultValue":false}},{ "abilityId":101,"accessMode":"rw","code":"timestamp1","description":"24小时内的时间戳", "name":"上次灌溉时间","typeSpec":{"maxlen":255,"type":"string","typeDefaultValue":""}},{ "abilityId":102,"accessMode":"rw","code":"timestamp2","description":"24小时内的时间戳", "name":"下次灌溉时间","typeSpec":{"maxlen":255,"type":"string","typeDefaultValue":""}},{ "abilityId":103,"accessMode":"rw","code":"mode","description":"0-99999次,其中0为单次灌溉,其它多次重复灌溉", "name":"实时灌溉方式(次数)","typeSpec":{"max":99999,"min":0,"scale":0,"step":1,"type":"value","typeDefaultValue":0,"unit":"次"}},{ "abilityId":104,"accessMode":"rw","code":"num","description":"如按时长则0-86399秒内,如按容量则6500L内(0实际上不允许)","extensions":{"attribute":"4","trigger":"direct"}, "name":"时长","typeSpec":{"max":86399,"min":0,"scale":0,"step":1,"type":"value","typeDefaultValue":0,"unit":"秒"}},{ "abilityId":105,"accessMode":"rw","code":"interval","description":"0-86399秒,即24小时内(0实际上不允许)", "name":"实时灌溉间隔(秒)","typeSpec":{"max":86399,"min":0,"scale":0,"step":1,"type":"value","typeDefaultValue":0,"unit":"秒"}},{ "abilityId":106,"accessMode":"rw","code":"temp","description":"数值范围: -50-100,单位: 摄氏度", "name":"当前温度(摄氏度)","typeSpec":{"max":100,"min":-50,"scale":0,"step":1,"type":"value","typeDefaultValue":-50,"unit":"摄氏度"}},{ "abilityId":107,"accessMode":"rw","code":"smart_weather","description":"枚举值: sunny, cloudy, rainy, snowy, other", "name":"当前天气","typeSpec":{"range":["sunny","cloudy","rainy","snowy","other"],"type":"enum","typeDefaultValue":"sunny"}},{ "abilityId":108,"accessMode":"rw","code":"battery","description":"数值范围: 0-100,单位: %", "name":"当前电量(%)","typeSpec":{"max":100,"min":0,"scale":0,"step":1,"type":"value","typeDefaultValue":0,"unit":"%"}},{ "abilityId":109,"accessMode":"rw","code":"cyc_irriga_param","description":"设置循环灌溉参数:模式(1byte),时长/容量(hour/min/sec 6byte),灌溉次数(1byte),间隔时长(时长(hour/min/sec 6byte)。","extensions":{"trigger":"direct"}, "name":"循环灌溉参数","typeSpec":{"maxlen":128,"type":"raw"}},{ "abilityId":110,"accessMode":"rw","code":"counter1","description":"数值范围: 0-86399, 单位: 秒","extensions":{"trigger":"direct"}, "name":"实时累计时长(秒)","typeSpec":{"max":86399,"min":0,"scale":1,"step":1,"type":"value","typeDefaultValue":0,"unit":"秒"}},{ "abilityId":111,"accessMode":"rw","code":"counter2","description":"数值范围: 0-99999, 单位: 升","extensions":{"trigger":"direct"}, "name":"实时累计水量(升)","typeSpec":{"max":99999,"min":0,"scale":0,"step":1,"type":"value","typeDefaultValue":0,"unit":"升"}},{ "abilityId":112,"accessMode":"rw","code":"other","description":"备用", "name":"其它扩展","typeSpec":{"maxlen":255,"type":"string","typeDefaultValue":""}},{ "abilityId":113,"accessMode":"rw","code":"timer_custom","description":"","extensions":{"trigger":"direct"}, "name":"定时功能","typeSpec":{"maxlen":128,"type":"raw"}},{ "abilityId":114,"accessMode":"rw","code":"counter_custom","description":"","extensions":{"trigger":"direct"}, "name":"统计功能","typeSpec":{"maxlen":255,"type":"string","typeDefaultValue":""}},{ "abilityId":115,"accessMode":"rw","code":"time_zone","description":"时区设置选择", "name":"时区","typeSpec":{"max":23,"min":0,"scale":0,"step":1,"type":"value","typeDefaultValue":0,"unit":"z"}}]}]}" }, "success": true, "t": 1708009286196, "tid": "172a5f84cc1311eea1957edaaa357452" }

xZetsubou commented 6 months ago

I don't think you added the device correctly, You shouldn't add the DPS manually if it didn't detect automatically them then there is something incorrectly!, however I can't help very much here in order to

  1. Where did you get the device information from e.g. Node-ID? It should be like this

  2. ensure when you add the device that you don't insert any manual DPS unless there are missing ones that LocalTuya can't detect them.

  3. Ensure the device isn't used in different local integration!, ensure the smart life or Tuya app is closed when you add it.

  4. is the cloud expired that it couldn't pull them automatically?

toposilva commented 6 months ago
  1. Yes, the NodeID was retrieved from that option.
  2. If we add device with none DP only 3 DPs appear
  3. Ok, device in other local integration is possible.. we'll check it
  4. Cloud is not expired... But we could completely remove integrations and add it again

Our problem right now is only dificult to know identify DPs classes and types 😂

xZetsubou commented 6 months ago

Yes, the NodeID was retrieved from that option.

Can you share the results for the IoT. it may help more.

Cloud is not expired... But we could completely remove integrations and add it again

That is weird, go to HA -> LocalTuya page -> Configure -> Reconfigure Cloud API Account. make sure everything is setup correctly then submit ensure there is no errors in logs after you submit.

toposilva commented 6 months ago

Right. Tomorow morning I'll share it

toposilva commented 6 months ago

CloudAPIAccount is OK. By now device already detects all DPs but still no auto configure...

So device support it's not solved... but we've configured all manually to our needs

xZetsubou commented 6 months ago

If that the cloud fixed, now post the entry diagnostics https://github.com/xZetsubou/hass-localtuya/issues/143#issuecomment-1947522173

nunonup commented 6 months ago

localtuya-cee95b5ef30da363cbd6d6f560a937c7-Down Water Valve-91a722646303c583297bd27daace3050.json

xZetsubou commented 6 months ago

I still can't see the cloud object, there is no data about the DPS there. However it seems you made progress in configuring the device. This a formatter results of your device DPS DATA however I can't do much here since the cloud doesn't works like it should. each block has abilityId is the numbers and values that you see when you choose the DPID, and the data can be used for the DPID

{
   "result":{
      "model":{
               "name":"默认服务",
               "properties":[
                  {
                     "abilityId":1,
                     "accessMode":"rw",
                     "code":"switch",
                     "description":"按时长或按容量",
                     "extensions":{
                        "iconName":"icon-dp_power2",
                        "attribute":"128"
                     },
                     "name":"模式",
                     "typeSpec":{
                        "type":"bool",
                        "typeDefaultValue":false
                     }
                  },
                  {
                     "abilityId":2,
                     "accessMode":"rw",
                     "code":"start",
                     "description":"启动或停止",
                     "extensions":{
                        "iconName":"icon-dp_play",
                        "attribute":"1152"
                     },
                     "name":"启动",
                     "typeSpec":{
                        "type":"bool",
                        "typeDefaultValue":false
                     }
                  },
                  {
                     "abilityId":101,
                     "accessMode":"rw",
                     "code":"timestamp1",
                     "description":"24小时内的时间戳",
                     "name":"上次灌溉时间",
                     "typeSpec":{
                        "maxlen":255,
                        "type":"string",
                        "typeDefaultValue":""
                     }
                  },
                  {
                     "abilityId":102,
                     "accessMode":"rw",
                     "code":"timestamp2",
                     "description":"24小时内的时间戳",
                     "name":"下次灌溉时间",
                     "typeSpec":{
                        "maxlen":255,
                        "type":"string",
                        "typeDefaultValue":""
                     }
                  },
                  {
                     "abilityId":103,
                     "accessMode":"rw",
                     "code":"mode",
                     "description":"0-99999次,其中0为单次灌溉,其它多次重复灌溉",
                     "name":"实时灌溉方式(次数)",
                     "typeSpec":{
                        "max":99999,
                        "min":0,
                        "scale":0,
                        "step":1,
                        "type":"value",
                        "typeDefaultValue":0,
                        "unit":"次"
                     }
                  },
                  {
                     "abilityId":104,
                     "accessMode":"rw",
                     "code":"num",
                     "description":"如按时长则0-86399秒内,如按容量则6500L内(0实际上不允许)",
                     "extensions":{
                        "attribute":"4",
                        "trigger":"direct"
                     },
                     "name":"时长",
                     "typeSpec":{
                        "max":86399,
                        "min":0,
                        "scale":0,
                        "step":1,
                        "type":"value",
                        "typeDefaultValue":0,
                        "unit":"秒"
                     }
                  },
                  {
                     "abilityId":105,
                     "accessMode":"rw",
                     "code":"interval",
                     "description":"0-86399秒,即24小时内(0实际上不允许)",
                     "name":"实时灌溉间隔(秒)",
                     "typeSpec":{
                        "max":86399,
                        "min":0,
                        "scale":0,
                        "step":1,
                        "type":"value",
                        "typeDefaultValue":0,
                        "unit":"秒"
                     }
                  },
                  {
                     "abilityId":106,
                     "accessMode":"rw",
                     "code":"temp",
                     "description":"数值范围: -50-100,单位: 摄氏度",
                     "name":"当前温度(摄氏度)",
                     "typeSpec":{
                        "max":100,
                        "min":-50,
                        "scale":0,
                        "step":1,
                        "type":"value",
                        "typeDefaultValue":-50,
                        "unit":"摄氏度"
                     }
                  },
                  {
                     "abilityId":107,
                     "accessMode":"rw",
                     "code":"smart_weather",
                     "description":"枚举值: sunny, cloudy, rainy, snowy, other",
                     "name":"当前天气",
                     "typeSpec":{
                        "range":[
                           "sunny",
                           "cloudy",
                           "rainy",
                           "snowy",
                           "other"
                        ],
                        "type":"enum",
                        "typeDefaultValue":"sunny"
                     }
                  },
                  {
                     "abilityId":108,
                     "accessMode":"rw",
                     "code":"battery",
                     "description":"数值范围: 0-100,单位: %",
                     "name":"当前电量(%)",
                     "typeSpec":{
                        "max":100,
                        "min":0,
                        "scale":0,
                        "step":1,
                        "type":"value",
                        "typeDefaultValue":0,
                        "unit":"%"
                     }
                  },
                  {
                     "abilityId":109,
                     "accessMode":"rw",
                     "code":"cyc_irriga_param",
                     "description":"设置循环灌溉参数:模式(1byte),时长/容量(hour/min/sec 6byte),灌溉次数(1byte),间隔时长(时长(hour/min/sec 6byte)。",
                     "extensions":{
                        "trigger":"direct"
                     },
                     "name":"循环灌溉参数",
                     "typeSpec":{
                        "maxlen":128,
                        "type":"raw"
                     }
                  },
                  {
                     "abilityId":110,
                     "accessMode":"rw",
                     "code":"counter1",
                     "description":"数值范围: 0-86399, 单位: 秒",
                     "extensions":{
                        "trigger":"direct"
                     },
                     "name":"实时累计时长(秒)",
                     "typeSpec":{
                        "max":86399,
                        "min":0,
                        "scale":1,
                        "step":1,
                        "type":"value",
                        "typeDefaultValue":0,
                        "unit":"秒"
                     }
                  },
                  {
                     "abilityId":111,
                     "accessMode":"rw",
                     "code":"counter2",
                     "description":"数值范围: 0-99999, 单位: 升",
                     "extensions":{
                        "trigger":"direct"
                     },
                     "name":"实时累计水量(升)",
                     "typeSpec":{
                        "max":99999,
                        "min":0,
                        "scale":0,
                        "step":1,
                        "type":"value",
                        "typeDefaultValue":0,
                        "unit":"升"
                     }
                  },
                  {
                     "abilityId":112,
                     "accessMode":"rw",
                     "code":"other",
                     "description":"备用",
                     "name":"其它扩展",
                     "typeSpec":{
                        "maxlen":255,
                        "type":"string",
                        "typeDefaultValue":""
                     }
                  },
                  {
                     "abilityId":113,
                     "accessMode":"rw",
                     "code":"timer_custom",
                     "description":"",
                     "extensions":{
                        "trigger":"direct"
                     },
                     "name":"定时功能",
                     "typeSpec":{
                        "maxlen":128,
                        "type":"raw"
                     }
                  },
                  {
                     "abilityId":114,
                     "accessMode":"rw",
                     "code":"counter_custom",
                     "description":"",
                     "extensions":{
                        "trigger":"direct"
                     },
                     "name":"统计功能",
                     "typeSpec":{
                        "maxlen":255,
                        "type":"string",
                        "typeDefaultValue":""
                     }
                  },
                  {
                     "abilityId":115,
                     "accessMode":"rw",
                     "code":"time_zone",
                     "description":"时区设置选择",
                     "name":"时区",
                     "typeSpec":{
                        "max":23,
                        "min":0,
                        "scale":0,
                        "step":1,
                        "type":"value",
                        "typeDefaultValue":0,
                        "unit":"z"
                     }
                  }
               ]
            }
         ]
      }
   },
}
xZetsubou commented 6 months ago

NOTE: Since this isn't a bug I will close it as it not an issue, still even if this closed in-case you still needs help to setup the device you can comment here.

nunonup commented 1 month ago

Hi! This is working fine, but now I have two water valves connected to the same Zigbee gateway, and I tried to add the new one to HA, but insted of create a new device and new entities, it replaces the existing ones... Isn't possible to control more than one similar device?

xZetsubou commented 4 weeks ago

Hi! This is working fine, but now I have two water valves connected to the same Zigbee gateway, and I tried to add the new one to HA, but insted of create a new device and new entities, it replaces the existing ones... Isn't possible to control more than one similar device?

It shouldn't replace the old one ensure the each sub-device has it's own device ID don't use the gateway device ID for all sub-devices...

nunonup commented 3 weeks ago

Thank you! Working just fine! I was using the gateway id...