Is it possible to get the battery level of an Xbee node using digi web services?


Is it possible to get the battery level or the battery voltage of the Xbee devices using a RCI call or something else?

Thanks for your help,


Hi Benjamin,

I’m making a few assumptions about your setup. That you are running on a device that has the python interpreter, and that you have a means to upload RCI requests to the device.

To setup a RCI call to return a node’s battery level or voltage, you’ll have to use a python script to catch the RCI call, call the ‘IS’ AT command on the specified node, interpret the results, and return the values.

To setup the RCI callback, you need to use the ‘rci’ library and register a callback to process the incoming RCI request. See this link for more info:

Then you need to request the ‘IS’ AT command from the specified node using the xbee library’s ddo_get_param() function. See link for more info:

The ‘IS’ byte structure has a specified structure, depending whether you are running ZB or another XBee technology. Your appropriate radio manual will contain the definition. Additionally, the ‘low battery’ pin is also defined here, which changes per radio platform.

An alternative is the ‘%V’ value, which is available on some radio technologies. It returns the current supply voltage as the radio sees it.

Once you have your answer, just return the answer in the call back, and you’re done.

Hope this helps,

Thanks for your quick reply,

We will try to use a Python Script as you described it for this.


Just be aware that this ‘%V’ value is only the voltage on XBee Vcc (power input) pin. So if there is a voltage regulator between your battery and your XBee, you will only see the output of the regulator. All Digi XBee adapters are designed like this today.

So it might read 3.3v for a long time, then start dropping as the battery input to the regulator falls below the regulator’s required minimum to sustain 3.3v out. So you’ll only have a few weeks notice once the battery starts to drop - especially with lithium.

To get a true battery level you’ll need to design your own circuit to feed this voltage into an AD/analog pin. Just be aware that tapping the battery like this will add a small load to the battery, which will reduce your battery life some.

For now a few weeks notice seems enough.

Thanks for this interesting comment!


I think you can get the ‘%V’ value also with a:


I haven’t verified this however… not really sure if it would work. But if currently using web services it might avoid the need for writing a python script.

Although something to note if doing this through RCI is that if wrapped in SCI iDigi would cache the results, so be sure if you want it executed on the device to add the cached=“false” attribute to the send_message element.

Also if ever need mapping between the DDO and the long name used in the web services check the descriptor with:


and look at the alias attributes.

Hi thanks for your answer,

Is only available on new firmware? I have installed on my gateways and there is no supply_voltage available when I send a query_setting command.



Supply voltage is only available for query_state:

Which returns the supply voltage field for the XBee. Specifying the address like clohfink said will allow you to get the state from any node on the network.

I tried this :


But the response is :

              State group unknown

Is it because of the Firmware?



Try sending the query_state without the supply_voltage element supplied, like:


I do not believe the query_state request for zigbee supports requesting individual parameters. If the above works you should be able to see which values are returned and pull out the supply_voltage if present.

This is what I get with query_state without individual parameter :


There is no supply_voltage …



I don’t have a version device, but I did try it on level device and I have supply_voltage present in the query_state reply. If updated firmware is available you might want to give it a try, I’m not sure when supply_voltage was added.


I will try it with the new firmware as soon as I am able to upgrade it.