dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.89k stars 496 forks source link

RTX ZVG1 smart water valve #5248

Closed Beercik closed 2 years ago

Beercik commented 3 years ago

Device

Screenshots

Node info node info

Basic

Basic cluster basic cluster info

Groups

Groups cluster info Groups cluster info

Scenes

Scenes cluster info Scenes cluster info

Other

Tuya specyfic Cluster cluster info Tuya specyfic Cluster cluster info

OTAU cluster info OTAU cluster info

Time cluster info Time cluster info

Beercik commented 2 years ago

hey, finally i can turn it on/off remotely thru Phoscon.

Zrzut ekranu 2021-11-9 o 19 30 43

github-actions[bot] commented 2 years ago

As there has not been any response in 21 days, this issue has been automatically marked as stale. At OP: Please either close this issue or keep it active It will be closed in 7 days if no further activity occurs.

github-actions[bot] commented 2 years ago

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.

GitMouth commented 2 years ago

Hi, I tried to add this tool to Home assistant from DeconZ, anyone could help me ? thank you !

Smanar commented 2 years ago

Need more informations.

GitMouth commented 2 years ago

Need more informations.

  • the model id of your device (see in deconz)
  • if it was included at least in deconz
  • have you try the 2 inclusions without deletion ?

Hi, and thank you for your reply. I think this is this device : SAS980SWT-7-Z01

Smanar commented 2 years ago

Ok, so values are not updated on your capture, so I presume you have too the _TZE200_akjefhj5. From comment it seem the on/off can work using DDF , but you will miss some features https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5248#issuecomment-962144002

And I don't think he have share his DDF, so need to re make one https://github.com/dresden-elektronik/deconz-rest-plugin/issues/5248#issuecomment-945174475

GitMouth commented 2 years ago

Ok, so values are not updated on your capture, so I presume you have too the _TZE200_akjefhj5. From comment it seem the on/off can work using DDF , but you will miss some features #5248 (comment)

And I don't think he have share his DDF, so need to re make one #5248 (comment)

Thank you, thats it, I have too the _TZE200_akjefhj5. I had to remake a DDF, but i have to learn before how to do that. thank again for the path, bye

GitMouth commented 2 years ago

hey, finally i can turn it on/off remotely thru Phoscon.

Zrzut ekranu 2021-11-9 o 19 30 43

Hi Beercik, maybe you can help me for the DDF file ? thank you

Smanar commented 2 years ago

Try to follow the same step than him. The application have changed a little since his capture, but not so much differences.

Tell me where you are stucked.

Beercik commented 2 years ago

Hi Beercik, maybe you can help me for the DDF file ? thank you

Hey, i gave up with deconz for ha. But you can use your dongle with Zigbee2mqtt + Mosquitto in HA. For me works great.

GitMouth commented 2 years ago

Try to follow the same step than him. The application have changed a little since his capture, but not so much differences.

Tell me where you are stucked.

-------------> I'll take a moment to try this, thank you for your answers !

Hi Beercik, maybe you can help me for the DDF file ? thank you

Hey, i gave up with deconz for ha. But you can use your dongle with Zigbee2mqtt + Mosquitto in HA. For me works great.

-------------> One more time, somebody tell me to use Zigbee2mqtt + Mosquitto en HA, I think this is a good solution, but I'll see this later, for the moment I just have time to add elements one by one. With DeconZ it didn't works at all ? I'm looking for switching ON/OFF, and get consumption info. Thanks too

GileanEU commented 2 years ago

So, what's the situation with Deconz and SAS980SWT-7-Z01 at the moment? Is it working with HASS and is it possible to get water consumpiton and turn it on and off via UI? I am thinking of buying one, but only if it works in HA :)

GileanEU commented 2 years ago

Hi there,

I have the following valve and it appears to be a clone of the OP device (exact same cluster info) : Product name: Smart Irrigation,Wifi Water Timer Manufacturer: Saswell Model identifier: SAS980SWT-7-Z01 Product link: https://www.saswell.com/smart-irrigation-wifi-water-timer-sas980swt-7-z01_p147.html

@Smanar, I confirm it is working fine with the DDF, Phoscon and HA can turn it on and off successfully, thank you :)

However I got a couple questions:

  • it shows as a "Fairy light" in Phoscon. Is there a way to make it a switch instead in Phoscon ?
  • The product also features a low-power alarm and a built-in flow meter. In case, I tried to add ZHABattery, ZHAPower and ZHAConsumption in the DDF but to no avail. Is there any way to access those values ?

Thanks for the great work

I ended up buying the device, but I cannot figure out how to add it with Phoscon app. I tried searching for new lights or switch, and then putting the valve in pairing mode but Phoscon didn't find anything. Usually when this happens, it's because the zigbee item you are trying to add (light bulb for example) is factory-paired with something and you need to reset it first. But I am not sure if this is the case with the valve, or with what it could be already paired. How exactly did you managed to find it with Phoscon app?

EDIT: I got it working now! I haven't been using Deconz too much other than seeing my mesh network etc, but I was able to figure out that DDF thing and did just what you did:

When I next time opened Phoscon, there was new light "On/Off output 35" but it was grey/unavailable. So I searched for new lights once again, and it became active. And now I could open and close the valve via Phoscon as well!

In addition to that, it works via Home Assistant as well :) Thanks to this thread, otherwise I couldn't get it working. Now, if there was consumption data available etc, that would be even better! But I guess then it should be added as something else than light entity.

drZlash commented 2 years ago

Hi there, I have the following valve and it appears to be a clone of the OP device (exact same cluster info) : Product name: Smart Irrigation,Wifi Water Timer Manufacturer: Saswell Model identifier: SAS980SWT-7-Z01 Product link: https://www.saswell.com/smart-irrigation-wifi-water-timer-sas980swt-7-z01_p147.html @Smanar, I confirm it is working fine with the DDF, Phoscon and HA can turn it on and off successfully, thank you :) However I got a couple questions:

  • it shows as a "Fairy light" in Phoscon. Is there a way to make it a switch instead in Phoscon ?
  • The product also features a low-power alarm and a built-in flow meter. In case, I tried to add ZHABattery, ZHAPower and ZHAConsumption in the DDF but to no avail. Is there any way to access those values ?

Thanks for the great work

I ended up buying the device, but I cannot figure out how to add it with Phoscon app. I tried searching for new lights or switch, and then putting the valve in pairing mode but Phoscon didn't find anything. Usually when this happens, it's because the zigbee item you are trying to add (light bulb for example) is factory-paired with something and you need to reset it first. But I am not sure if this is the case with the valve, or with what it could be already paired. How exactly did you managed to find it with Phoscon app?

EDIT: I got it working now! I haven't been using Deconz too much other than seeing my mesh network etc, but I was able to figure out that DDF thing and did just what you did:

* Set the Status to "bronze"

* Use drag and drop to add "on/off output" from "available item" to "device"

* Save the DDF

When I next time opened Phoscon, there was new light "On/Off output 35" but it was grey/unavailable. So I searched for new lights once again, and it became active. And now I could open and close the valve via Phoscon as well!

In addition to that, it works via Home Assistant as well :) Thanks to this thread, otherwise I couldn't get it working. Now, if there was consumption data available etc, that would be even better! But I guess then it should be added as something else than light entity.

Hello @GileanEU & Hello to everybody , I just bought this exact same water valve (SAS980SWT-7-Z01), but I haven't managed yet to install it in Phoscon. I tried to implement the different upgrade in the DDF from this thread, but for the moment, here is my status:

Do you know what could be the origin of such anomaly?

Thanks a lot,

GileanEU commented 2 years ago

--> One way communication only

Do you know what could be the origin of such anomaly?

Thanks a lot,

Hello drZlash,

I am not sure why it is working one-way only, it is odd as you can see the light symbol changing when pushing the physical button on the valve so the connection itself works. The valve itself shows as "fairy lights" for me as well, but it also works other way round, meaning that if I switch it on/off from Home Assistant, the valve opens/closes. And if I push that physical button on the valve, my HA switch changes status accordingly.

Have you tried to create a switch in Home Assistant for your valve? In my experience, Phoscon app can be buggy sometimes. So maybe it works when you try from HA.

drZlash commented 2 years ago

Hello @GileanEU , Thanks for your help I tried directly in HA to see the entity linked to the on/off output, and to activate / deactivate it directly. But I have a message saying that the ressource is not available. IMG_20220512_141303

Maybe I should start from scratch. How can I do it the right way, to delete all the modifications of the DDF, remove the "light" and restart?

GileanEU commented 2 years ago

How can I do it the right way, to delete all the modifications of the DDF, remove the "light" and restart? Unfortunately I cannot help you here. For me, all this DDF modification was a new thing and it took me some time to figure it out and get it working, so maybe some others here can help? Still, I can suggest you try to search it again via Phoscon, as initially (when I finally managed to add it to Phoscon) it appeared grey/inactive to me there, but when I searched new lights again (Saswell in pairing mode ofc), it became "active" and then it worked both directions.

Smanar commented 2 years ago

If you use the editor, there is an option in the menu "hot reload", that reload the DDF, but IDK if it delete the previous entry.

If you haven't a REST client, you can check all API entries in phoscon / help / API Information

drZlash commented 2 years ago

Hello, Thanks for your answers I have tried several time to suppress and re-add this device, now it is still availble in phoscon (not in grey but in full black), and in HA, the switch moves as soon as i activate or deactivate the valve manually, but it still doesn't work the other way --> no activation of the valve by clicking on the HA switch.... :(

Smanar commented 2 years ago

And you have an error message too ? Can you shwo the device JSON ? Visible in phoscon / help / API Information / light

If I m right you have started a DDF for this device ?

drZlash commented 2 years ago

Hello, I don't really know what happened, but after searching several time the hardware, and saving the DDF multiple time, the valve finally worked in both directions!! The DDF I did exactly follows what have been proposed before : status update (draft to bronze) and addition of a on/off device. Don't know how to add the water consumption for now, but if anybody finds a way, I would be interested!! Regards,

Smanar commented 2 years ago

status update (draft to bronze)

According to configuration "Bronze" can be ignored, if you want to be sure the DDF is used put "Gold"

For the water consumption, we surely ned to use the tuya cluster, the use of DDF for tuya cluster is still WIP.

GileanEU commented 2 years ago

Not sure why, but this valve seems to go offline either after HA boot and/or HA update. It happened to me few days ago, and I had to pair it again (I saw it still in Phoscon but couldn't use it) by searching new lights. After that, it became active. But today I updated to HA OS version 8.0. and HA Core version 2022.5.5. And after that I noticed that my valve switch was grey again, AND this time the whole light entity for this valve was disappeared from Phoscon! I still saw it via Deconz, but even I tried couple of times searching for new lights and put my valve in pairing mode, it didn't find my "fairy light" again. Very frustrating!

GitMouth commented 2 years ago

Hi, I still cannot control this with deCONZ or phoscon, but I have the power statut (on / off) only...

Smanar commented 2 years ago

I m not able to find the DDF again ^^, you have a link ?

I can probably add measurement, because we can read tuya cluster with DDF now, but I can't write them yet, so I don't think the timer possible, what feature are you searching ?

GitMouth commented 2 years ago

I m not able to find the DDF again ^^, you have a link ?

I can probably add measurement, because we can read tuya cluster with DDF now, but I can't write them yet, so I don't think the timer possible, what feature are you searching ?

I dont see the DDF too.. I'm looking for power on/off, ans measurement if possible...

Smanar commented 2 years ago

Your device use the same DDF than this one https://github.com/dresden-elektronik/deconz-rest-plugin/issues/6143

Try this DDF

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_akjefhj5",
  "modelid": "TS0601",
  "product": "TS0601",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_ON_OFF_OUTPUT",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert",
          "public": false,
          "default": "none"
        },
        {
          "name": "state/on",
          "refresh.interval": 300,
          "read": {
            "fn": "tuya"
          },
          "write": {
            "dpid": 1,
            "dt": "0x10",
            "eval": "Item.val == 1 ? 1 : 0;",
            "fn": "tuya"
          },
          "parse": {
            "dpid": 1,
            "eval": "Item.val = Attr.val;",
            "fn": "tuya"
          }
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_CONSUMPTION_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0702"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/consumption",
          "parse": {"fn": "tuya", "dpid": 5, "eval": "Item.val = Attr.val;"},
          "read": {"fn": "none"}
        },
        {
          "name": "state/lastupdated"
        }
      ]
    },
    {
      "type": "$TYPE_BATTERY_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0001"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/battery",
          "parse": {"fn": "tuya", "dpid": 7, "eval": "Item.val = Attr.val;"},
          "read": {"fn": "none"}
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ]
}
GitMouth commented 2 years ago

Thanks a lot ! I'll try this as soon as possible

WhistleMaster commented 2 years ago

It seems that there is two different versions of this device. I've bought two of them without the consumption function and they have a different manufacturername in Deconz. I've used the following DDF based on the one from @Smanar above and it's works:

{
  "schema": "devcap1.schema.json",
  "manufacturername": "_TZE200_81isopgh",
  "modelid": "TS0601",
  "product": "TS0601",
  "sleeper": false,
  "status": "Gold",
  "subdevices": [
    {
      "type": "$TYPE_SMART_PLUG",
      "restapi": "/lights",
      "uuid": [
        "$address.ext",
        "0x01"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "state/alert",
          "public": false,
          "default": "none"
        },
        {
          "name": "state/on",
          "refresh.interval": 300,
          "read": {
            "fn": "tuya"
          },
          "write": {
            "dpid": 1,
            "dt": "0x10",
            "eval": "Item.val == 1 ? 1 : 0;",
            "fn": "tuya"
          },
          "parse": {
            "dpid": 1,
            "eval": "Item.val = Attr.val;",
            "fn": "tuya"
          }
        },
        {
          "name": "state/reachable"
        }
      ]
    },
    {
      "type": "$TYPE_BATTERY_SENSOR",
      "restapi": "/sensors",
      "uuid": [
        "$address.ext",
        "0x01",
        "0x0001"
      ],
      "items": [
        {
          "name": "attr/id"
        },
        {
          "name": "attr/lastannounced"
        },
        {
          "name": "attr/lastseen"
        },
        {
          "name": "attr/manufacturername"
        },
        {
          "name": "attr/modelid"
        },
        {
          "name": "attr/name"
        },
        {
          "name": "attr/swversion",
          "parse": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001", "script": "tuya_swversion.js"},
          "read": {"fn": "zcl", "ep": 1, "cl": "0x0000", "at": "0x0001"}
        },
        {
          "name": "attr/type"
        },
        {
          "name": "attr/uniqueid"
        },
        {
          "name": "config/on"
        },
        {
          "name": "config/reachable"
        },
        {
          "name": "state/battery",
          "parse": {"fn": "tuya", "dpid": 7, "eval": "Item.val = Attr.val;"},
          "read": {"fn": "none"}
        },
        {
          "name": "state/lastupdated"
        }
      ]
    }
  ]
}

It appears like that in Deconz:

Screenshot 2022-08-05 at 07 54 01
WhistleMaster commented 2 years ago

According to https://www.zigbee2mqtt.io/devices/ZVG1.html, it seems that there are additional values related to the internal timer such as Timer_state, Timer and Timer_time_left.

Is there a way to update that using the API and some POST ?

EDIT: seems that as an example, timer_state has states ['disabled', 'active', 'enabled'] and could be linked to the state ?

Smanar commented 2 years ago

If you want to add it on official DDF you can make like that in the DDF

  "manufacturername": ["_TZE200_81isopgh", "_TZE200_akjefhj5"],
  "modelid": ["TS0601", "TS0601"],

For the moment we can read all value on tuya cluster, but not possible to write all value we want. We can cheat using state/bri (not used yet in this DDF) but will be not clean.