Rule Machine Version 1.7 Released

I have the following problem I have created a rule that when I open one of my doors a light will toggle to alert me or remind me to disable smart alarm from the IRIS keypad. As it is now it either turn the light on or off depending on the condition I left it in. What I really need is the light to flash on and off a few times. Below are my settings, but I haven’t found a rule condition for flash. Any ideas would be appreciated. I tried a few different routines created as Smart apps but never got them to work properly.


There are ways to do it looping the private boolean (see @bravenel example above or below link). Unfortunately, you won’t get the flash to work reliably in ST due to the scheduling issues.

I have deleted the rules from this post, because of the schedule issues and the unlikelihood that this will work. See post below about custom device handler. That works.

2 Likes

As @SBDOBRESCU said, there’s no way to reliably blink a light on and off with ST. There is just too much variability in mesh networks and cloud processing.

However, there are some switch devices that have a built in “flash” command (accessed with alarm(), if I remember correctly). I use Aeon Micro Switches in a few places, and using a custom device handler, I can send those a command to blink rapidly on and off. I use this to alert me if my back yard gates are open at the same time as I open my back door.

@Mike_Maxwell wrote the amazing DH. It’s the “aeonSwitch” DH here:

This isn’t a command that can be added to any old z-wave switch… the switch itself must be designed to support this. There may be others, but the Aeon micro switches are the only ones I know of.

1 Like

Will this work with other switches that are Open?Closed Magnetic ried switches?

Yes, you can use Contact as a capability, and that should pick up things that report open / closed.

Bruce I am using Contact, but I can’t figure out how to get the light to flash rather than just go on or off.

I found another way to do this, by using a custom device handler. I just modified a dimmer switch device handler to had a command “flash”. Then I made my office light have that device type. Then I used Expert Features in Rule Machine to find and save the flash command as a Custom Command.

Then this trigger makes it flash on and off 3 times (note, name "Office 3 is coincidence, 3 means nothing):

The code for the device handler is here: https://github.com/bravenel/SmartThings/blob/master/Dimmer%20Switch%20with%20Flash

i have part done but can’t get the rule action Delayed off 100 mil;iseconds. I can’t find it under actions. What am I missing


It’s under Turn On/Off after a Delay.

But, I wouldn’t waste more time on this approach. The one with the custom device handler works much better.

OK tried your device handler but it wouldn’t install got errors. Any ideas? Here is error on creating from code.
Org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: script14559967079472024179544.groovy: 222: unexpected token: API @ line 222, column 8. Status API Training Shop Blog About Pricing ^ 1 error

You did something wrong in the copy and paste.

From the Github link, click on Raw, then select all and copy.

In the IDE, My Device Handlers, New Device Handler, From Code, paste, then Create, then Publish For Me.

OK got that fixed, now how do I get it into the rule as I can’t find the place to link it to or expert features. As You can see I am lost. The select actions is where I am stopped now. the device type is created but the switch i am using is a z-wave on off, your device doesn’t even show in things.

Go back to the Rule Machine main page, and click on Expert Features. Click on Configure Custom Commands, and then for Test device, put in the device with the custom device handler. Then it should show you all of the available commands, one of which is flash; select flash. Save it, and hit Done until you are back to the main page. After that, flash will be available as an action at the very bottom of actions, Run custom commands.

That custom device handler is for a z-wave device. There would need to be a different one for a zigbee device. I just worked one of those up and tested it with an OSRAM bulb. That works also.

Thanks for trying it couldn’t link the z-wave switch to your device handler so flash was not an option. I appreciate the help, but it must be above my skill level as your instructions are easy to follow.

Are you using a z-wave device? If so, did you edit its device type to be the custom device type?

If not, what type of device is it?

It is a GE Z-Wave On/Off switch, so it should have had the options available. I started again but your device type does not show. So I selected Hallway Switch but went to custom commands and flash missing. I guess somehow I have to use your device type for my switch, but not sure how.

OK, so that device handler was for a dimmer. Try this other one for a switch. Same process.

Github: https://github.com/bravenel/SmartThings/blob/master/Z-Wave%20Switch%20with%20Flash

How do I associate this switch with your device type?

In IDE, My Devices, find that switch, click on its name, then click on Edit, then for Type, use the pull down menu to select Z-Wave Switch with Flash, then hit Update.

Then in Expert Features, it should see the flash command when you select that switch. I just tested this with a z-wave switch, and the timing isn’t perfect, but it works – certainly enough to get your attention.