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

version 2.6.0 was pushed for update via HPM. It adds the new 'healthStatus' attribute, which can be used to determine whether the device is online or offline to HE hub.

3 Likes

Updated the driver from the developer branch. Noticed i had done that for 2.5.1 already but the driver was never adopted by the scene controller, its still on 2.5.0

Same now for 2.60, is there a way to force the device to start using the new driver?

Kkossev wrote
Important: Due to the Tuya specific initialization that these devices require, these scene switches must be obligatory re-paired to HE hub in order to work properly.

So i need to re-pair it?

Check in the Drivers Code web page if you don’t have multiple instances of the same driver. So you are updating one instance via HPM , but your actual devices are using other instance of the same driver, same driver name. This happened once to me and was a pain to find and fix.

I removed the developer code and double checked the Tuya Scene Controller was installed through HPM. Ugh this thing is a PITA to get to work…

Edit:

  • fingerprint profileId: 0104
  • endpointId: 01
  • application: 43
  • inClusters: 0001,0006,E000,0000
  • manufacturer: _TZ3000_mh9px7cq
  • model: TS0044
  • outClusters: 0019,000A

Seems im slowly making progress

Is this a 4 button scene switch, or a 4 button remote?

Yes, you need to pair it with this driver being automatically selected. Otherwise these will not work, they are one of the most weird Tuya devices.

Whats in a name, is the MoesGo 4 button device
image

Ok, delete it from HE, and pair it again as a new device. Is the TS004F driver selected automatically?

While pairing as a new device, there will appear a link ‘more info’. Please copy everything from this pop up window before you continue with setting up the device name.

2 Likes

@kkossev, Thanks for adding the new "healthStatus" attribute, all working great :smile:
Are you planning to add to all your drivers, including motion sensors?

Tuya Remote Control TS004F

Tuya Scene/Dimmer Switch TS004F

2 Likes

Kudos to @kkossev. He made this work in a heartbeat! :muscle:t3::facepunch:t3:

For those running into issues with combinations of drivers installed in the custom section and through HPM a few things i learned;

  • remove drivers from the custom drivers section that are outdated or unused.
  • if HPM throws an error while updating a driver, just use the repair function (this was toooo obvious, but i missed it / did not try until pointed to it.
  • when removing a zigbee device, do so while the device is in exclusion mode if you know how to do that. Trust me, it makes your life easier by not having to do strange factory reset procedures :stuck_out_tongue_winking_eye:
1 Like

First, let me say THANK YOU for writing this Driver. The Tuya devices are very afforable, and I'm really looking forward to seeing how well they do!

I got the XUELILI version of the 4 button switch. I added the driver from the Hubitat Package manager, and it paired right out of the gate. It seems to have identified as a TS0044:

  • endpointId: 01
  • application: 42
  • manufacturer: _TZ3000_wkai4ga5
  • model: TS0044

Where it gets interesting is that it is reporting as a 3 button switch, but, as you can see from the current state, the driver does recognize button 4:

Current States

  • battery : 100
  • doubleTapped : 4
  • healthStatus : online
  • held : 4
  • numberOfButtons : 3
  • presence : present
  • pushed : 4
  • released : 1
  • voltage : 3.06

Is there some way to edit the "numberOfButtons" variable to change it to "4"? It looks like I can use this in Rule Machine, and Basic rules with no problem, but the Button Controller app won't let me set up actions for button 4 because it thinks it only has 3 buttons...

Hi @dvdptr1 ,

Please update to the latest version 2.6.1 (you can use the Import button within HE Drivers Code editor). Then click on the Configure button, and let e know if the numberOfButtons changes to 4
I have added some extra logging in this version.

And it may be a good idea to add in a future version a Preference for overwriting the automatic detection logic for the number of buttons. This will be useful, especially for new models, which fingerprints are not included in the driver.

Looks like that did the trick!

Current States

  • battery : 100
  • batteryVoltage : 3.0
  • doubleTapped : 4
  • healthStatus : online
  • held : 4
  • numberOfButtons : 4 <<<<<=========
  • pushed : 4
  • supportedButtonValues : ["pushed","double","held"]

Button Controller built in app now lets me add the 4th button too....

And as for having an option to override, with as many versions of these scene buttons are out there, and override might be a good idea... :slight_smile:

Thank you so much @kkossev !

I have a couple of these and they work well with the right driver. You basically get single press and double press events (long press is not useful) for each of the four buttons, so 8 unique events.

But if you use it with the button controller software you can use each click to cycle through a group of settings such as fan speed or bulb color and get a lot out of a single controller.

I would recommend.

3 Likes

Has anyone noticed that all 4 lights flash when it checks in/reports battery status?

I saw it flash and then looked at the log. It just showed this:

dev:17132023-02-05 04:06:47.238 PMinfoAV Control Pad battery is 100 %

dev:17132023-02-05 04:06:47.229 PMdebugAV Control Pad Event enter: [name:battery, value:100.0]

dev:17132023-02-05 04:06:47.225 PMdebugAV Control Pad description is read attr - raw: A02801000110210020C82000201E, dni: A028, endpoint: 01, cluster: 0001, size: 10, attrId: 0021, encoding: 20, command: 0A, value: C82000201E

dev:17132023-02-05 04:06:47.119 PMwarnAV Control Pad DID NOT PARSE MESSAGE for description : read attr - raw: A0280100001801002042E2FF201FE4FF2001, dni: A028, endpoint: 01, cluster: 0000, size: 18, attrId: 0001, encoding: 20, command: 0A, value: 42E2FF201FE4FF2001

dev:17132023-02-05 04:06:47.116 PMdebugAV Control Pad raw: descMap: [raw:A0280100001801002042E2FF201FE4FF2001, dni:A028, endpoint:01, cluster:0000, size:18, attrId:0001, encoding:20, command:0A, value:42, clusterInt:0, attrInt:1, additionalAttrs:[[value:1F, encoding:20, attrId:FFE2, consumedBytes:4, attrInt:65506], [value:01, encoding:20, attrId:FFE4, consumedBytes:4, attrInt:65508]]]

dev:17132023-02-05 04:06:47.110 PMdebugAV Control Pad description is read attr - raw: A0280100001801002042E2FF201FE4FF2001, dni: A028, endpoint: 01, cluster: 0000, size: 18, attrId: 0001, encoding: 20, command: 0A, value: 42E2FF201FE4FF2001

dev:17132023-02-05 04:06:41.968 PMdebugAV Control Pad received device announcement, Device network ID: A028

dev:17132023-02-05 04:06:41.965 PMdebugAV Control Pad catchall descMap: [raw:catchall: 0000 0013 00 00 0040 00 A028 00 00 0000 00 00 8128A0572B8DFEFF27FD8480, profileId:0000, clusterId:0013, clusterInt:19, sourceEndpoint:00, destinationEndpoint:00, options:0040, messageType:00, dni:A028, isClusterSpecific:false, isManufacturerSpecific:false, manufacturerId:0000, command:00, direction:00, data:[81, 28, A0, 57, 2B, 8D, FE, FF, 27, FD, 84, 80]]

dev:17132023-02-05 04:06:41.961 PMdebugAV Control Pad description is catchall: 0000 0013 00 00 0040 00 A028 00 00 0000 00 00 8128A0572B8DFEFF27FD8480

It's not a big deal, but, as it sits on a table next to the sofa, I'll notice the light flash out of the corner of my eye...

Based on the logs, it reports battery ever 12 minutes... at least when there is no other activity...

Hi @dvdptr1 ,

Your device LEDs are blinking. because it rejoins the HE Zigbee network periodically, which is not good...

For how long time you are using the device paired to HE? ( please post the manufacturer/model from the 'Data' section so that I can identify it). You can search the Past Logs page for "received device announcement" log message. How often you see it?

I connected the 3-gang button to HE.
It works very well.


Device pairing info

Manufacturer: _TYZB02_key8kk7r
Endpoint 01 application: 44
Endpoint 01 endpointId: 01
Endpoint 01 idAsInt: 1
Endpoint 01 inClusters: 0000,0001,0006
Endpoint 01 initialized: true
Endpoint 01 manufacturer: _TYZB02_key8kk7r
Endpoint 01 model: TS0043
Endpoint 01 outClusters: 0019
Endpoint 01 profileId: 0104
Endpoint 01 stage: 4
Endpoint 02 endpointId: 02
Endpoint 02 idAsInt: 2
Endpoint 02 inClusters: 0000,0001,0006
Endpoint 02 initialized: true
Endpoint 02 outClusters: 0019
Endpoint 02 profileId: 0104
Endpoint 02 stage: 4
Endpoint 03 endpointId: 03
Endpoint 03 idAsInt: 3
Endpoint 03 inClusters: 0000,0001,0006
Endpoint 03 initialized: true
Endpoint 03 outClusters: 0019
Endpoint 03 profileId: 0104
Endpoint 03 stage: 4
![photo_2023-02-07_19-40-42 666x500](upload://fHUGxHAZBMVtKyNjcb0SwwZLKbw.jpeg)
Summary

dev:6052023-02-15 02:30:31.532info3G Button button 3 was pushed

dev:6052023-02-15 02:30:31.529debug3G Button catchall descMap: [raw:catchall: 0104 0006 03 01 0040 00 14AD 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:03, destinationEndpoint:01, options:0040, messageType:00, dni:14AD, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:6052023-02-15 02:30:31.528debug3G Button description is catchall: 0104 0006 03 01 0040 00 14AD 01 00 0000 FD 00 00

dev:6052023-02-15 02:30:30.931info3G Button button 2 was pushed

dev:6052023-02-15 02:30:30.928debug3G Button catchall descMap: [raw:catchall: 0104 0006 02 01 0040 00 14AD 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:02, destinationEndpoint:01, options:0040, messageType:00, dni:14AD, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:6052023-02-15 02:30:30.926debug3G Button description is catchall: 0104 0006 02 01 0040 00 14AD 01 00 0000 FD 00 00

dev:6052023-02-15 02:30:24.309info3G Button button 1 was pushed

dev:6052023-02-15 02:30:24.305debug3G Button catchall descMap: [raw:catchall: 0104 0006 01 01 0040 00 14AD 01 00 0000 FD 00 00, profileId:0104, clusterId:0006, clusterInt:6, sourceEndpoint:01, destinationEndpoint:01, options:0040, messageType:00, dni:14AD, isClusterSpecific:true, isManufacturerSpecific:false, manufacturerId:0000, command:FD, direction:00, data:[00]]

dev:6052023-02-15 02:30:24.303debug3G Button description is catchall: 0104 0006 01 01 0040 00 14AD 01 00 0000 FD 00 00

dev:6052023-02-15 02:30:11.003debug3G Button updated()

dev:6052023-02-15 02:29:47.365infoTuya Scene Switch TS004F batteryVoltage is 0.0 V

Show more...

1 Like

Hi All,
One of my Tuya Scene/Dimmer Switch TS004F button controllers is eating through batteries.
I purchased new Duracell CR/DL2430 coin batteries, used one on 1st March 23 and just after only 9 days, the new battery which measured 3.2volts is now dead (measuring around 2.89volts!).
The button controller basically flashes all buttons simultaneously when it deems the battery to be low. Anyone has any advice or experienced a similar issue?

This is a second report for a problem with the batteries. Flashing all LEDs means that the device re-joins the Zigbee network. Most probably this depletes the batteries…

I have an idea what of the latest updates of the driver may be the reason for this (the battery reporting configuration most likely), but today I don’t have access to a PC. Will prepare an update on Saturday.

The strange thing is that this problem affects only few of the TS004F model manufacturers, not all.

What are the manufacturer IDs of the TS004F that work fine and what is the manufacturer of the one which has problems with the batteries?

1 Like

Thanks for your reply and update.
It seems that all my button controller's have the same manufacturer ID, but only the currently offline device seems to be rapidly depleting the batteries.
I initially thought it was because I used a lower capacity battery, CR2032, then I bought the expensive and correct battery, CR2450, but it died in 9 days.
Also, not sure if it makes any difference, but I bought the devices from different suppliers; one from Amazon UK, and two from two different sellers at Aliexpress.

Also, could you please explain why some battery % is shown in green and some in black?
Thanks