You can set the parameters you wanna pass into the widget by configuring it in here first !

attributeService = $scope.$injector.get('attributeService');
inside self.onIni
function, this will get the Attributes you just set on the widget datasource.
After this, you gotta recover this info inside the widget. I would suggest you to do this into the self.onDataUpdated
function (thingsboard uses AngularJS) so the button will update with the value.
self.onDataUpdated = function () {
for (let i=0;i<subscription.data.length;i++) {
let attributeValue = subscription.data[i].data[0][1];
let dataKey = subscription.data[i].dataKey.name;
if (dataKey === 'active') {
$scope.activeVal = (attributeValue === 'true');
}
}
};
The is here constantly going thru every single attribute, checking if the name matches with 'active', if yes, $scope attribute activeVal = active values you passed to the widget.
Thank it.