Digi modules have the ability to transmit the state of their various analog and digital lines. This is done with the 'IS' command. This will force the module to send it's line states in a packet. It is a common question to ask how to translate or parse this packet.
The answer to that will depend on what kind of xbee radio is being used. Please see the product manual on Digi's website. It will have the structure of the IS packet. That should be used as a roadmap.
One note of caution. Lines that are disabled are not included in the IS packet.
Here is an example of an xbee ZB IS packet mapping. The product manual on pg. 108-110 explains this mapping:
Last updated: Aug 23, 2017