To control your device, use d[x], where x is the device index. Devices are indexed based on the order of the COM ports specified by the -d option. The first device, d[0], can also be accessed using device. Type d[x]. and hit tab to see the available methods. Python 3.7.2 (tags/v3.7.2:9a3ffc0492, Dec 23 2018, 23:09:28) [MSC v.1916 64 bit (AMD64)] Type 'copyright', 'credits' or 'license' for more information IPython 7.2.0 -- An enhanced Interactive Python. Type '?' for help. In [1]: db = MeshDB("database/example_database.json") In [2]: p = Provisioner(device, db) In [3]: 2019-02-27 19:40:00,844 - INFO - COM22: Success 2019-02-27 19:40:00,847 - INFO - COM22: Success 2019-02-27 19:40:00,852 - INFO - COM22: SubnetAdd: {'subnet_handle': 0} 2019-02-27 19:40:00,857 - INFO - COM22: AppkeyAdd: {'appkey_handle': 0} 2019-02-27 19:40:00,863 - INFO - COM22: AppkeyAdd: {'appkey_handle': 1} In [3]: p.scan_start() In [4]: 2019-02-27 19:40:06,438 - INFO - COM22: Success 2019-02-27 19:40:08,367 - INFO - COM22: Received UUID 3f2e408b740b17468059fdb1f7e63985 with RSSI: -41 dB 2019-02-27 19:40:08,398 - INFO - COM22: Received UUID 2b7a78cb8012ba4486acb023630c3875 with RSSI: -27 dB In [4]: p.scan_stop() In [5]: 2019-02-27 19:40:11,698 - INFO - COM22: Success In [5]: p.provision(uuid="2b7a78cb8012ba4486acb023630c3875", name="Light bulb" ...: ) In [6]: 2019-02-27 19:40:49,249 - INFO - COM22: Provision: {'context': 0} 2019-02-27 19:40:49,259 - INFO - COM22: Link established 2019-02-27 19:40:49,308 - INFO - COM22: Received capabilities 2019-02-27 19:40:49,308 - INFO - COM22: Number of elements: 1 2019-02-27 19:40:49,312 - INFO - COM22: OobUse: {'context': 0} 2019-02-27 19:40:49,509 - INFO - COM22: ECDH request received 2019-02-27 19:40:49,516 - INFO - COM22: EcdhSecret: {'context': 0} 2019-02-27 19:40:51,734 - INFO - COM22: Provisioning complete 2019-02-27 19:40:51,734 - INFO - COM22: Address(es): 0x10-0x10 2019-02-27 19:40:51,734 - INFO - COM22: Device key: 79f98625056f50a27c685316c5f5d604 2019-02-27 19:40:51,735 - INFO - COM22: Network key: 18eed9c2a56add85049ffc3c59ad0e12 2019-02-27 19:40:51,735 - INFO - COM22: Adding device key to subnet 0 2019-02-27 19:40:51,735 - INFO - COM22: Adding publication address of root element 2019-02-27 19:40:51,741 - INFO - COM22: DevkeyAdd: {'devkey_handle': 8} 2019-02-27 19:40:51,742 - INFO - COM22: AddrPublicationAdd: {'address_handle': 0} 2019-02-27 19:40:51,834 - INFO - COM22: Provisioning link closed In [6]: p.provision(uuid="3f2e408b740b17468059fdb1f7e63985", name="Light switc ...: h") In [7]: 2019-02-27 19:41:30,955 - INFO - COM22: Provision: {'context': 0} 2019-02-27 19:41:31,020 - INFO - COM22: Link established 2019-02-27 19:41:31,076 - INFO - COM22: Received capabilities 2019-02-27 19:41:31,077 - INFO - COM22: Number of elements: 3 2019-02-27 19:41:31,080 - INFO - COM22: OobUse: {'context': 0} 2019-02-27 19:41:31,286 - INFO - COM22: ECDH request received 2019-02-27 19:41:31,292 - INFO - COM22: EcdhSecret: {'context': 0} 2019-02-27 19:41:33,652 - INFO - COM22: Provisioning complete 2019-02-27 19:41:33,652 - INFO - COM22: Address(es): 0x11-0x13 2019-02-27 19:41:33,652 - INFO - COM22: Device key: 11f84c5c3bfa51078781df2925878df9 2019-02-27 19:41:33,652 - INFO - COM22: Network key: 18eed9c2a56add85049ffc3c59ad0e12 2019-02-27 19:41:33,653 - INFO - COM22: Adding device key to subnet 0 2019-02-27 19:41:33,653 - INFO - COM22: Adding publication address of root element 2019-02-27 19:41:33,658 - INFO - COM22: DevkeyAdd: {'devkey_handle': 9} 2019-02-27 19:41:33,658 - INFO - COM22: AddrPublicationAdd: {'address_handle': 1} 2019-02-27 19:41:33,759 - INFO - COM22: Provisioning link closed In [7]: cc = ConfigurationClient(db) In [8]: device.model_add(cc) In [9]: cc.publish_set(8, 0) In [10]: cc.composition_data_get() In [11]: 2019-02-27 19:42:07,272 - INFO - COM22: PacketSend: {'token': 1} 2019-02-27 19:42:07,280 - INFO - COM22: {event: MeshTxComplete, data: {'token': 1}} In [11]: cc.composition_data_get() In [12]: 2019-02-27 19:42:13,532 - INFO - COM22: PacketSend: {'token': 2} 2019-02-27 19:42:13,539 - INFO - COM22: {event: MeshTxComplete, data: {'token': 2}} 2019-02-27 19:42:13,611 - INFO - COM22.ConfigurationClient: Received composition data (page 0x00): { "cid": "0059", "pid": "0000", "vid": "0000", "crpl": 40, "features": { "relay": 0, "proxy": 0, "friend": 2, "low_power": 2 }, "elements": [ { "index": 0, "location": "0000", "models": [ { "modelId": "0000" }, { "modelId": "0002" }, { "modelId": "1000" } ] } ] } In [12]: cc.appkey_add(0) In [13]: 2019-02-27 19:42:35,112 - INFO - COM22: PacketSend: {'token': 3} 2019-02-27 19:42:35,154 - INFO - COM22: {event: MeshTxComplete, data: {'token': 3}} 2019-02-27 19:42:35,183 - INFO - COM22.ConfigurationClient: Appkey status: AccessStatus.SUCCESS 2019-02-27 19:42:35,187 - INFO - COM22.ConfigurationClient: Appkey add 0 succeded for subnet 0 at node 0010 In [13]: cc.model_app_bind(db.nodes[0].unicast_address, 0, mt.ModelId(0x1000)) ...: In [14]: 2019-02-27 19:42:48,298 - INFO - COM22: PacketSend: {'token': 4} 2019-02-27 19:42:48,308 - INFO - COM22: {event: MeshTxComplete, data: {'token': 4}} 2019-02-27 19:42:48,327 - INFO - COM22.ConfigurationClient: Model app bind status: AccessStatus.SUCCESS 2019-02-27 19:42:48,330 - INFO - COM22.ConfigurationClient: Appkey bind 0 to model 1000 at 0010 In [14]: cc.publish_set(9, 1) In [15]: cc.composition_data_get() In [16]: 2019-02-27 19:43:13,904 - INFO - COM22: PacketSend: {'token': 5} 2019-02-27 19:43:13,907 - INFO - COM22: {event: MeshTxComplete, data: {'token': 5}} 2019-02-27 19:43:13,984 - INFO - COM22.ConfigurationClient: Received composition data (page 0x00): { "cid": "0059", "pid": "0000", "vid": "0000", "crpl": 40, "features": { "relay": 0, "proxy": 0, "friend": 2, "low_power": 2 }, "elements": [ { "index": 0, "location": "0000", "models": [ { "modelId": "0000" }, { "modelId": "0002" } ] }, { "index": 1, "location": "0000", "models": [ { "modelId": "1001" } ] }, { "index": 2, "location": "0000", "models": [ { "modelId": "1001" } ] } ] } In [16]: cc.appkey_add(0) In [17]: 2019-02-27 19:43:20,485 - INFO - COM22: PacketSend: {'token': 6} 2019-02-27 19:43:20,529 - INFO - COM22: {event: MeshTxComplete, data: {'token': 6}} 2019-02-27 19:43:20,555 - INFO - COM22.ConfigurationClient: Appkey status: AccessStatus.SUCCESS 2019-02-27 19:43:20,561 - INFO - COM22.ConfigurationClient: Appkey add 0 succeded for subnet 0 at node 0011 In [17]: cc.model_app_bind(db.nodes[1].unicast_address + 1, 0, mt.ModelId(0x10 ...: 01)) In [18]: 2019-02-27 19:43:28,291 - INFO - COM22: PacketSend: {'token': 7} 2019-02-27 19:43:28,304 - INFO - COM22: {event: MeshTxComplete, data: {'token': 7}} 2019-02-27 19:43:28,319 - INFO - COM22.ConfigurationClient: Model app bind status: AccessStatus.SUCCESS 2019-02-27 19:43:28,323 - INFO - COM22.ConfigurationClient: Appkey bind 0 to model 1001 at 0012 In [18]: cc.model_publication_set(db.nodes[1].unicast_address + 1, mt.ModelId( ...: 0x1001), mt.Publish(db.nodes[0].unicast_address, index=0, ttl=1)) In [19]: 2019-02-27 19:43:45,194 - INFO - COM22: PacketSend: {'token': 8} 2019-02-27 19:43:45,246 - INFO - COM22: {event: MeshTxComplete, data: {'token': 8}} 2019-02-27 19:43:45,293 - INFO - COM22.ConfigurationClient: Model publication status: AccessStatus.SUCCESS 2019-02-27 19:43:45,297 - INFO - COM22.ConfigurationClient: Publication status for model 1001 at element 18 to {'address': 0010, 'index': 0, 'ttl': 1, 'period': 0, 'retransmit': {'count': 0, 'interval_steps': 0, 'interval': 50}, 'credentials': } In [19]: cc.publish_set(8, 0) In [20]: cc.model_publication_set(db.nodes[0].unicast_address, mt.ModelId(0x10 ...: 00), mt.Publish(db.groups[0].address, index=0, ttl=1)) In [21]: 2019-02-27 19:44:25,785 - INFO - COM22: PacketSend: {'token': 9} 2019-02-27 19:44:25,823 - INFO - COM22: {event: MeshTxComplete, data: {'token': 9}} 2019-02-27 19:44:25,879 - INFO - COM22.ConfigurationClient: Model publication status: AccessStatus.SUCCESS 2019-02-27 19:44:25,883 - INFO - COM22.ConfigurationClient: Publication status for model 1000 at element 16 to {'address': c001, 'index': 0, 'ttl': 1, 'period': 0, 'retransmit': {'count': 0, 'interval_steps': 0, 'interval': 50}, 'credentials': } In [21]: cc.publish_set(9, 1) In [22]: cc.model_subscription_add(db.nodes[1].unicast_address + 1, db.groups[ ...: 0].address, mt.ModelId(0x1001)) In [23]: 2019-02-27 19:44:40,968 - INFO - COM22: PacketSend: {'token': 10} 2019-02-27 19:44:40,987 - INFO - COM22: {event: MeshTxComplete, data: {'token': 10}} 2019-02-27 19:44:41,009 - INFO - COM22.ConfigurationClient: Model subscription status: AccessStatus.SUCCESS 2019-02-27 19:44:41,012 - INFO - COM22.ConfigurationClient: Added subscription 'c001' to model 1001 at element 0012