Command system.checkbattery

The command system.checkbattery is used to return the current percentage of battery.

Parameters

  1. variablestatus [integer]
    Variable that will store the return of the command. The returned value ranges from 0 to 100, scaling 1 by 1. Examples: 0, 1, 2, 3, 4, 5 ... 95, 96, 97, 98, 99, 100.

The value -1 means that the device has no battery.

Example


In the example above, the command system.checkbattery will return to integervariable $( battery_status). As variablestatus only accepts an integer value, it is necessary to convert the value to stringvariable to display the value onscreen.