Generic timer device type

This topic came up in @bravenel’s rule machine thread.
Rather than continue to hijack that thread, I’ve created this one specifically for this device.
In any event I created a device type that allows you to wire together two smart app events with a configurable delay between them.
The device responds to on() and setLevel()
When issued an on command, the device will turn off after the interval that’s configured in preferences.
When issued a setLevel command, the device will turn off using the level in minutes as the delay.
When the device turns off, in addition to the off event the device issues a button 1 pressed event.
So app 1 turns the device on – the timer is started – then app 2 responds to the button press or off event…


I think I figured out why I was having trouble with this. I was expecting it to act like one of those timer light/fan switches. Turn it on and the timer counts down and turns off the load… so unless this code were to get integrated with a physical device type (like generic z-wave switch) it won’t work like that on it’s own.

so is this device currently the most direct way to implement trigger-delay in Rule Machine? I haven’t got through that enormous release thread.

Cool hack. I love the intro (“so I crapped out a timer”) . I though you misspelled it Timmer in the header and then realized that it was intentional contraction of timer and dimmer.

Lol, I forgot all about this, I think by now you should be able to do this directly in rule machine, I came up with this pretty early in the rm game. I can guarantee if you can’t figure it out, some one on one of the rm threads already has.

1 Like