<aside> đź’ˇ THE STARTING POINT (actually the template is completed and usable for all different cases):

Button Bar input example flow.json

</aside>


  1. You start with a MQTT-IN node that runs under the topic of your button bar (as defined in documentation)

    Untitled

  2. Connect this node to to a json node to convert the pure string to a message object.

    Untitled

  3. After that you will need a typical logic fo each of the buttons that can be pressed:

    Untitled

    1. “the button x pressed” function:

      var curr ;
      curr = parseInt(msg.payload["Input 1"]);
      
      msg.payload={
          "timestamp_ms": Date.now(),
          "value": curr
      }
      return msg;
      
    2. the filter and the timer function working together to filter for value changes but also to keep track of the current value. (details in the .json file above)

    3. The second timer works as a border only letting one value through every second.

  4. At the end you need one MQTT-OUT node for every button

    Untitled