Girier (Tuya) Zigbee 3.0 dimmable 1 gang switch w/neutral

After getting my switch gang units to function using the Zenismart 2/3/4 gang drivers later in that thread a different user made note of a dimmable version. I couldn't wait - for 7 bux to replace the GE Enbrighten single unit switch for $35? LOL

I Implemented the unit but the Zenismart wouldn't work well - don't even recall if it did on/off to be honest! I posted in the same thread, but there is a lot of noise for differing Tuya drivers so @kkossev said 'start a new thread' and here I am. My post there gave a broad run overview of my attempt. Here is that post:
crap! So I got the dimmable version - 1 gang devices to start. They aren't working quite right - I swapped drivers out, going through the list of 'dimmable' switches - two worked. sort of. there is some form of button functionality built in, i have to throw the attached dumb on/off switch twice to toggle the light.
Worse, if you dim, it works, but as you dim farther, the '100' says 100 as level, but doesn't really go to 100 visually anymore, it goes to more like an 80 value. Opening the driver (using Markus Presence dimmer switch - I love and much respect ) which works best I see some code that I can't fathom - it seems there are 2 entries for dimming calculation- bigInt and Decimal. I think its a coding error. Regardless... heres the fingerprint:
COPY AND PASTE THIS ROW TO THE DEVELOPER: fingerprint model:"TS110E", manufacturer:"_TZ3210_k1msuvg6", profileId:"0104", endpointId:"01", inClusters:"0004,0005,0003,0006,0008,EF00,0000", outClusters:"0019,000A", application:"40"

I know @kkossev is working on a ton of projects but for 7 dollars, this thing is awesome as a replacement choice for the expensive GE enbrightens and I hope he takes his Tuya knowledge and slaps it onto this!
and a pic :

2 Likes

long shot. try adding your fingerprint info to the "modelConfigs=" section of the driver below from Krassimir

https://raw.githubusercontent.com/kkossev/hubitat-matt-hammond-fork/master/drivers/tuya-zigbee-dimmer-module.groovy

2 Likes

That is the right driver for a Tuya dimmer!
@jshimota can you try to modify the code yourself? If it works, I will add this dimmer in the next driver version.

1 Like

no problem - can't till friday but I'll do a full test out!
Shu

snuck some time this am- implemented - works pretty good! a couple errors - some javanullpointers to debug and i want to add the ability to choose single tap or double tap. but the dimming perfect! on/off excellent, auto-detect was exact. Still showing as 'eWeLink' for manufacture - I think thats also and error - assumedly I'd want 'Tuya' or Girier.

more this weekend.

1 Like

well darn. not as good as I thought.
WHen I slapped this in, I left it dangling out the box - so today I flipped the breaker so I could pack it back into the 2 gang box it was being used in.
Once I put it all together, and shut the box, flipped the breaker on and it wasn't functional. Took it all back apart, hit the hard reset on it on the side - the light above me it is connected to started flashing fast and I 'readded' it in zigbee devices.
The on and off commands would work, but the device state reported allways says off. worse, the dimming is also not showing any value - but works. and of course I still have the double tap function I don't want. I'm concerned this is hardware set.
Where is the chipset commands you're referencing so I can start to dig into this - or would you rather @kkossev ?

I will look at this issue as soon as I am done with the final fixes for the new Tuya Contract driver, hopefully later tonight or tomorrow.

Like any power dev around here - don't burn out! we all want our stuff to work - but not at the expense of can down the road.
I tried really hard to debug that myself - it centers on a passed value returning from cmd to the device not seeing a value for level. I get lost when the code has a dual branch on the BigInt vs the Decimal around line 863. I cleared out the unit, reset the driver and started from scratch but it just hangs on the java null error. If I hand enter a value for Level on the device it does tickle thats about all I can do - refresh causes the error to pop in the logs with debug on. fwiw

1 Like

Please use this dev. branch version :
https://raw.githubusercontent.com/kkossev/hubitat-matt-hammond-fork/development/drivers/tuya-zigbee-dimmer-module.groovy

It should be ver. 0.2.11, time stamp "2023/02/19 9:20AM"

Give me the line where the null value exception happens, we must first fix this bug, as it probably affects the main functionality.

1 Like

I needed to rename your driver slightly so I could have mine in the library -
offending line is 867.

Beginning - changed driver to 'device', ran all the clears. set driver to Tuya Zigbee dimmer module modded for JAS - clicked configure.


clicked Refresh

1 Like

I have updated the code, there were a couple of lines where the 1-gang models were not handled properly.. Please try again with your device, I am using another model dimmer for testing, but the different model behaviors are different. Dev. branch version 1.2.11, time stamp 2023/01/14 10:36 PM.

i looked at your repo - I don't think your dev branch is shared - all I can see is the 0.2.xxx versions.
Am I looking in the wrong place? the dev branch 1.2.11 I just cant find - what IDE do you use? Ideaj?

PS - tip-toeing through your repo's - wow. you are NINJA!

2 Likes

Hi @jshimota ,
The latest version is actually 0.2.11 link to the dev. branch and this is the latest commit.
Version 1.x.x was a typo. I just recently started playing with IntelliJ, mainly still using the HE driver editor for debugging... I use WinMerge as a merging tool and SourceTree for version control.

1 Like

Haven't had any time really to dig in - quick error check this AM but am unsure I have right driver source - will check later - in case you want to hear - 2 groups that this device belongs with are popping errors - looks like one attribute isn't being written - currentSwitch :


and

BUT - progress on the value/level and hard error that was stopping the driver:

The dimmer was tested at 3:39PM yesterday, while the errors from the 2 groups are registered on the next day (today)..

Most probably the device ID was changed and the groups are trying to access a device that does not exist anymore. Delete the same old device for the groups and add it again.

You read the log correctly of course, I just copied the day prior from the test work to show the progress. no matter. I'll run the test set again - just got home from work.

cleared - removed device. re-added.

The Level is always '0' - can't see to move it.

If I only push 'Configure' level goes to 100 - no light but says it's on.
As soon as I touch refresh or set level it goes to 0.

further debug info '; the device is a part of a group called 'Kitchen'.
Toggle of Kitchen on and off fails

If I remove device from Kitchen Group - Kitchen group functions normally.

I'd like to go to the bottom of this issue and resolve it, but it will take time as I have a couple of other projects to finish first.

Can you keep it on your workbench and continue with the tests later?

I don't see in your logs if this dimmer sends anything to HE when the dimming level is changed manually from the device side (you need to press and hold te button for several seconds, the level will go up or down depending on the previous dimming direction).

When you click on the Refresh button, is the level shown correctly on the device page?

I will ask you also to copy and paste the logs as text in a Summary section, not as screenshots. The reason is that when I have the raw data dumped in the logs, I can copy the text from your logs and then simulate how the data is processed in the driver, without having the actual device.