[OBSOLETE] How to get a Z-Home Control ZHC5010 Z-Wave switch module to work? (DTH link in post 26)

Brilliant, it worked :slight_smile:

Thank you very much :slight_smile:

I assume it’s not a problem just letting that config statement in the DH, right? Then it’s there if I need it again in the future.

Hi again
I have an issue, on how to program 1 push and a double push in CoRE.

Because when I double push the button (for example button 1), the device then sent
"button 1 pushed" and then
"button 5 pushed / double pushed"

Can I configure the device so it does NOT send the “button 1 pushed” IF it’s a double push?

Or how can I fix that in my CoRE programming?

Or is it possible to modify the DH so for a doubleclick only button 5-8 are sent, not 1-4?

You can put logic in CoRE or the DH to wait after receiving a single press, and then cancel the single press if a double press is later received. If after a defined duration a double press is not received, then send on the single press. This will unfortunately necessarily add some delay though for the single press action. The logic for this really belongs in the device firmware to be effective, but taking a quick look at the manual, I didn’t see anything that looked like an option for this. This may not be very reliable in the DH - especially on a cloud-based system, but we can try.

Can you IM or post live logging of a double-press action? We’ll need this to gauge an acceptable delay to wait for the double press before sending on a single press.

Hi

This is live logging from a double click. Is this sufficient.

21.49.45: debug Parse returned [name:button, value:pushed, data:[buttonNumber:5], descriptionText:Køkken Multikontakt 5 double-pressed, isStateChange:true, type:physical, displayed:true, linkText:Køkken Multikontakt]
21.49.44: debug sceneNumber: 1 keyAttributes: 3
21.49.44: debug Parse returned [name:button, value:pushed, data:[buttonNumber:1], descriptionText:Køkken Multikontakt 1 pressed, isStateChange:true, type:physical, displayed:true, linkText:Køkken Multikontakt]
21.49.44: debug sceneNumber: 1 keyAttributes: 0

So I was to wait 500 ms from button1 to check if button 5 i pressed, how would I program that in CoRE?

Your logs look good. Unfortunately, I’m not aware of a way with the SmartThings groovy to adequately handle sub 500 ms delays that would be required for appropriately delaying the single press response while checking/waiting for a double-press. There is the runIn method, which only has a granularity of one second and for which the SmartThings docs state that SmartThings will “attempt to execute the method within a minute of the time specified, but cannot guarantee it.” Maybe a SmartThings staffer or developer here has some suggestions?

Nevertheless, I did update the device handler code at the original location to add a preference option to use the runIn method to delay the singePress response for one second in order to wait for a double press. This adds what I would consider as an unreasonable (and unpredictable according to the ST docs) delay to the single press response, but it may be worth a shot for your needs.

I also added a preference option to control the physical switch relay. Both options can be enabled via the DH mobile app UI gear icon.

Again, since I don’t have the device, it’s all completely untested, but give it a try and let me know how it goes.

Hi

Thank you very much :slight_smile:
I have tested the DH with the new functions. I have enabled “cancel single press if followed by double press”, but it seems single press doesn’t work at all. This is live log from single press

-button 3 pushed
-Parse returned [] for command CentralSceneNotification(keyAttributes: 0, reserved11: 0, sceneNumber: 3, sequenceNumber: 0)
-sceneNumber: 3 keyAttributes: 0

From this it looks like button 3 is pushed, but when I look in the log in the ST app for the device, it shows nothing. And I have created a test CoRE to react on a single press and a double press, and the single press does not get activated when the “Cancel single press when—” is enabled.

I’ve just made a correction to the device handler. Can you update to the latest code and try again? In the previous version, I failed to correctly send the single button press response after the delayed check for the double press.

Thanks again.

I have updated the DH, and also went into the device settings (in ST app on my phone) and pressed done. I dont know if that is necessary for an updated DH.

Single press now works again (with the cancel single press enabled), but double press stil activates both the single-press and the double press-function that I have programmed in CoRE.

I had an error when processing the double press. Can you update to the latest and try again? Thanks.

Progress! :slight_smile:
Single press and double press is now able to work by itself :slight_smile:
BUT trough my short testing I also still experienced that a double press also activated the single press.
My guess is those double pressed of my were some hundred of miliseconds slower, but still I would say they were “fast-enough” double presses, and ought to work as a double press, and cancelling the single press.

I’m not quite sure what the following means, but from the manual:

double-pressed (the last one requires that House Cleaning Mode isn’t disabled)

I suspect “housecleaning mode” is an attempt at translating either “maintenance mode” or “administrative mode” but in any case it looks like there are some parameters that need to be set and that a double press will be interpreted differently depending on the configuration.

There are two cases where cancelling of the single press after the double press occurs will be unreliable with this DH:

  1. If the messages are received out of order, and double-press happens to be received first - OR -
  2. If the double press is received greater than one second after the single press

I should be able to correct for issue 1) by comparing the timing of the press events, but if issue 2) is occuring, the only option would be to delay the single press events by 2 or more seconds which I would think would be overly annoying.

Again, the code for this really belongs in the device firmware not in ST itself, but until we can figure out if or how this can be done, we’re stuck dealing with potential delayed and out of order messages. If the issue is bothersome and repeatable - and if you can capture the issue occurring in live logging, I can see about addressing it, if it ends up being issue 1.

1 Like

Seems like you guys have put a lot into DH, thanks. As I am also located in Denmark I will order one of these and see how it performs.

Is the ZHC5010 working?

Hi Mads

It is working yes, but the double-click function is not stable. Sometimes a double-click also triggers a single-click action.

I’m looking forward to you getting one, and share your experience with us :slight_smile:

1 Like

Cooool - I will. Maybe the device handler needs a bit of tweaking to fully support all features.

@Darwin Thanks a lot for the work on the DH.
Maybe you can answer me on this question, how / or is it possible to trigger a virtual on / off on button 1?

I want to turn off my oldschool kitchen light when running a routine.

Hi guys, I tried your code on my (3) ZHC 5010 at home. I somewhat confused about why there is no button to turn on or off my lights? It seems there is only a label and a refresh button. What’s with that? :slight_smile:

Hi Michael and @MadsE
You dont use the Thing it the app for anything, besides perhaps change some of the few settings that Darwin included.

You use CoRE to program what each button should do.
Lets call the Thing “Multicontact”, then I have a piston saying
IF Multicontact button #1 is pushed
THEN do what you want

That simple. Hope that makes sense.

Note: It has button 1-4, for single click, and then it also has button 5-8 for double click, but as described in this thread, my issue is that a double click sometimes also executes a single click action.
If you make a double click, then the device should ignore the single click (the first of the two clicks).

I cannot remember anylonger if there is also a button 9-12 for long press?!
I never godt really program it as I wanted because I wanted to wait to see if @Darwin would succeed in suppressing the single click issue, when doing a double click

I can confirm that 5-12 is tripple click and long press is also supported by webcore which is also what I use.
If you want to control lights with it I suggest you use SmartApp Smart Lightning it support the ZHC5010 and all buttons.