This project is created to control a Xbee S2 module of Digi International to control a HW with 2 outputs (releys) and control devices like blinds [UP (output UP) / DOWN (output DOWN)].
You can clone the repository here xbeeo2.
For test this project you need the following hardware.
Before check and execute xbeeo2.py script, you have to follow the instructions in the readme.txt file in the repository xbeeo2. The script xbeeo2.py is responsible for establishing the zigbee communication from the raspberry pi to XbeeO2 module.
As you can see in the schematic, we use the output D12(P2) to manage the UP and the output D11(P1) to manage the DOWN.
$ sudo ./xbeeo2.py -h
xbeeo2: appplication to ON/OFF two reles with ZigBee in API mode, version: 1.0
usage: ./xbeeo2.py [options]
--help (-h) this message
--test (-t) test outputs
--output (-o) number of output: {'0': D12, '1': D11}
--mode (-m) mode: {'0': OFF (0x04), '1': ON(0x05)}
--verbose (-v) print a message with the command sent