我们可以基于Z-Wave来实现门铃,在z-wave_device_class_specification中doorbell归入在AV Control Point Generic Device Class中,有点小奇怪。
下面尝试分析协议对doorbell实现功能的要求,以方便于网关程序开发。
QQ:380939960
5.2.3.4 DoorbellSpecific Device Class
Doorbell SpecificDevice Class必须支持一下命令类:
Binary Sensor Command Class: 当门铃被触发时候门铃使用Binary Sensor Command Class 去上报一个事件。. Binary Sensor Report (0xFF) 表示门铃在应用层指定的时间内探测到事件发生;如果在指定的超时时间过后,没有再有事件发生,门铃上报Binary Sensor Report MUST contain (0x00)表示自己处于空闲状态;
Association Command Class:通过Association Command Class可以指定门铃事件的订阅者,也就是当门铃被按时,门铃主动发送的通知事件应该发送给谁。
Manufacturer Specific Command Class:通过该命令类门铃通报设备的制造商信息,也即厂商ID,产品ID等等。
Version CommandClass: 通过这个命令通报使用的库类型,Z-Wave协议版本号,以及应用程序的版本等信息。
5.2.3.4.2 Basic Command Class Implementation
门铃的Basic Command Class必须按照如下方法实现:
Basic Set (0x00) = |
Basic Set (0x00)停止播放命令. 如果门铃在接收基本设置命令(0x00)时,正在播放铃声或应用程序特定的声音,则立即中断并停止播放声音。 如果当前门铃空闲,即没有播放声音,在接收基本设置命令(0x00)时,必须忽略该命令。. |
Basic Set (0xFF) = |
Basic Set (0xFF)开始播放声音. 如果门铃在接收基本设置命令(0xFF)时处于空闲状态,门铃将开始播放铃声或应用程序特定的声音。 如果在接收基本设置(0xFF)时正在播放声音,门铃务必中断当前播放,并重新开始播放铃声或应用程序特定的声音。. |
Basic Get = |
Binary Sensor Get 通过该命令获得门铃的状态 |
Basic Report = |
Binary Sensor Report 门铃可以通过该命令上报当前的状态 |
5.2.3.4.3Recommended Command Classes to Support
推荐doorbell支持如下的命令类:
l Association Group Information Command Class:支持Association CommandClass的节点还应考虑支持Association Group Information Command Class,以便实现联动控制功能。
l Alarm Command Class:用来上报一个告警事件。
l Protection Command Class:门铃可以选择性地支持保护功能。 如果支持保护功能,则设备应能够处理与保护相关的命令。
l Battery Command Class:电池命令类可以向控制器报告电池状态;
5.2.3.4.4 Mandatory Command Classes to Control
关于设备可以控制其他设备的命令类没有任何强制性要求。