Did nothing and the past few days have been 100%? The occasional double on/off issue disappeared…
Jim, use your switch more frequently to experience the issue. I had it twice this morning.
The issue resides within the SmartApp itself.
I have no reason to believe this issue isn’t just SmartThings. I have the same results with my 2 minimotes that I do with the Enerwave 7 button. But that is just me. I generally use automations and Alexa for most anything anymore.
Hi, Matt. I also have a Minimote, and I do not have this issue with its button presses. I use these buttons frequently each day. Additionally, I can see in the logs that my switches were toggled on then off, and vice versa, which is because of the smart app not yet robust to handle the nuance of the Enerwave 7-button controller. (you already know about that)
I was worried that because the SmartApp fires off multiple times on a single button press that it might cause toggle events to “flip-flop”, but that doesn’t seem to be the case. It looks like the duplicate press events have almost the exact same time stamp, so my guess is that the SmartApp fires off multiple times, but because they are so close together it does not interfere with toggle actions.
I am quoting a previous comment of mine, but the problem you are seeing is a combination of the device and the SmartThings platform. Over the last few weeks, it seems like SmartThings has been going through some growing pains. My guess is that the recent problems with this device have been a result of cloud related latencies. The Enerwave Scene controller has a tendency to report double button presses. As @tgauchat mentioned, you can try to solve the issue with a software de-bounce, but with potential latencies in your local network, internet provider, and the SmartThings cloud, your going to be fighting a losing battle. You can either create a small event based de-bounce (of maybe one second) which won’t work well when there is little latency (missed events), or create a large (or no) de-bounce which will result in double toggles. There is no way to get it perfect because the environment is constantly changing.
There may be some SmartApp magic that could get things working perfectly, but it would be difficult. You could also examine the device type to see if there are some kind of differences between the double presses. That could make the device very robust if that is the case. Also, if the device type and SmartApp get approved for local execution, the problems will likely disappear (this is probably the easiest solution).
My suggestion for now though is to either live with the strange behavior when there is latency in the systems mentioned above. Hopefully SmartThings continues to improve and these events are infrequent. Or, you could remove the de-bounce code that is there completely and not use toggle events. That is what I do. I have a button that turns lights on and another one that turns lights off. Or if someone can get SmartThings to publish the device type and SmartApp for local execution. . . Not sure how likely that is.
@mattjfrank Thank you for the code. I have changed a little bit of the code to work for my needs and now you can add a particle photon and send put commands. More detail here:
So I brainstormed this weekend and think I came up with a better way to debounce the Enerwave double press problem. The modifications should work well with toggle commands and should just generally be more reliable. I’ve added a configuration option during setup that allows you to choose the debounce value. The higher the value, the better the app can handle SmartThings cloud latency, but additional button presses are disabled for the duration of the debounce period. For example, if debounce is 3000 (3 seconds), and you push button 1, you have to wait 3 seconds before pushing an additional button. The default setting of 3000 should be good, but if you find SmartThings latency is causing buttons to not fire off, you might want to try to increase it to 4000 or maybe even 5000. Honestly though, you shouldn’t have problems with this SmartApp unless things are really bad with the SmartThings cloud.
If any one wants to try it out and let me know how it goes that would be great. Once I get a few confirmations that the app is working well, I’ll ask @mattjfrank to commit the changes.
So as a recap, these changes should solve the double toggle problem. They should also make the app more reliable. Here is the link:
Edit: Oh, and after updating to the new code, you might have to run through the SmartApp configuration. You don’t have to uninstall and install, just open up the installed instance of the SmartApp and click next, next, next, etc.
Eric, thanks very much for the time and effort! I’ll be using it now and reply back within a week.
Great, just let me know. I really think this version is as good as we are going to get. The only weakness it has is when SmartThings is acting up. This morning I was doing some testing and I had an event not trigger after a button press (these are rare with this code). I checked the logs and saw that the SmartApp was executed almost a full 11 seconds after the button event occurred. Seriously? My app is written to discard the event if it occurs after the debounce period. I could just have the event fire off, but after 11 seconds it is likely that I have pushed the button again. For people that use Toggle, this would cause a double toggle.
This device and SmartApp really would benefit from local execution. I really hope SmartThings makes the process of getting things to work locally better down the road.
Eric @erocm1231, this is super. I’ve not had the issue appear at all with my lights for the past week. If you ask me, I sign off on this code review. Nice job, brother.
@mattjfrank, would you mind committing the changes in your github?
done, also credited you for your work.
Awesome, thanks! Hopefully this will be my last tweak (well, at least until SmartThings allows the use of atomicstate with device handlers;) )
I am stuck at include…
- Add device type, publish
- Connect new thing, item found and used the new device type
- Configure… no live log entry
- Exclude on hub, exclude on switch, device still shows in list
- Repeat #4 a dozen times, same result
- Delete device on smartthings.com
- Delete device type
- Repeat 4 several times
- Add device type again
- Connect new thing, include mode… nothing
- Exclude on hub, on device… after a few seconds, device goes back to all lights on
- Repeat 10-11 many times… nothing
Do I need to remove the custom device time with each iteration?
When the install instructions say this must be done multiple times… multiple = 3, =30, =300?
I edited the instructions but this won’t likely change your result. However when adding device step 4 used to say repeat steps 1,2,3 really you just have to repeat step 3. Try excluding the device and adding again. Then after hitting configure move on and see what happens.
I will have to retest these steps later to make sure they are all still accurate and working. It appears your device is responding though just something isn’t working properly.
set the debounce to 3000 and it will work
Okay. I’m having trouble. After the USPS lost my first one, and I had to fight with Amazon to get a replacement, I finally got it a week later than expected. (Hey, don’t get mad at me for going off-topic, I got like 200 messages into this thread before I got tired of trying wade through all the branched off-topic conversations and decided to jump to the bottom and post my problem.)
Okay. I got it, hooked it up, I already had the device type and smart app added a week ago (you know, when I thought it was going to come…)
I had trouble at first getting it to recognize, but it finally did. I didn’t check the log and set up the smart app, but it didn’t do anything when I pressed the buttons.
So, I tried to do step 3 again and then I had 2 devices. But, there was nothing in the log.
So, I tried to remove both of them. I left it in exclusion mode for a long time, typing the exclude sequence several times and it didn’t ever exclude, so I forced the device out. (I did that for both devices, trying several times for each one.)
Now, no matter how many times I try or how long I leave it searching (up to five minutes) it never finds it anymore.
I’ve tried several round of hitting the exclude sequence 5 or 6 times and then trying to include it 2 or 3 times. It never finds it,
When I do the exclude button sequence, it flashes several times and then all the lights come on.
When I do the include button sequence, it flashes forever until I press a button, then all the lights come on.
Is this how it is supposed to act?
Anyone have any ideas? I have to be missing something.
How strong is your Z-Wave mesh? Is it possible that the device is out of range when you are trying to include/exclude?
Also, what is the button sequence you are using for include and exclude?
It only stays in include/exclude mode for about 5 seconds, then flashes leds I think 5 times on a fail and 3 on a pass, so you may just be timing out with the 5 rapid flashes. Best to just do the verify with button 1 below…
I just switched mine over from V1 to V2, I’ve had no issues since the last SmartApp update, but the change over it did seem like a weak zwave network mess, always good to run a Zwave Repair from the App once in a while to cleanup and repair all your device routes/connections. At first I had a double add in ST’s and no functionality, I finally figured out, I had to hit the Configure Tile on the devices page to send the data from the smartapp to the switch.
VERIFY IF ATTACHED TO A ZWAVE NETWORK
To see it the device thinks it’s attached/programmed to a network, simply press button 1 (top left), it it returns all lights flashing, then it thinks it’s NOT attached to a network and you are clear to readd (include), but I would still factory reset the device twice with one of the procedures below. Note, the device only works with button 1 (top left) until fully programmed via the smartapp (all other buttons will just flash all leds whether it thinks it’s on a network or not).
If it returns only button 1 lit, then it thinks its attached to a network (but not necessarily your network), then verify on the device page in the app if ST is capturing the button 1 presses (best to see presses on the Recenty tab), if so then you just need to run the smartapp (Under the Connect New/SmartApps/My Apps section, must be published in IDE along with the devicetype) and program the buttons, if still only responding to button 1, then hit the Configure Tile on the device page and it should resend the programming data to the device. If no App response, then I’d assume the device is programed to another zwave network, sometimes the factory forgets to reset/clear the devices after testing or if you got it used, the device may still be looking for the prior owners network.
FACTORY RESETING DEVICE
To factory reset, I prefer using a GE-45600 remote, it allows you to reset a device with a clear indication from the remote and the device in a few seconds, else follow the factory reset below (recommend running twice):
-Factory Reset any Device (Light/Switch) via a GE 45600 Remote (worth the $10 if you have a zwave network):
- On the GE remote, Hold Setup button till Red/Green flash twice.
- Press Delete (Red Blink).
- Press Light (flashes green rapidly).
- Press button on actual device to include/exclude (see below), reset is complete when green stops flashing on remote followed by 2 green flashes on the remote and 3 on the device.
- Now you can reinstall the device per normal setup via the ST App.
-Factory Reset ZWN-SC7 with just power applied:
- Follow the same procedure as Include/Exclude, except press the Right side buttons when going down the column.
- When complete, all the device leds should flash a few times; if any button are then pressed, it shold only respond by flashing all leds.
- Press button 1, if all leds flash, then the device is fully cleared/reset; if button 1 led only on, then the device thinks it’s still programmed to a network.
- Eitherway, I always run the factory reset procedure twice.
-How to put ZWN-SC7 into Include/Exclude mode:
- Press and hold the large button on the device for 3 seconds, the top two leds will stay lit.
- Press the top left button, then the middle 2 buttons will light, the press the left middle and continue the same by pressing the bottom left button.
- All button leds will flash for only about 5 seconds, during this time the device is in Include/Exclude mode, you only have a short time to work and may need to run this sequence more than once while ST is searching for it.
- The device should reply with 3 fast flashes if it gets included/excluded.
NORMAL ADDING TO ST’S
Once you are sure you have a fully cleared and reset device, then put the app into add/search mode, then run the Include procedure above. If ST doesn’t find it on the first try, keep ST in search mode and run the include procedure again (it only stays in include mode a short time). If you suspect a range issue, move the hub and/or device closer to each other.
If it just seems like it’s not connecting: cancel the search, close and kill the app, reopen the app, sometimes ST will then show that it found a new device that’s not configured and you can get it from there. Else, run the verify procedure again to see it the device thinks it’s connected. If you are getting double devices added in ST, then use the app to see which one is responding to button 1 presses on the recent page and force delete the ones not connecting. If you are getting good button 1 presses, then your device is connected good and the devicetype is working good, you just need to run the smartapp and configure the rest of the buttons, still bad then hit the Configure Tile to resend the data to the device, still bad try a Zwave repair (could take 15-30 mins for a lot of devices) and then retry smartapp configure and Configure Tile again.
This device relies on a good clean network mesh cause it may have to go through several walls, also ensure you are not mounting it in a metal box, is so, try programming it outside the box, once setup the network mess should help the device operate, just need clean signals during setup, once in the network, your other devices will learn to relay the info to it. A Zwave repair also helps the network learn all the connections and relays to get to a device. I’d eliminate this by wiring it to an extension cord plug and plugging it in near the hub to ensure it was not unobstructed, once programmed you can them move it to it’s final location.
Good device, SmartApp and DeviceType, just a little tricky sometimes… Sorry about the long mess above, Good Luck…
Thank you, your detailed post gave me information to at least know that it was truly excluded.
The weird thing is mine would flash forever when I put it in include mode, nut just 5 times and then stop.
I pulled it out of the box, that didn’t help.
I moved the hub right next to it, that didn’t help.
Finally, I went out and tripped the breaker and then waited a minute and then tripped it back on.
Went back in and it paired on the first try. _(ツ)_/¯
I hit the configure tile and saw all of the messages appear and then I could see button presses.
The smart app didn’t seem to be working until I went back and found the debounce setting under the advanced + menu. I think that should just be there visible by default. It is definitely a requirement that you have debounce, I couldn’t get it to work at all until I added a value there.
Thanks, everyone for the help. This is awesome!