[RELEASE] Tuya Scene Switch TS004F driver (w/ healthStatus)

The dev. branch version (link on the second post) is updated to 2.6.8

It allows configuring of the debounce timer. The hardcoded value was 1000ms, but it still can be low for some environments where the switch may communicate to the hub via one or more repeaters in unstable conditions.

'disabled' turns off the debouncing functionality.

2 Likes

Just noticing now the built in "Tuya Zigbee Scene Switch". seems to be working ok for me now. It you even mention in your notes to use it. I am not even sure how I got to use yours. Anyway, I needed one more fix to get your driver to work consistently with the TS0044. I put in a PR for the change.

As I don't have all the devices and can't always test the code changes, I usually first apply the new code to the development branch version only. So, the new 'Debouncing' wasn't available in the main branch version of the driver.

Today I merged the latest changes into the 'production' branch that is also pushed for an update via HPM.

Hubitat inbuilt "Tuya Zigbee Scene Switch" works fine with some of the Tuya TS0044 models.
Here Tuya made a big mess, using one and the same model name for two different devices types :

  • TS0044 scene switch - supports only singe, double and held (actually - released!) key presses. These devices will work with the HE inbuilt driver and do not need debouncing.
  • TS0044 scene switch and dimmer controller - has two operational modes, similar to TS004F models. In the 'dimmer' mode the device uses Zigbee Group broadcasts to control the linked Zigbee dimmers/bulbs in the same Zigbee group. These devices require the custom driver to be properly initialized in 'scene' mode. Some need the debouncing option enabled, some do not.

So, actually, the model TS0044 or TS004F does not determine what kind of device it is and how it will behave... What matters is the manufacturer Id, and there are too many different manufacturers ( this driver has the fingerprints of 11 different TS0044 manufacturers, for sure there are more).

2 Likes

Just as a data point, all my double taps stopped working with either version ver. 2.6.8 (or 2.6.7). Disabling the debouncing returned it to expected behaviour.

1 Like

Sounds like a bug... : (
What is your device model and manufacturer?

  • endpointId: 01
  • application: 42
  • batteryType: CR2430 3V
  • manufacturer: _TZ3000_wkai4ga5
  • model: TS0044

Moe's
Model number on back of device ESW-OZAA-EU

@kkossev,
I can confirm that I have the same button controller and experiencing delayed response to button presses. Disabling denouncing seems to fix the issue.
1 sec denouncing on another controller, Lightify, seems to be unaffected.

Moes 4 button controller - delayed response

Lightify controller - unaffected

EDIT: Had to disable debouncing on the Lightify controller as the controller stopped responding.

Hi @kkossev,
I have been using the TS004F Moes scene switches since April 2022.
They have worked fine until a few days ago. I see that the driver was updated and the debounce options are listed in the device.
If I set any debounce option the device will work once but if I press it again within 5 or 10 seconds it may or may not work. Multiple pushes of the same button don't toggle the device unless I wait longer or maybe push another button.
If I disable debounce I get multiple on/off signals.

Thanks for any help.

Steve
Moes Model is ESW-OZBA-EU
image

Driver version:
image

Hi @iEnam and @user819 ,

Thank you for the issue report! I will try to fix it ASAP.

2 Likes

I have now pushed for an update via HPM ver. 2.6.9 2023-10-14 - REVERTED BACK TO VERSION 2.6.6 timeStamp 2023/05/30 1:51 PM.

Will restore the debouncing timer configuration in a future version, when I have enough time for testing.

2 Likes

Hi, i having problems with released button not working on a

  • endpointId: 01
  • application: 43
  • manufacturer: _TZ3000_qja6nq5z
  • model: TS004F

its a Tuya ZigBee Smart Knob (Moes).
Im using latest HPM driver.

should be working??

Are all the other types of events working ( short press, double-press, rotating left/right ) ?

Yes... working all, even long-press. Maybe i am misunderstanding the held-released behavior.
If i long-press, "held" works but "released" not working after releasing the button.
Thats how i think it should work or i am wrong?

I hadn't had an issue with my Tuya button for a long time but recently noticed it stopped working. I think the same issue was happening to me as I disabled debounce and it's working again.

FWIW here's what I was seeing in the logs when this wasn't working. I hadn't pressed the button in a while (10 mins or so)

dev:13622023-10-19 07:25:57.558 PMdebugDownstairs Button debouncing timer (1000) for button 1 expired.
dev:13622023-10-19 07:25:56.608 PMdebugDownstairs Button restarted debouncing timer 1000ms for button 1 (lastButtonNumber=1)
dev:13622023-10-19 07:25:56.574 PMdebugDownstairs Button starting timer (1000) for button 1
dev:13622023-10-19 07:25:56.570 PMwarnDownstairs Button ignored event for button 1 - still in the debouncing time period!
dev:13622023-10-19 07:25:56.566 PMdebugDownstairs Button catchall descMap: [raw:catchall: 0104 0006 01 01 0040 00 ED1A 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:ED1A, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]
dev:13622023-10-19 07:25:56.550 PMdebugDownstairs Button description is catchall: 0104 0006 01 01 0040 00 ED1A 01 00 0000 FD 00 00

image

Are all the other types of events working ( short press, double-press, rotating left/right ) ?

Both short press and double-press stopped working (similar looking logs). That's all I had mapped

Thank you for the info! Some of these devices behave really strange, for now I will keep the reverted-back version 2.6.9 (debouncing hardcoded for specific devices only), until I have the time to get to the bottom of the problem.

For my reference later - probably the solution is here: Tuya zigbee switch delay issue · Issue #8149 · Koenkk/zigbee2mqtt · GitHub

@SamuelS if you use this driver and enable the Debug logs, do you see anything in the live logs when you press a button?

Nothing to see when pressing buttons.

Thanks @kkossev for your dedicated work on the Hubitat device driver for my Mose Scene/Dimmer Switch TS004F. Your driver installed via HPM and allowed the Mose 4 button switch to pair to my HE Hub like a glove. Now I can begin to remove my legacy X10 switches.

Paypal donation sent....

2 Likes

Thank you!

1 Like

@rhodesda can you try this driver with your Sonoff SNZB-01 button?

Enable the 'Advanced Options' and explicitly configure the 4 hours reporting period. Hit Save.

Lastly - obligatory pair again the button to your C-8 hub (without deleting it).
The battery reporting configuration should take in effect after the repairing.

1 Like