For now, there is no option to delete a sensor variable alone from the GUI. So I'm providing an option to delete a sensor variable from a script.
Note: This API available from 1.4.0.Final
version.
- Now get
SensorVariable
id from Sensors page. Resources >> Sensors >> Click on view details
,
Now click on edit of sensor variable
On the URL you can see sensor variable id, This is id is important note it for your target sensor variable
Add the following script on your controller,
Extension: JavaScript
Type: Operation
var myImports = new JavaImporter(java.io, java.lang, java.util);
with(myImports) {
// pass sensor variable as bindings, example: { id: 99 }
mcApi.sensor().deleteSensorVariable(id);
}
Execute the script as Run now
(select the script and in Actions
you can see Run now
),
Pass the sensor variable id as bindings, here it is { id: 99 }
,
Click on Run
. All done. Now your Sensor variable
removed from MyController.