Help! Why does my light flash on then off?

I picked up a Samsung SmartThings button on Amazon when they were on sale. I'd like to use it to control my Lightify under cabinet light by pressing the button, which is attached to the refrigerator. I have tried creating several rules, the one below is the latest, but they all have the same effect: When I press the button, either nothing happens at all, or the light flashes on briefly, then off again. I have noted that, when nothing happens, the light generally changes and shows as being on in the dashboard, even though it actually isn't. Controlling the light from the dashboard works consistently with no issues. I believe the issue definitely lies with how Rule Machine is interacting with the device or even with the hub itself, since it makes the dashboard report incorrectly. What am I doing wrong?

First of all, you don't need to use an ELSE IF, you could just use an ELSE. Because your first condition is binary (only two states) you only need an else.

Second of all, your rule should have an END-IF at the end.

Third, every time you press the button, how many events are generated? Take a look at the Events page for the device. Check the timestamps. Make sure you're only getting one every time you press the button and aren't getting two.

Are these lights part of any other rules?

Can you turn on logging for the rule and try it again?

OK so I changed the rule as suggested and it worked a couple of times, then returned to the broken behavior. one press does nothing, the next gets a flash, the next does nothing, the next gets a flash. I've included the events I just captured as well.

Also, this light is not part of any other rules. Below is a section of log entries.

dev:782020-03-14 06:51:47.466 pm infoKitchen Sink was turned off

app:1292020-03-14 06:51:47.213 pm infoAction: END-IF

app:1292020-03-14 06:51:47.178 pm infoAction: Off: Kitchen Sink

app:1292020-03-14 06:51:47.170 pm infoAction: ELSE (do actions)

app:1292020-03-14 06:51:47.167 pm infoAction: Color Temperature: Kitchen Sink: 2600: 5 (skipped)

app:1292020-03-14 06:51:47.160 pm infoAction: IF (Kitchen Sink(on) is off(F) [FALSE]) THEN (skipping)

app:1292020-03-14 06:51:47.085 pm infoKitchen Sink - Button - Night Triggered

app:1292020-03-14 06:51:47.069 pm infoKitchen Sink - Button - Night: Button pushed 1

dev:972020-03-14 06:51:46.858 pm infoButton button 1 was pushed

dev:782020-03-14 06:51:45.234 pm infoKitchen Sink color temperature is 2702°K

dev:782020-03-14 06:51:45.231 pm infoKitchen Sink color is Incandescent

dev:782020-03-14 06:51:45.074 pm infoKitchen Sink is 5%

dev:782020-03-14 06:51:45.030 pm infoKitchen Sink is on

dev:782020-03-14 06:51:44.889 pm infoKitchen Sink was turned on

app:1292020-03-14 06:51:44.607 pm infoAction: END-IF

app:1292020-03-14 06:51:44.604 pm infoAction: Off: Kitchen Sink (skipped)

app:1292020-03-14 06:51:44.595 pm infoAction: ELSE (skipping)

app:1292020-03-14 06:51:44.539 pm infoAction: Color Temperature: Kitchen Sink: 2600: 5

app:1292020-03-14 06:51:44.532 pm infoAction: IF (Kitchen Sink(off) is off(T) [TRUE]) THEN

app:1292020-03-14 06:51:44.458 pm infoKitchen Sink - Button - Night Triggered

app:1292020-03-14 06:51:44.442 pm infoKitchen Sink - Button - Night: Button pushed 1

dev:972020-03-14 06:51:44.230 pm infoButton button 1 was pushed

dev:782020-03-14 06:51:41.502 pm infoKitchen Sink was turned off

app:1292020-03-14 06:51:41.249 pm infoAction: END-IF

app:1292020-03-14 06:51:41.221 pm infoAction: Off: Kitchen Sink

app:1292020-03-14 06:51:41.212 pm infoAction: ELSE (do actions)

app:1292020-03-14 06:51:41.208 pm infoAction: Color Temperature: Kitchen Sink: 2600: 5 (skipped)

app:1292020-03-14 06:51:41.199 pm infoAction: IF (Kitchen Sink(on) is off(F) [FALSE]) THEN (skipping)

app:1292020-03-14 06:51:41.106 pm infoKitchen Sink - Button - Night Triggered

app:1292020-03-14 06:51:41.085 pm infoKitchen Sink - Button - Night: Button pushed 1

dev:972020-03-14 06:51:40.777 pm infoButton button 1 was pushed

dev:782020-03-14 06:51:39.769 pm infoKitchen Sink is on

dev:782020-03-14 06:51:38.596 pm infoKitchen Sink color temperature is 2702°K

dev:782020-03-14 06:51:38.574 pm infoKitchen Sink color is Incandescent

dev:782020-03-14 06:51:38.439 pm infoKitchen Sink is 5%

dev:782020-03-14 06:51:38.414 pm infoKitchen Sink is on

dev:782020-03-14 06:51:38.200 pm infoKitchen Sink was turned on

app:1292020-03-14 06:51:37.954 pm infoAction: END-IF

app:1292020-03-14 06:51:37.948 pm infoAction: Off: Kitchen Sink (skipped)

app:1292020-03-14 06:51:37.935 pm infoAction: ELSE (skipping)

app:1292020-03-14 06:51:37.846 pm infoAction: Color Temperature: Kitchen Sink: 2600: 5

app:1292020-03-14 06:51:37.836 pm infoAction: IF (Kitchen Sink(off) is off(T) [TRUE]) THEN

app:1292020-03-14 06:51:37.708 pm infoKitchen Sink - Button - Night Triggered

app:1292020-03-14 06:51:37.690 pm infoKitchen Sink - Button - Night: Button pushed 1

dev:972020-03-14 06:51:37.405 pm infoButton button 1 was pushed

dev:782020-03-14 06:51:34.088 pm infoKitchen Sink was turned off

app:1292020-03-14 06:51:33.826 pm infoAction: END-IF

app:1292020-03-14 06:51:33.781 pm infoAction: Off: Kitchen Sink

app:1292020-03-14 06:51:33.777 pm infoAction: ELSE (do actions)

app:1292020-03-14 06:51:33.764 pm infoAction: Color Temperature: Kitchen Sink: 2600: 5 (skipped)

app:1292020-03-14 06:51:33.753 pm infoAction: IF (Kitchen Sink(on) is off(F) [FALSE]) THEN (skipping)

app:1292020-03-14 06:51:33.656 pm infoKitchen Sink - Button - Night Triggered

app:1292020-03-14 06:51:33.629 pm infoKitchen Sink - Button - Night: Button pushed 1

dev:972020-03-14 06:51:33.392 pm infoButton button 1 was pushed

dev:782020-03-14 06:51:32.605 pm infoKitchen Sink color temperature is 2702°K

dev:782020-03-14 06:51:32.602 pm infoKitchen Sink color is Incandescent

dev:782020-03-14 06:51:32.481 pm infoKitchen Sink is 5%

dev:782020-03-14 06:51:32.449 pm infoKitchen Sink is on

dev:782020-03-14 06:51:32.231 pm infoKitchen Sink was turned on

app:1292020-03-14 06:51:31.960 pm infoAction: END-IF

app:1292020-03-14 06:51:31.944 pm infoAction: Off: Kitchen Sink (skipped)

app:1292020-03-14 06:51:31.932 pm infoAction: ELSE (skipping)

app:1292020-03-14 06:51:31.643 pm infoAction: Color Temperature: Kitchen Sink: 2600: 5

app:1292020-03-14 06:51:31.622 pm infoAction: IF (Kitchen Sink(off) is off(T) [TRUE]) THEN

app:1292020-03-14 06:51:29.728 pm infoKitchen Sink - Button - Night Triggered

app:1292020-03-14 06:51:29.708 pm infoKitchen Sink - Button - Night: Button pushed 1

dev:972020-03-14 06:51:29.416 pm infoButton button 1 was pushed

So, i have a question....

Did you press the button twice within 4 seconds?

I had asked if you could confirm that one press equals one event. To do that, go the EDIT DEVICE page and click on EVENTS. Then, press the button once, refresh the page, how many new events do you see? Do that 10 times in a row. If all of them only show 1 event, then it's not a device problem. You'll have to look at the time-stamps because they will all be identical.

I probably did in that test. I tried again, waiting about 10 seconds between. The behavior hasn't changed. Looks like only one event per press.

Maybe a level of 5 is to close to the lights threshold for off? I have some Lightify BR30 bulbs that don't always come on unless I set them at 10 or more.

Here is the corresponding events for the light. None of the on events actually happened. The reality was that each off event was a flash on then off.

That was one of my first thoughts in working with this issue. I actually ultimately want the level at 1. I have tried raising it as far as 100 and it made no difference. I'm starting to suspect this is a bug. How do I enable Zigbee logging? Maybe then I could see if the light is actually being commanded on or not.

What kind of light is this? Do you have level prestaging turned on for the light?

Well, I guess changing the rest of the rule may have partially fixed it. I tried switching the value to 100 again and it seems to work consistently now. Now I just need to get that value down to a nice low level for late night usage.

Here is the light in question:
https://www.amazon.com/gp/product/B01M7NFPO7/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1

I am using the "Generic Zigbee CT Bulb (dev)" driver. Prestage is not enabled. I'm not sure what that does. I'm fairly new at this.

I have 4 of those, so it is not the light. However, these are very bad repeaters. So, your zigbee button might be having delayed messages to the hub if it is in close proximity to these lights.

Success! I enabled prestaging and dropped the transition time to 500ms on the device to see if that had any effect, it didn't. But the high value got me thinking and I realized that I have often seen many of my lights come on higher than the set point and then dim. I adjusted the rule as below and it seems to be working. Thanks for the help!

That isn't actually necessary but whatever you gotta do to make it work I guess.