Zigbee支持标准窗帘簇开发流程摘录

一、查阅ZCL文档,docs-07-5123-05-0afg-zigbee-cluster-library-specification关于窗帘部分

二、对窗帘重点部分进行标注

三、工程配置Simplicity Studio配置

四、保存配置项、进行generate, 对Callbacks声明的函数进行定义

五、client端命令如下

/*1、client端 control cmd */

zcl window-covering down

zcl window-covering up

zcl window-covering stop

zcl window-covering go-to-lift-percent 30

zcl window-covering go-to-lift-percent 50

zcl window-covering go-to-lift-percent 80

zcl window-covering go-to-lift-percent 100

send 0x9c79 0x01 0x01

/* 2、join network */

plugin network-steering start 1

/*3、 bind server client */

zdo bind [NWK.dst][src endpoint][dst endpoint][cluster id][src IEEE][dst IEEE]

zdo bind 0x9C79 0x01 0x01 0x0102 {90 FD 9F FF FE 16 37 EF} {00 0D 6F FF FE 74 BB 9C}

/* 4、window covering scene */

[group id][scene id][transitionTime (S)][scene name][0x32 0x01 0x0102(0x32:percent 0x01:len 0x0102:cluster id)]

zcl scenes add 0x0000 0x12 0x09 "222" 0x32010102

zcl scenes recall 0x0000 0x12

send 0x9c79 0x01 0x01

/* 5、change window covering motor direction or deletel route(normal mode or calibration mode)*/

[cluster id][attribute id][data type][value]

zcl global write 0x0102 0x0017 0x18 {ff}

zcl global write 0x0102 0x0017 0x18 {f0}

send 0x9c79 0x01 0x01

/* 6、send to destionaiton */

[NWK.dst][src endpoint][dst endpoint]

send 0x9c79 0x01 0x01

六、配合zigbee抓包器,调试记录如下

(注明:Server板和Client板分别烧写对应程序,Client端程序在工程配置时需要支持CLI功能,然后利用串口工具发送特定命令

前提:Server和Client加入同一网络,之后通过发送绑定指令双方绑定,绑定成功才可发送控制命令,否则,失败。相关命令发送过程可通过抓包工具查看是否成功。相关命令格式参照窗帘Client端命令章节。

6.1、Server Client双向绑定

  1. zdo bind 0x9C79 0x01 0x01 0x0102 {90 FD 9F FF FE 16 37 EF} {00 0D 6F FF FE 74 BB 9C}
  2. send 0x9c79 0x01 0x01

6.2、窗帘打开

  1. zcl window-covering up
  2. send 0x9c79 0x01 0x01

6.3、窗帘打开至百分比位置

1、zcl window-covering go-to-lift-percent 60

2、send 0x9c79 0x01 0x01

6.4、窗帘关闭

  1. zcl window-covering down
  2. send 0x9c79 0x01 0x01      

6.5、窗帘停止

  1. zcl window-covering stop
  2. send 0x9c79 0x01 0x01

6.6、窗帘电机方向改变、删除行程

1、zcl global write 0x0102 0x0017 0x18 {ff}

2、zcl global write 0x0102 0x0017 0x18 {f0}

3、send 0x9c79 0x01 0x01

发布了14 篇原创文章 · 获赞 0 · 访问量 780

猜你喜欢

转载自blog.csdn.net/BFDX0017/article/details/104776770