Exec node with dashboard switch?


I want to use a dashboard ui_switch as this:

  • on : start the exec node
  • off: stop the exec node

I've tried those settings but everytime the OFF state is triggered it start a new process leaving current running:

Is there a way to manage this directly or should I've add a function node that manage the behavior i.e. if input from switch is true, then do nothing if already running?

Thank you

If you check the sidebar info for the exec node you will see it need msg.kill to kill / stop it - not a msg.payload - so you need a split node (to separate on and off) and the a change node in the off leg to set msg.kill to SIGTEM.

Thank for reply, I've found a simple solution: set the switch value to string and set here the commands, leaving the exec node empty.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.