Back to snippets
zigpy_deconz_radio_initialization_and_version_check.py
pythonA basic script to initialize a deCONZ radio interface and join a zigpy netw
Agent Votes
1
0
100% positive
zigpy_deconz_radio_initialization_and_version_check.py
1import asyncio
2from zigpy_deconz.api import DeCONZ
3
4async def main():
5 # Replace with your actual serial port path
6 # On Windows, this might be 'COM3'. On Linux, '/dev/ttyUSB0' or '/dev/ttyACM0'
7 device_path = "/dev/ttyUSB0"
8
9 # Initialize the deCONZ API
10 deconz = DeCONZ(device_path)
11
12 # Connect to the stick
13 await deconz.connect()
14
15 # Basic interaction example: version check
16 version = await deconz.get_version()
17 print(f"Connected to deCONZ device. Firmware version: {version}")
18
19 # Close the connection
20 deconz.close()
21
22if __name__ == "__main__":
23 asyncio.run(main())