• Well, in the first instance, I'd drag in a 'function' block and add the following code inside it:

    msg.payload = `Alert, the button was pressed. This is the ${msg.payload} press since power cycle.`;
    return msg;
    

    And for the second option, you can use flow.get/set:

    Add a function block to the battery message

    flow.set('battery', msg.payload);
    return msg;
    

    Add a function block to the click message:

    msg.payload = `Alert, the button was pressed. This is the ${msg.payload} press since power cycle. Battery level is ${flow.get("battery")}`;
    return msg;
    

    Hope that helps!

About

Avatar for Gordon @Gordon started