Former-commit-id: 878de8933a17ec1901a6b6a4533d4711dcf09d37
Former-commit-id: 05e6cc47ab6cf1ce5a68e223630348d8730a47c7
1.0
wanggang 4 years ago
parent 02bffc2c52
commit 0273e05c6e

@ -593,6 +593,9 @@ namespace IoTNode.DeviceServices.FBee
this._logger.LogError($"data length must be 8 but now is {tempBytes.Count}"); this._logger.LogError($"data length must be 8 but now is {tempBytes.Count}");
} }
} }
else if (props.TryGetValue(0x0300, out item))//单位
{
}
else if (props.TryGetValue(0x0301, out item))//总量乘数 else if (props.TryGetValue(0x0301, out item))//总量乘数
{ {
var value = BitConverter.ToUInt16(item); var value = BitConverter.ToUInt16(item);
@ -603,6 +606,11 @@ namespace IoTNode.DeviceServices.FBee
var value = BitConverter.ToUInt16(item); var value = BitConverter.ToUInt16(item);
this.UpdateIoTData(device.Id, DataKeys.ElectricityDivisor, value); this.UpdateIoTData(device.Id, DataKeys.ElectricityDivisor, value);
} }
else if (props.TryGetValue(0x0400, out item))//查询
{
var ieee = device.Number;
this.X8D0702ReadValue(sn, ieee);
}
} }
else if (clusterId == ClusterId.doorlock) else if (clusterId == ClusterId.doorlock)
{ {
@ -1177,15 +1185,23 @@ namespace IoTNode.DeviceServices.FBee
/// 0x8d-0x70发送zcl指令读取簇id为0702的电量、电功率 /// 0x8d-0x70发送zcl指令读取簇id为0702的电量、电功率
/// </summary> /// </summary>
public void X8D0702(string sn, string ieee) public void X8D0702(string sn, string ieee)
{
this.X8D0702ReadParameter(sn, ieee);
this.X8D0702ReadValue(sn, ieee);
}
private void X8D0702ReadParameter(string sn, string ieee)
{ {
this.Write(sn, RequestType.x8d, ieee, new List<byte>() { 0x02, 0x07, 0x01, 0x03, 0x00 }, 3);//0301电量乘数 this.Write(sn, RequestType.x8d, ieee, new List<byte>() { 0x02, 0x07, 0x01, 0x03, 0x00 }, 3);//0301电量乘数
this.Write(sn, RequestType.x8d, ieee, new List<byte>() { 0x02, 0x07, 0x02, 0x03, 0x00 }, 3);//0302电量除数 this.Write(sn, RequestType.x8d, ieee, new List<byte>() { 0x02, 0x07, 0x02, 0x03, 0x00 }, 3);//0302电量除数
this.Write(sn, RequestType.x8d, ieee, new List<byte>() { 0x04, 0x0b, 0x04, 0x06, 0x00 }, 3);//0604功率乘数 this.Write(sn, RequestType.x8d, ieee, new List<byte>() { 0x04, 0x0b, 0x04, 0x06, 0x00 }, 3);//0604功率乘数
this.Write(sn, RequestType.x8d, ieee, new List<byte>() { 0x04, 0x0b, 0x05, 0x06, 0x00 }, 3);//0605功率除数 this.Write(sn, RequestType.x8d, ieee, new List<byte>() { 0x04, 0x0b, 0x05, 0x06, 0x00 }, 3);//0605功率除数
this.Write(sn, RequestType.xa7, ieee, new List<byte>() { 0x02, 0x07, 0x00, 0x00, 0x00 }, 2);//0000电量
this.Write(sn, RequestType.xa7, ieee, new List<byte>() { 0x02, 0x07, 0x0b, 0x05, 0x00 }, 2);//050b功率
} }
private void X8D0702ReadValue(string sn, string ieee)
{
this.Write(sn, RequestType.x8d, ieee, new List<byte>() { 0x02, 0x07, 0x00, 0x00, 0x00 }, 3);//0000电量
this.Write(sn, RequestType.x8d, ieee, new List<byte>() { 0x04, 0x0b, 0x0b, 0x05, 0x00 }, 3);//050b功率
}
// //
//0x96 //0x96
//0x8e //0x8e

Loading…
Cancel
Save