[RELEASE] Tuya Zigbee Valve driver (w/ healthStatus)

Not a problem. No, no complex timers or anything. I have IP cameras and a softspot for local wildlife so I got tired of seeing neighborhood cats constantly merking local wildlife on my property. Instead of doing something that could be harmful to the cats, they are cats, doing what cats do, I just don't want them doing it on my property and decided to provide a safe environment for wildlife. So I wrote an AI application to detect cats and, if one is found, spray them with sprinklers.

It started out in the garden because cats would get in there and use it as a litter box, but worked so well that I use it around my entire property. Only issue is that it takes a good 5-10 seconds for Orbit to actually get the command to turn on. Cutting that time is highly desireable and, hopefully, Zigbee or ZWave is the right answer. So, I just need on and then off after about 15 seconds.

1 Like

I got the valve this morning and paired it up and used the above Tuya Zigbee Valve driver for it. Here is the "Data" for it:

  • endpointId: 01
  • model: TS0601
  • application: 46
  • manufacturer: _TZE200_sh1btabb

Here is what we get in the logs when "Configure" is clicked:

dev:18512022-08-14 09:47:36.896 am infoReceived bind response, data=[98, 82] (Sequence Number:98, Status: Failure)

dev:18512022-08-14 09:47:36.893 am debugDesc Map: [raw:catchall: 0000 8021 00 00 0040 00 D9D8 00 00 0000 00 00 9882, profileId:0000, clusterId:8021, clusterInt:32801, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:D9D8, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[98, 82]]

dev:18512022-08-14 09:47:36.887 am debugdescription is catchall: 0000 8021 00 00 0040 00 D9D8 00 00 0000 00 00 9882

dev:18512022-08-14 09:47:36.676 am debug other Tuya oddities - don't know how to handle it, skipping it for now...

dev:18512022-08-14 09:47:36.673 am debugdescription is read attr - raw: D9D801000068040042105F545A453230305F73683162746162620000002003010000204605000042065453303630310700003003FEFF003000, dni: D9D8, endpoint: 01, cluster: 0000, size: 68, attrId: 0004, encoding: 42, command: 01, value: 105F545A453230305F73683162746162620000002003010000204605000042065453303630310700003003FEFF003000

dev:18512022-08-14 09:47:36.597 am debug other Tuya oddities - don't know how to handle it, skipping it for now...

dev:18512022-08-14 09:47:36.594 am debugdescription is read attr - raw: D9D801000068040042105F545A453230305F73683162746162620000002003010000204605000042065453303630310700003003FEFF003000, dni: D9D8, endpoint: 01, cluster: 0000, size: 68, attrId: 0004, encoding: 42, command: 01, value: 105F545A453230305F73683162746162620000002003010000204605000042065453303630310700003003FEFF003000

dev:18512022-08-14 09:47:33.010 am traceSprinkler sendZigbeeCommands received : [he raw 0xD9D8 1 0x01 0x0000 {10 00 00 04 00 00 00 01 00 05 00 07 00 FE FF}, delay 200, he rattr 0xD9D8 0x01 6 0 {}, delay 2000, zdo bind 0xD9D8 0x01 0x01 6 {A4C1387D2FED42E8} {}, delay 2000, he cr 0xD9D8 0x01 6 0 16 0 600 {}, delay 2000]

dev:18512022-08-14 09:47:32.991 am traceSprinkler polling..

dev:18512022-08-14 09:47:32.989 am debugSprinkler sending refresh() command...

dev:18512022-08-14 09:47:32.986 am info configure()..

Here is what comes in the logs when "Open" is clicked:

dev:18512022-08-14 09:49:17.342 am warnUnprocessed global command: cluster=EF00 command=02 attrId=null value=null data=[00, 0F, 01, 01, 00, 01, 01]

dev:18512022-08-14 09:49:17.340 am debugDesc Map: [raw:catchall: 0104 EF00 01 01 0040 00 D9D8 01 00 0000 02 01 000F0101000101, profileId:0104, clusterId:EF00, clusterInt:61184, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:D9D8, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:02, direction:01, data:[00, 0F, 01, 01, 00, 01, 01]]

dev:18512022-08-14 09:49:17.334 am debugdescription is catchall: 0104 EF00 01 01 0040 00 D9D8 01 00 0000 02 01 000F0101000101

dev:18512022-08-14 09:49:17.221 am debugDesc Map: [raw:catchall: 0104 EF00 01 01 0040 00 D9D8 00 00 0000 0B 01 0000, profileId:0104, clusterId:EF00, clusterInt:61184, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:D9D8, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:0B, direction:01, data:[00, 00]]

dev:18512022-08-14 09:49:17.216 am debugdescription is catchall: 0104 EF00 01 01 0040 00 D9D8 00 00 0000 0B 01 0000

dev:18512022-08-14 09:49:13.951 am debugSprinkler opening

Here is what comes in the logs when "Close" is clicked:

dev:18512022-08-14 09:49:53.478 am warnUnprocessed global command: cluster=EF00 command=02 attrId=null value=null data=[00, 11, 6C, 02, 00, 04, 00, 00, 00, 64]

dev:18512022-08-14 09:49:53.474 am debugDesc Map: [raw:catchall: 0104 EF00 01 01 0040 00 D9D8 01 00 0000 02 01 00116C02000400000064, profileId:0104, clusterId:EF00, clusterInt:61184, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:D9D8, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:02, direction:01, data:[00, 11, 6C, 02, 00, 04, 00, 00, 00, 64]]

dev:18512022-08-14 09:49:53.468 am debugdescription is catchall: 0104 EF00 01 01 0040 00 D9D8 01 00 0000 02 01 00116C02000400000064

dev:18512022-08-14 09:49:52.686 am warnUnprocessed global command: cluster=EF00 command=02 attrId=null value=null data=[00, 10, 01, 01, 00, 01, 00]

dev:18512022-08-14 09:49:52.683 am debugDesc Map: [raw:catchall: 0104 EF00 01 01 0040 00 D9D8 01 00 0000 02 01 00100101000100, profileId:0104, clusterId:EF00, clusterInt:61184, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:D9D8, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:02, direction:01, data:[00, 10, 01, 01, 00, 01, 00]]

dev:18512022-08-14 09:49:52.678 am debugdescription is catchall: 0104 EF00 01 01 0040 00 D9D8 01 00 0000 02 01 00100101000100

dev:18512022-08-14 09:49:52.567 am debugDesc Map: [raw:catchall: 0104 EF00 01 01 0040 00 D9D8 00 00 0000 0B 01 0000, profileId:0104, clusterId:EF00, clusterInt:61184, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:D9D8, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:0B, direction:01, data:[00, 00]]

dev:18512022-08-14 09:49:52.562 am debugdescription is catchall: 0104 EF00 01 01 0040 00 D9D8 00 00 0000 0B 01 0000

dev:18512022-08-14 09:49:49.945 am debugSprinkler closing

If possible, it would be cool to get the battery level, as well, to know how low it is getting before the device just dies without my knowing but I can think of ways around that if not possible.

Let me know what more is needed.

1 Like

@clintonathomas1979 thank you for the tests yesterday!
I have now put the working version 1.0.2 in HPM.

| ZIGBEE Sprinkler / Water Irrigation Valve
image | Amazon : (link) |

3 Likes

You are very welcome! Thank you so much for getting it all together! I have been waiting for a Zigbee valve for quite a long time!!

1 Like

Here's an option to your cat problem.

This valve open/closes in about 1 second and is 110v AC mains powered so your could simply attach a power cord to it and plug it into a HE compatible smart switch.

https://www.amazon.com/Electric-Solenoid-Normally-Closed-diesel/dp/B007N0J98E

Thanks for the suggestion. I have seen that around the forums a lot and almost pulled the trigger but, for me, electric and water (weather or leaky valve) was something I was never comfortable with and seemed more trouble than it was worth to run electricity where I would be comfortable with the setup. The Orbit valves suited my needs well, just was slow and gave the cats a good ten seconds. Thankfully, the zigbee valve suits my needs extremely well and only gives them a second from detection so far with my tests.

1 Like

What about this:

  • endpointId: F2
  • application:
  • driver: v1.0.1.1123
  • endpointId: F2
  • profileId: A1E0
  • inClusters:
  • outClusters: 0021
  • model: null
  • manufacturer:

I have not found working driver for this.

That pairing does not look complete. No inClusters. I suggest factory resetting the device, deleting it from Hubitat, and pairing it much closer to Hubitat so it pairs properly.

1 Like

Delete the device from the HE and pair it again as a new device, close to the hub.
When discovered and prompted to set a label, you will see a hyperlink named 'more info'. Click on this link and copy/paste here all the information that is in the popup window.

1 Like

Now even manufacturer

Manufacturer: _TZ3000_iedbgyxt
Endpoint 01 application: 52
Endpoint 01 endpointId: 01
Endpoint 01 idAsInt: 1
Endpoint 01 inClusters: 0003,0004,0005,0006,E000,E001,0000
Endpoint 01 initialized: true
Endpoint 01 manufacturer: _TZ3000_iedbgyxt
Endpoint 01 model: TS0001
Endpoint 01 outClusters: 0019,000A
Endpoint 01 profileId: 0104
Endpoint 01 stage: 4
Endpoint F2 endpointId: F2
Endpoint F2 idAsInt: 242
Endpoint F2 initialized: true
Endpoint F2 outClusters: 0021
Endpoint F2 profileId: A1E0
Endpoint F2 stage: 4
1 Like

Now the valve seems successfully paired to HE. Let us know if this driver works OK.

Paired it to another hub at home and it works. Perfect ! I guess I have to clean drivers on the other hub at holiday home and it will work on that too.

1 Like

Is "power on" behavior setting possible to add? By default it closes the valve. Better would be "same as before" power cut.

1 Like

Hi,

Firstly, thank you for writing this driver! I’m having success using it with a “Tuya ZigBee Smart Valve Controller” from AliExpress, if anyone finds this useful.

Seems pretty reliable, so far.

Quick question: is there a way to control what it does after losing power? Currently, they default to closed. I have a setup where two valves govern which water tank to use: I have virtual buttons that swap, with a 5s delay. The closed valve opens, and only once nearly open does the other valve close, so there’s never a shut off supply.

However… After power loss, the closed valve stays closed and the open valve closes! So no water until I intervene.

It would be better, or at least a better fail safe, if both were open after a power loss. Any way to do this? Ideally, they would stay at the same state as prior to power off.

I guess I could write a rule to check status periodically and open one if both are closed or something? But it seems inelegant.

Thank you!

1 Like

I will update the driver in the next week, hopefully, the 'power-on-behavior ' configuration is the same as for the Tuya/Moes wall switches.

I have pushed an update via HPM to version 1.0.4

image

1 Like

Amazing. Thank you. I have updated all and it seems to have done the trick!

Notes if someone in the future is getting stuck (maybe future me!): it didn’t work straight away. I had to change the setting, save, activate valve, change back, then it worked.

Outstanding service, @kkossev , I salute you!

2 Likes

First, kkossev, thank you so much for all the work put into this driver, and thanks to the rest of the community I see from the thread history that have assisted with getting it to such a great state!

It appears yet another valve, a very cheap one, has appeared on Amazon:
https://www.amazon.com/dp/B09WDJQ7KR?psc=1&ref=ppx_yo2ov_dt_b_product_details

Good News: the driver works with this one! I can easily shut it on and off. Pairing with Hubitat isn't a problem at all.

The one feature I'm looking for though concerns, is there a place for a battery reading? I see it shows the power source as "dc", but it is running off of two AA batteries. It seems the device does give some form of low battery warning when using the Tuya app with Alexa, so I'm assuming the device reports the battery reading somewhere.

The only other issue I see is...well, open to advice on this, but it's not anything (I think) the driver can solve. It appears the device is designed such that it opens the valve for only up to 15 minutes at a time. I'm assuming it's not a matter of "open valve requires power", but that's why I am interested in checking the battery level. I could see writing some rules to refresh and continually keep the valve open, but if battery drain is an issue, it could invalidate my use case.

And, that brings us to the use case. I'm not in a particularly cold-climate, but when it does get below freezing, it's a generally good idea to drip outdoor faucets. At the same time, my home's faucets are a pain to get to. They really aren't used for anything BUT frozen water line prevention. I was hoping to set one of these valves on each and, other than maintain batteries (hopefully with minimal battery drain), use them as a simple way to open the pipes to drip when the temps drop, even remotely if needed. It wouldn't be a 100% unmanned solution or one I'd depend on working all the time, but could be very useful. That pesky auto-shut-off and potential battery drain could be deal breakers. Any advice on this use case is appreciated.

1 Like

So, a quick addendum to this, specifically about this model and something gleaned from the instructions, relevant to my use case. The valve includes an "Anti-freezing function". The description doesn't appear to be well worded, but is as follows:
"When the antifreeze function is turned on, and the temperature is lower than 5C, the watering device will automatically shut down. It will run until the temperature is higher than 5C."

Those statements appear to contradict. I assume they mean to say, if enabled, the device will automatically turn on when the temperature is lower than five degrees C and remain on until the temperature is higher than 5 degrees C.

The device doesn't appear to have any sort of sensor for water flow, so I decided to test the feature in the freezer, with no water line connected. I enabled the feature, which involved holding the valve's only physical button for 8 seconds. The LED flashes green. I tried turning it off, repeating the steps, and it flashes red. Doing it again, it goes back to green, which indicates the anti-freeze feature is on. I set the feature to on (light flashed green briefly to show it's enabled), placed it in the freezer along with another sensor I could read the temp with, and waited. When the sensor showed below 5 degrees C, no change on the valve. I tried turning it on via Hubitat and manually to see if the feature would keep it on. Nope, after 10 minutes it shut off.

A though occurred: does this device have its own temperature sensor, or does it depend on a temperature as reported by Tuya for the location? If that's the case, could it possibly be tricked into thinking it's below 5 degrees C to stay on? Of course, it could be I'm misunderstanding the feature.

1 Like

Hi @mikage.kun ,
I will need this device Model and Manufacturer ( from the HE device page 'Data' section) to investigate further what functionalities it has and what can be added to Hubitat driver. The Data needed should be like in this post.

It looks like this device is not designed to be open all the time, but to be used for short watering/irrigation only, hence the 15 minutes shut-off inbuilt timers.