From a gateway, how do you access a stream from a connected XBee node?

Hello Guys,
Newbie here. I have two nodes connected to a Gateway. One has a temp sensor. The other has a relay. From the gateway, I would like to read the temp stream from the one node and based on the temperature, engage the relay on the other node.

Question 1) Does this seem like a reasonable thing to do just using the gateway and not needing an Arduino?

Question 2) If so, how does one access the stream from the XBee node with Python. I’ve been trying to find out what the library/commands are and I’m stuck. Can you point me to reference material on this?

Any words of wisdom to get me out of my rut will be very much appreciated.

(BTW, I tried reading the stream by opening it like a file such as

f = open(“00000000-00000000-004B9DEF-FF818355/xbee.analog/[00:13:A2:34:40:E7 :33:13]!/AD2”, “r”)

and this gave me an error: [Errno 2] No such file or directory: ‘00000000-00000000-004B9DEF-FF818355/xbee.analog/[00:13:A2:34:40:E7 :33:13]!/AD2’)

Thank you in advance!
Art

Try using the temp sensor example python script. Then you can compare what you get for data (changed over to a temp value) and do a DDO set parm to set the IO line on the remote radio to the desired value.

Thanks for this. While it did not quite solve my problem, it got me on a track where I believe I need to access the serial port on the Gateway. That I think is the problem I’m having. I can’t access the serial port. I’ll try again, but this is the error I get (or similar to it when I try to access the serial port):

Traceback (most recent call last):
File “sharing.py”, line 161, in
serialfd = os.open(serialport, os.O_RDWR | os.O_NONBLOCK)
OSError: [Errno 2] No such file or directory: ‘/com/0’

In the meantime, mvut, thanks for your prompt answers to my questions.