14. Adding a Button Node

Next, we can drag and drop a button node into the canvas. This will be used to turn on and off the fish tank food dispensary.

Next, double-click on the button node and change the following parameters

In the Label parameter, we will write the following

{{payload}}

If you experience issues, use

{{msg.payload}}

In the Background parameter, we will write the following

{{colour}}

If you experience issues, use

{{msg.colour}}

In the payload, we will have a string value of

press

These parameters will allow us to change the color and icons of the button with our logic code that will be implemented in the next step.

Click Done once completed

Last updated