Device Command buttons require a number

Another question for you?
The button controller we are discussing here,

( Amazon.com)

says it requires a Moes Hub.
I could use this Moes hub separate from the Hubitat just to run the controller, but my question is could this 2nd hub connect and control zigbee devices that are already paired to the Hubitat hub?
I'm assuming no but need to ask.

Thank you.

You don't need Moes (Tuya) hub, this is a totally different home automation system (SmartLife) that is entirely cloud-based. Almost all of Tuya branded Zigbee devices can be used locally with the Hubitat Elevation hub.

Sorry, I forgot to mention an important detail - you need to pair again the TS004F scene switch to HE hub. Most of the battery-powered Zigbee devices are 'sleepy devices', which means that for power saving their radios are switched off most of the time and they wake up only when a button is pressed, or temperature is changed, etc... So simply changing the driver does not work sometimes. This TS004F scene controller is one of the most difficult devices to pair, as it accepths the proper configuration parameters only at the time when it is paired to a Zigbee hub.

So please do the following:

  1. REMOVE the device from the bottom right button on the device web UI page
  2. Pair it again to HE hub ( Device->Add Device ->Zigbee -.Start Zigbee pairing). You need to press and hold the bottom left button for 6-7 seconds until the LED starts flashing. Do this procedure close to the HE hub.
  3. Once the LED stop flashing, the Scene Switch should be found and after assigning a device name you can now use it. Press all the buttons, try double-click, etc,,. - you should see the actions logged on HE Logs page (open it in another browser tab).

If all is OK, you should see something similar on the device page:

Hi kkossev,
Repairing the button controller seems to have worked.
I can see where a button push is showing in the device edit screen.
I am configuring button 1 to toggle 3 lamps. The other 3 buttons to toggle each of the 3 lamps separately.
Problem is many times I push a button and the lamp will turn on and then off with just one push of the button. Sometimes is will toggle properly (push on/ push again for off).
I suspect it's has to do with button bounce as I see log entries for that.

1 Like

Can you please post your Model and Manufacturer values? Similar to my post above?

I think I see where the problem may be (your device model is not TS004F, but newly produced TS0044). If this is the case, will send you a fix tomorrow.

1 Like

kkossev,
Thank you.
I see there is some discussion about this very device on other sites like the Home Assistant community, etc.

Here is the back of the device:
image

Yep, this device was later made working also in SmartThings, Home Assistant and other home automation platforms...

Your device fingerprint (model and manufacturer and application version) is exactly the model as mine, although my device is missing the MOES logo engraved on the back.

Just recalled that there was a similar problem with another type of controller, that was resolved here:

Unfortunately, I have forgotten to merge the changes into the driver main branch.
Please use the test driver version that can be found in the post linked above (should be 2.4.0 dated 2022-03-31). If these tweaks work for your device too, I will marge it into the main version.

Hi kkossev,
I copied the new code into the Tuya driver and saved.
I deleted the device and related apps.
I re-added the device/controller.
I configured the buttons again.
It is still behaving erratically. (toggle on/off with one push of the button or off/on).

I removed the device and button configuration a 2nd time and added the device again. Still the same.
Screen shot is from the driver code.

On line #73 there is a constant that defines the debouncing time :

@Field static final Integer DEBOUNCE_TIME = 900

Can you try to change the constant from 900 to 1500 or even 2000 for example?
Once you modify it in the Drivers Code editor, press Save and after a second the change will be in effect.

And please post again the device logs (you can try copy and paste as text from the screen).

You do not need to delete and pair the device anymore, once it have been successfully initialized in Scene control mode during the first pairing with this driver, the device will retain the settings.

These are my device timings:

I have updated the code from the same link to a new version 2.4.1. Please use this version.

The main change is that the debouncing timer is now started with an explicitly set 'overwrite' (restart) option, although the docs say that this option is set by default, I witnessed the same erratic behavior with the scheduler timer actually not restarted ... At the moment I don't have an explanation for why this happens and why it was not noticed until now, this driver has been in use for quite a long time.

kkossev,
I copied in the 2.4.1 driver code and set the debounce time to 1500 and then saved it.
It made a big difference. I haven't seen any 'multiple' toggles when pushing any buttons once. It seemed a bit slower to respond at times so I may reduce the debounce time later.
I've pasted some of the most recent logs below.

Thank you so much for your help. Steve

dev:892022-04-23 04:09:39.057 pm debugdebouncing timer for button 2 expired.

dev:892022-04-23 04:09:37.561 pm debugrestarted debouncing timer 1500ms for button 2 (lastButtonNumber=2)

dev:892022-04-23 04:09:37.540 pm warnignored event for button 2 - still in the debouncing time period!

dev:892022-04-23 04:09:37.538 pm debugcatchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 04:09:36.772 pm debugrestarted debouncing timer 1500ms for button 2 (lastButtonNumber=2)

dev:892022-04-23 04:09:36.751 pm warnignored event for button 2 - still in the debouncing time period!

dev:892022-04-23 04:09:36.749 pm debugcatchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 04:09:35.917 pm infobutton 2 was pushed

dev:892022-04-23 04:09:35.915 pm debugcatchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 04:09:35.885 pm debugdebouncing timer for button 2 expired.

dev:892022-04-23 04:09:35.637 pm debugsendEvent [name:battery, value:100.0]

dev:892022-04-23 04:09:34.355 pm debugrestarted debouncing timer 1500ms for button 2 (lastButtonNumber=2)

dev:892022-04-23 04:09:34.333 pm warnignored event for button 2 - still in the debouncing time period!

dev:892022-04-23 04:09:34.331 pm debugcatchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 04:09:33.542 pm debugrestarted debouncing timer 1500ms for button 2 (lastButtonNumber=2)

dev:892022-04-23 04:09:33.521 pm warnignored event for button 2 - still in the debouncing time period!

dev:892022-04-23 04:09:33.518 pm debugcatchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 04:09:32.601 pm infobutton 2 was pushed

dev:892022-04-23 04:09:32.597 pm debugcatchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 04:09:32.413 pm debugsendEvent [name:battery, value:100.0]

dev:892022-04-23 03:54:50.606 pm debugdebouncing timer for button 1 expired.

dev:892022-04-23 03:54:49.090 pm infobutton 1 was pushed

dev:892022-04-23 03:54:49.088 pm debugcatchall descMap: [raw:catchall: 0104 0006 01 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 03:54:27.624 pm debugdebouncing timer for button 2 expired.

dev:892022-04-23 03:54:26.127 pm debugrestarted debouncing timer 1500ms for button 2 (lastButtonNumber=2)

dev:892022-04-23 03:54:26.107 pm warnignored event for button 2 - still in the debouncing time period!

dev:892022-04-23 03:54:26.105 pm debugcatchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 03:54:25.293 pm debugrestarted debouncing timer 1500ms for button 2 (lastButtonNumber=2)

dev:892022-04-23 03:54:25.272 pm warnignored event for button 2 - still in the debouncing time period!

dev:892022-04-23 03:54:25.270 pm debugcatchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 03:54:24.464 pm infobutton 2 was pushed

dev:892022-04-23 03:54:24.462 pm debugcatchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 03:54:24.167 pm debugsendEvent [name:battery, value:100.0]

dev:892022-04-23 03:54:23.971 pm debugdebouncing timer for button 1 expired.

dev:892022-04-23 03:54:22.454 pm infobutton 1 was pushed

dev:892022-04-23 03:54:22.452 pm debugcatchall descMap: [raw:catchall: 0104 0006 01 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:892022-04-23 03:52:35.064 pm debugdebouncing timer for button 2 expired.

dev:892022-04-23 03:52:33.569 pm debugrestarted debouncing timer 1500ms for button 2 (lastButtonNumber=2)

dev:892022-04-23 03:52:33.548 pm warnignored event for button 2 - still in the debouncing time period!

dev:892022-04-23 03:52:33.546 pm debugcatchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 71A6 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:71A6, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

1 Like

Thank you too, Steve!

I am planning in a future version of this driver to make the debounce timer configurable, so that it can be adjusted from the device page UI depending on the particular model specifics.

I have just published the driver in a dedicated community new thread : [RELEASE] Tuya Scene Switch TS004F driver

Excellent.
Are you a developer for Hubitat?

No... But I used to be a software developer 15 or more years ago.
Now I do some coding just for fun.

1 Like

Ah. Well thank you for making Hubitat better.
Can I ask where you are from?

Kkossev,
Another question.
If I were to buy the same Moes button controller but with a single or double button, would I use the same driver?

I am from Bulgaria.
The same driver also supports TS0041 single button : Tuya Zigbee 3.0 Smart Wireless Smart Switch Button Control Multi scene Linkage Smart Switch Work With Alexa Google Home|Smart Remote Control| - AliExpress
This singe button is also supported by HE inbuilt drivers. I don't have double buttons, can you post a link to the device you are looking at?

Ah, Bulgaria. Very good. I'm in the U.S., Nebraska.
I'm glad that you are there to help us home automation enthusiasts.
Not everyone appreciates 'control' freaks like you and I. Ha. :wink:

2 button:
https://www.amazon.com/MOES-Wireless-Powered(Not-Included)-Automation/dp/B095LQT79P/ref=sr_1_4?crid=2J46R9948R5HV&keywords=moes+scene+switch&qid=1650849341&sprefix=moes+scene%2Caps%2C166&sr=8-4

1 button:
https://www.amazon.com/MOES-Wireless-Powered(Not-Included)-Automation/dp/B095LPGXPM/ref=sr_1_4?crid=2J46R9948R5HV&keywords=moes%2Bscene%2Bswitch&qid=1650849341&sprefix=moes%2Bscene%2Caps%2C166&sr=8-4&th=1

I expect that the same driver will work with the 1 and 2 button scene switches, but will show the wrong number of buttons. This can be easily corrected in the driver, once we have the Model and Manufacturer data for these devices. So I think you can go ahead and order the device, the risk is minimal here.

Thank you. I'll let you know how they work. I won't be able install it for a couple weeks.
I'm going on a vacation starting tomorrow.

Stevenr

1 Like