Button node: If msg arrives on input, emulate a button click:

I've been caught on this before I think but want to check.

What exactly does that mean?

This is the code this time:


I inject a value of 8 and go through the button.
But I get a 3 in the debug node.

So the emulate a button click means forget what is sent in, you are getting the output as though the button was pressed.

Not just pass the message through.

On the switch node (dashboard) it says this:

Pass though msg if payload matches new state

How does this compare to the button's pass through?

If payload matches new state

So sorry for the brain failure.
But I just want to check.

Emulate button click means exactly that, it is like pressing the button.

In your button node, you say 'send 3 when the button is pushed' so that is what is send whether you press the button or send a msg to the button which acts like you pressed the button - 3 gets sent out in msg payload,

1 Like

I know it was (probably) a stupid question, it just caught me out - maybe again.

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