Pressing rule in command sequence philips 4 buttons

as it could be done to program a rule that by pressing the buttons of a 4-button remote, an action will be executed in a specific order. The idea is a series of 5 keystrokes where the first one is the trigger.

I am very confused .. Could you expand on this a bit? .. I'm having trouble following what you are trying to do..

with a four-button philips knob, an action is executed if I press them in a certain order.

button 1 pressed

button 1 pressed

button 4 pressed

button 2 pressed

button 3 pressed

only if it is done in that order is it executed.

I don't have anything set up quite like this, but I think you could do it with Rule Machine and a "Button Device" trigger, along with careful variable-setting. (A custom app could do something like this behind the scenes for you, but I'm not aware of any that exist.) If you want to need to press buttons 1, 1, 4, 2, and 3 that order...maybe something like this:

Create a local string variable named currentValue or whatever you want; default value of "IDLE" or something would work. Then:

Button 1 pushed actions:

IF (currentValue is "IDLE") THEN
  Cancel Delayed Actions
  Set currentValue to "1a"
  Set currentValue to "IDLE" <-- delay 0:00:30 (cancelable)
ELSE-IF (currentValue is "1a") THEN
  Cancel Delayed Actions
  Set currentValue to "1"
  Set currentValue to "IDLE" <-- delay 0:00:30 (cancelable)
ELSE
  Set currentValue to "IDLE"
END-IF

Button 4 pushed actions:

IF (currentValue is "1") THEN
  Cancel Delayed Actions
  Set currentValue to "4"
  Set currentValue to "IDLE" <-- delay 0:00:30 (cancelable)
ELSE
  Set currentValue to "IDLE"
END-IF

Button 2 pushed actions:

IF (currentValue is "4") THEN
  Cancel Delayed Actions
  Set currentValue to "2"
  Set currentValue to "IDLE" <-- delay 0:00:30 (cancelable)
ELSE
  Set currentValue to "IDLE"
END-IF

Button 3 pushed actions:

If (currentValue is "2") THEN
  Cancel Delayed Actions
  // Do your stuff here
  Set currentValue to "IDLE"
ELSE
  Set currentValue to "IDLE"
END-IF

I haven't tested this and didn't think about it for a ton of time, but something more or less along these lines should work. It's obviously a bit hack-y and I'm doing some things you didn't mention to probably make it behave more like you want (if you press something out of order, the variable gets reset; the variable also gets reset after 30 seconds if you don't finish pressing in this order before then). Anyone, let me know if you see any problems.

I would under no circumstances recommend this instead of an actual keypad, but since you're asking, I'm assuming you know what you're doing and have some ideas for how you might want it to work. :slight_smile:

As @bertabcd1234 said, this type of thing is much more suited to an app. I played with it and came up with a RM rule that works for correct and incorrect sequences, but my gosh is it tedious.

Still a lot better than the rule I came up with tracking the state with a variable! :laughing: But I do agree that an app would probably be easier (which I suppose is also true in general)--or, in this case, a real keypad. But as usual with Hubitat, there are multiple means to the same end.

1 Like

Thank you all very much, I will try these solutions. If an application came out and you did not see it, I would appreciate it if you let me know here. Cheers