Thank you for providing this driver, I just got the SASWELL valve, HE discovered it as a 'device', I installed the driver from the Package Manager. But am unable to open/close the valve, the device page reports healthStatus: unknown and powerSource: battery looking at the logs i see when I press the physical button the following error:
dev:246 2023-05-22 12:40:25.678 PMerrorjava.lang.NumberFormatException: For input string: "0120FFE41F20FFE248" on line 1452 (method parse)
dev:246 2023-05-22 12:40:25.672 PMinfoFront Water Sipggot InitializeVars()... fullInit = false
dev:246 2023-05-22 12:40:25.669 PMinfoFront Water Sipggot updating the settings from the current driver version null to the new version 1.2.4 2023/04/09 10:55 PM
The code looks straight forward zigbee.convertHexToInt is the line its complaining about:
def updateTuyaVersion() {
def application = device.getDataValue("application")
if (application != null) {
def ver = zigbee.convertHexToInt(application)
def str = ((ver&0xC0)>>6).toString() + "." + ((ver&0x30)>>4).toString() + "." + (ver&0x0F).toString()
if (device.getDataValue("tuyaVersion") != str) {
device.updateDataValue("tuyaVersion", str)
logInfo "tuyaVersion set to $str"
}
}
else {
return null
}
}
I am not sure what up or if its just something silly i missed in its setup / configuration. Do I need to do a factory reset on the device or something?
Any help or ideas will be much appreciated.
Thanks
Seems like your SASWELL valve was not paired successfully to the HE hub.... At other times I would recommend deleting the device and pairing it again to the hub, but nowadays I am not suggesting this, as there are still many complaints when a removed device can not be paired again... What is your hub, C-8 or C-7 ?
I have secured the code processing the Zigbee device application data, so now the driver should log a warning, instead of throwing an exception. You can update the driver to version 1.2.5 from the dev. branch link in the second post, or directly from here.
After updating the driver, click on the Initialize button.
Can you post a screenshot of the device details, Data section? (like this)
Awesome, seems like that did the trick, after a ping and configure it seems to be opening and closing as commanded and the state of the device look correct.
Good to hear it worked! The Tuya firmware version is still incorrect, but this doesn't matter for the functionality.
Let me know whether your Saswell valve supports the two auto-shut-off modes - limited by time or by capacity (it is in liters! ) I am not sure whether this works differently for the two different irrigation valves ( GiEX and Saswell ). For the capacity limit, I suppose you will need to spring some water ..,
The 'Irrigation Timer' unit for GiEX valves was reported to be in minutes. Is it the same for the Saswell ?
At first glance its unclear as to the units for the timer, ill will give it a test and report back, the form entry does specify 'seconds'. Here is a screen capture for the state fields, if its helpful.
The seconds unit was my guess, I am going to change the label to 'minutes' in a future update.
This is a rather complex device, you will surely need time to understand all the specifics... Good luck!
My plan was just to use the open/close functionality and manage it via RM. A quick test in the above captured settings showed the device was open for a little under 20s as observed by audible clicks and android timer.
OK, you will need to experiment with the modes and the settings. Hopefully, the sprinkler comes with some instructions that can be understood... The instructions will refer to the Tuya SmartLife app, but the terms used in this driver should be the same or very similar.
I was able to set the valve's irrigationTimer field to 900, then opened the valve and started my the timer on my phone whit the sound of the valve opening, I observed the timerTimeLeft count down in 60s increments (refresh) until I heard the valve close, and saw the valve state displayed closed at about 15 minutes and 5 seconds, according to my sloppy timekeeping.
So the timer is in seconds for Saswell, but in minutes for GiEX.
I will change just the labels where possible for the two different model groups.
Thank you for the confirmation!
When you hook it to a water source, you can test whether the auto shut-off by capacity limit (in liters) works - this is the 'Set Irrigation Mode' command that must be selected and sent to the valve just once, I suppose. You can also make a screenshot of the current states, after the real use.
First off, thanks for all your hard work on this. I'm using the TS0601_GIEX_VALVE and have a question about the "Auto off timer" is that supposed to be for a manual turn on? If so mine's not following it.
I don't have these irrigation timers and I am not quite sure how they are supposed to operate in all possible operational modes...
My initial thought was that these timers are some kind of protection - if the valve was not closed by a command issued from the hub, emergency close it after 10 minutes.... but probably I am wrong.
Does anyone know how these irrigation timers operate paired to a Tuya hub, when activated from the actual device physical button?