Comment on page
Button Widget
User can change following things in button widget:
- Widget Name - Name for widget which will be used data referenceFor Example, if widget name is 'Button', then data of widget is referenced as Button.data as shown in below image.

Configure Button Widget
- Show Title - User can show/hide widget title
- Title Color
- Background Color

Configure Button Widget
In Widget Setting option, user can change following parameters:
- Value - value for Button.data parameter in JSON object, that will be used for onClick Event.
- Button Color
- Text Color
- Button Text

Configure Button Widget
Button widget does not support Source settings.
Button onClick event is provided. User can choose MQTT or Action mode for onClick event.
Using MQTT
User needs to provide following parameters:
- event - Select onClick event from dropdown
- mode - Select mode as MQTT
- topic - Enter topic name directly. No need to provide accountID.
- Data parameters - Add new data parameter item. Each data parameter item represent a key-value pair. So select required parameter and give key name to it.
As shown in below images, for onClick event, MQTT mode is selected. It means when user clicks on the button, it will publish configured data parameters on given MQTT topic.

Button Widget - Event handling using MQTT

Button Widget - Event handling using MQTT
So, as per the configuration shown in above images, when user clicks the button, JSON object with buttonKey-UserRole as key-value pair gets published on buttonData topic. Please refer below image for final output.

Button Widget - Event handling using MQTT
Using Action
User needs to provide following parameters:
- event - Select onClick event from dropdown
- mode - Select mode as action
- Action ID - Select required Action ID from dropdown
As shown in below images, for onClick event, action mode is selected. It means when user clicks on the button, it will trigger given Action with configured action parameters.

Button Widget - Event handling using Actions Widget

Button Widget - Event handling using Actions
So, as per the example given in above images, when user clicks a button, updateFirebaseCloud action will trigger with JSON object of buttonData-UserID as key-value pair as input.
Last modified 1yr ago