HABpanel - shell command

Hi all.

Is there an easy way to execute an command when pressing a button?
I would like to have a rollershutter with 3 Buttons. UP STOP DOWN.
When i click the button up it has to execute a command, when i click stop another, and when i click down it should execute the command for down.

Thanks in advance

Have you looked at the widget gallery? Plenty of roller shutter widgets there and if none of them do exactly what you want then they will likely only need a little modification.

Are you talking about ‘exec binding’ style execute a command? I suspect most of the widgets will result in a sendCommand style function or in widget style code ng-click sendCmd. If you want to do something different you can create your own item say RollerShutter as a String and then put a rule in place like this:

  rule "Rollershutter change..."
  when
    Item Rollershutter changed
  then
    switch Rollershutter.state.toString {
      case "UP": {
        // exec bind command UP
      }
      case "STOP": {
        // exec bind command STOP
      }
      case "DOWN": {
        // exec bind command DOWN
      }
   }
 end

Just change the widget you like to use sendCmd(RollerShutter, 'UP') when the appropriate button is pressed.