Lights Cycle Rule with a physical button

Hi Sharptools people. I would like to set a rule (not a bunch of rules) that can cycle different light scenes.
Now there are some virtual buttons for each scene, and I want to use a Smartthing button that with each “One push” triggers next scene including light OFF, I had tried and tested some options but without any nice result (crazy scenes…on/off randomly…, etc) ANY TIPS ?


@Carlos_Juarez, can you post the rule you have tried so we may get a better idea what you are trying to achieve, and maybe give you some feedback based on rules you created?

1 Like

Of course my friend, I cannot get why it is not working, maybe I can track it with log feature …

Thanks for the screenshot. The logic looks alright. Have you checked the rule execution logs and see if any part of the Flow not working as expected? You can also check the IF condition’s log details to see the runtime data what it retrieved when comparing the variable values to help troubleshooting.

1 Like

Hi my friend, I have tested and getting fun…something is really strange:

1.- As you said, logic seems okey, RULE LOG IS OK, the rule handles cycle counter okey, also the correct IF runs and discard other once control switch is off.

2.- The Issue is for some strange reason after light is set accord the scene, randomly it goes off. For example, cycle switch goes from 1 to 2, scene is RELAX, light goes to RELAX color+level but after a second the light turns off, after the next button push the cycle switch goes from 2 to 3, light goes to NIGHT AMBIENCE and after a second the light turns off. The light turns off RANDOMLY !! :thinking:
50% of the times works okey, the light switches to next cycle and stays, but sometimes it goes off.

3.- I tested the scene dashboard with the same virtual buttons for the scenes, those ones that are pushed in the rule and light works normally (it does not go off), but when the virtual button is pushed inside the rules then this strange issue appears (light goes off randomly).

4.- I tried to change from “PUSH” command to "ON command and I still got the same issue, randomly light off. Also I moved the PUSH/ON command at the end of each THEN section, and I got the same issue

5.- I checked on line with my scene dashboard, when I push the physical button I see the right virtual button flashes in the Sharptools dashboard, light goes on right but then goes off and stays off. I checked in HUE Philips app, and still the same

Conclusion: Pushing virtual scenes buttons works perfectly, but when they are pushed inside the rule lights goes off randomly (50% of the times).

ANY TIPS ? Or I am in the Twiligt Zone …?!?

PD: I tested substituting the virtual buttons by setting light color and level with Sharptools light device settings and I got the same !!!. sometimes light goes off. :thinking: :thinking: :thinking:

@Carlos_Juarez a few thoughts:

  1. Can you review and post the automation setup for triggering scene by the virtual button? Does the automation simply execute the scene, and nothing else?

  2. Have you review the virtual button’s event history in the SmartThings IDE site and compare the difference between events generated by tapping from the dashboard and executed in rule?

  3. Do you have any other automation/rules that turn the light off? Can you temporary disable them and see if that makes any difference?

1 Like

Hi my friend, I think its solved, besides the fun the learning is a plus, this is what happened…

  1. When I paired the Smartthings button in the process the push/double push/held actions are asked, so I set up the push one as ON/OFF the light.

  2. When I set the Sharptools rule, I deleted the correspondent automation (push), I checked in the button device setting and it was blank, there was no automation associated to push action.

  3. Problem appears (bedroom light going off randomly)…

  4. Yesterday I looked for something that could turns the light off without success, but I tried setting a new automation actions for PUSH (turn off stairs light)…

  5. When I tested PUSHing the button the stairs light went off but ALSO the bedroom light went off!!!.. each push turned off both lights !!..but there was only one automation setting for push command (turning off stairs light)…so there was like a GHOST automation for PUSH: bedroom turn off light

  6. I tried some actions but I cannot avoid turning off bedroom light so I decided delete device and pair it again but this time without any initial programmed setting just to let Sharptool handles the actions.

  7. Problem solved


  • For this device+DTH (Smartsense button) a “ghost” setting could be remained from initial device setting.
  • The Sharptools rule works fine for light cycle

Thanks again for your kindly support.


@Carlos_Juarez, thanks for the updates and sharing the details. Glad to hear that you got it resolved. :+1:

1 Like