- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.zsmartsystems.zigbee.zcl.ZclAttribute.getCluster()
方法的一些代码示例,展示了ZclAttribute.getCluster()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZclAttribute.getCluster()
方法的具体详情如下:
包路径:com.zsmartsystems.zigbee.zcl.ZclAttribute
类名称:ZclAttribute
方法名:getCluster
[英]Gets the ZclClusterType to which this attribute belongs
[中]获取此属性所属的ZclClusterType
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.RELATIVE_HUMIDITY_MEASUREMENT
&& attribute.getId() == ZclRelativeHumidityMeasurementCluster.ATTR_MEASUREDVALUE) {
Integer value = (Integer) attribute.getLastValue();
if (value != null) {
updateChannelState(new DecimalType(BigDecimal.valueOf(value, 2)));
}
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.ILLUMINANCE_MEASUREMENT
&& attribute.getId() == ZclIlluminanceMeasurementCluster.ATTR_MEASUREDVALUE) {
Integer value = (Integer) attribute.getLastValue();
if (value != null) {
updateChannelState(new DecimalType(BigDecimal.valueOf(value, 2)));
}
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.ELECTRICAL_MEASUREMENT
&& attribute.getId() == ZclElectricalMeasurementCluster.ATTR_RMSVOLTAGE) {
Integer value = (Integer) attribute.getLastValue();
if (value != null) {
BigDecimal valueInVolts = BigDecimal.valueOf(value * multiplier / divisor);
updateChannelState(new QuantityType<ElectricPotential>(valueInVolts, SmartHomeUnits.VOLT));
}
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.IAS_ZONE
&& attribute.getId() == ZclIasZoneCluster.ATTR_ZONESTATUS) {
updateChannelState((Integer) attribute.getLastValue());
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.TEMPERATURE_MEASUREMENT
&& attribute.getId() == ZclTemperatureMeasurementCluster.ATTR_MEASUREDVALUE) {
Integer value = (Integer) attribute.getLastValue();
if (value != null) {
updateChannelState(new QuantityType<>(BigDecimal.valueOf(value, 2), SIUnits.CELSIUS));
}
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.ELECTRICAL_MEASUREMENT
&& attribute.getId() == ZclElectricalMeasurementCluster.ATTR_RMSCURRENT) {
Integer value = (Integer) attribute.getLastValue();
if (value != null) {
BigDecimal valueInAmpere = BigDecimal.valueOf(value * multiplier / divisor);
updateChannelState(new QuantityType<ElectricCurrent>(valueInAmpere, SmartHomeUnits.AMPERE));
}
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.ELECTRICAL_MEASUREMENT
&& attribute.getId() == ZclElectricalMeasurementCluster.ATTR_ACTIVEPOWER) {
Integer value = (Integer) attribute.getLastValue();
if (value != null) {
BigDecimal valueInWatt = BigDecimal.valueOf(value * multiplier / divisor);
updateChannelState(new QuantityType<Power>(valueInWatt, SmartHomeUnits.WATT));
}
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public synchronized void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.LEVEL_CONTROL
&& attribute.getId() == ZclLevelControlCluster.ATTR_CURRENTLEVEL) {
lastLevel = levelToPercent((Integer) attribute.getLastValue());
if (currentOnOffState.get()) {
// Note that state is only updated if the current On/Off state is TRUE (ie ON)
updateChannelState(lastLevel);
}
} else if (attribute.getCluster() == ZclClusterType.ON_OFF && attribute.getId() == ZclOnOffCluster.ATTR_ONOFF) {
if (attribute.getLastValue() != null) {
currentOnOffState.set((Boolean) attribute.getLastValue());
updateChannelState(currentOnOffState.get() ? lastLevel : OnOffType.OFF);
}
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.POWER_CONFIGURATION
&& attribute.getId() == ZclPowerConfigurationCluster.ATTR_BATTERYVOLTAGE) {
Integer value = (Integer) attribute.getLastValue();
if (value == null || value == 0xFF) {
// The value 0xFF indicates an invalid or unknown reading.
return;
}
BigDecimal valueInVolt = BigDecimal.valueOf(value, 1);
updateChannelState(new QuantityType<ElectricPotential>(valueInVolt, SmartHomeUnits.VOLT));
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.ON_OFF && attribute.getId() == ZclOnOffCluster.ATTR_ONOFF) {
Boolean value = (Boolean) attribute.getLastValue();
if (value != null && value) {
updateChannelState(OnOffType.ON);
} else {
updateChannelState(OnOffType.OFF);
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.POWER_CONFIGURATION
&& attribute.getId() == ZclPowerConfigurationCluster.ATTR_BATTERYPERCENTAGEREMAINING) {
Integer value = (Integer) attribute.getLastValue();
if (value == null) {
return;
}
updateChannelState(new DecimalType(value / 2));
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.OCCUPANCY_SENSING
&& attribute.getId() == ZclOccupancySensingCluster.ATTR_OCCUPANCY) {
Integer value = (Integer) attribute.getLastValue();
if (value != null && value == 1) {
updateChannelState(OnOffType.ON);
} else {
updateChannelState(OnOffType.OFF);
}
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() == ZclClusterType.DOOR_LOCK
&& attribute.getId() == ZclDoorLockCluster.ATTR_LOCKSTATE) {
Integer value = (Integer) attribute.getLastValue();
if (value != null && value == 1) {
updateChannelState(OnOffType.ON);
} else {
updateChannelState(OnOffType.OFF);
}
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {} on endpoint {}", endpoint.getIeeeAddress(), attribute,
endpoint.getEndpointId());
if (attribute.getCluster() == ZclClusterType.COLOR_CONTROL
&& attribute.getId() == ZclColorControlCluster.ATTR_COLORTEMPERATURE) {
if (lastColorMode == null || lastColorMode == ColorModeEnum.COLORTEMPERATURE) {
Integer temperatureInMired = (Integer) attribute.getLastValue();
PercentType percent = miredToPercent(temperatureInMired);
if (percent != null) {
updateChannelState(percent);
}
}
} else if (attribute.getCluster() == ZclClusterType.COLOR_CONTROL
&& attribute.getId() == ZclColorControlCluster.ATTR_COLORMODE) {
Integer colorMode = (Integer) attribute.getLastValue();
lastColorMode = ColorModeEnum.getByValue(colorMode);
if (lastColorMode != ColorModeEnum.COLORTEMPERATURE) {
updateChannelState(UnDefType.UNDEF);
}
}
}
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public synchronized void attributeUpdated(ZclAttribute attribute) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
if (attribute.getCluster() != ZclClusterType.PRESSURE_MEASUREMENT) {
return;
代码示例来源:origin: openhab/org.openhab.binding.zigbee
if (attribute.getCluster().getId() == ZclOnOffCluster.CLUSTER_ID) {
if (attribute.getId() == ZclOnOffCluster.ATTR_ONOFF) {
Boolean value = (Boolean) attribute.getLastValue();
updateOnOff(onoff);
} else if (attribute.getCluster().getId() == ZclLevelControlCluster.CLUSTER_ID) {
if (attribute.getId() == ZclLevelControlCluster.ATTR_CURRENTLEVEL) {
PercentType brightness = levelToPercent((Integer) attribute.getLastValue());
updateBrightness(brightness);
} else if (attribute.getCluster().getId() == ZclColorControlCluster.CLUSTER_ID) {
if (attribute.getId() == ZclColorControlCluster.ATTR_CURRENTHUE) {
Integer value = (Integer) attribute.getLastValue();
代码示例来源:origin: openhab/org.openhab.binding.zigbee
@Override
public void attributeUpdated(ZclAttribute attribute) {
if (attribute.getCluster() == ZclClusterType.POWER_CONFIGURATION
&& attribute.getId() == ZclPowerConfigurationCluster.ATTR_BATTERYALARMSTATE) {
logger.debug("{}: ZigBee attribute reports {}", endpoint.getIeeeAddress(), attribute);
// The value is a 32-bit bitmap, represented by an Integer
Integer value = (Integer) attribute.getLastValue();
if (value == null) {
return;
}
if ((value & MIN_THRESHOLD_BITMASK) != 0) {
updateChannelState(new StringType(STATE_OPTION_BATTERY_MIN_THRESHOLD));
} else if ((value & THRESHOLD_1_BITMASK) != 0) {
updateChannelState(new StringType(STATE_OPTION_BATTERY_THRESHOLD_1));
} else if ((value & THRESHOLD_2_BITMASK) != 0) {
updateChannelState(new StringType(STATE_OPTION_BATTERY_THRESHOLD_2));
} else if ((value & THRESHOLD_3_BITMASK) != 0) {
updateChannelState(new StringType(STATE_OPTION_BATTERY_THRESHOLD_3));
} else {
updateChannelState(new StringType(STATE_OPTION_BATTERY_NO_THRESHOLD));
}
}
}
}
代码示例来源:origin: zsmartsystems/com.zsmartsystems.zigbee
@Test
public void testConstructor() {
ZclAttribute attribute = new ZclAttribute(ZclClusterType.ON_OFF, 0, "Test Name",
ZclDataType.UNSIGNED_8_BIT_INTEGER, false, false, false, false);
assertEquals(ZclClusterType.ON_OFF, attribute.getCluster());
assertEquals(0, attribute.getId());
assertEquals("Test Name", attribute.getName());
assertEquals(ZclDataType.UNSIGNED_8_BIT_INTEGER, attribute.getDataType());
assertEquals(false, attribute.isMandatory());
assertEquals(false, attribute.isWritable());
assertEquals(false, attribute.isReadable());
assertEquals(false, attribute.isReportable());
System.out.println(attribute.toString());
attribute = new ZclAttribute(ZclClusterType.ON_OFF, 0, "Test Name", ZclDataType.UNSIGNED_8_BIT_INTEGER, true,
true, true, true);
assertEquals(true, attribute.isMandatory());
assertEquals(true, attribute.isWritable());
assertEquals(true, attribute.isReadable());
assertEquals(true, attribute.isReportable());
System.out.println(attribute.toString());
}
Zigbee 和 Zigbee PRO 之间有什么区别(如果有)? 我在维基百科和 official Zigbee site 上找不到任何具体内容这一切都归结为一些优化。 实际使用上有什么区别吗? 最
是否可以使用 XBee PRO S2B 与 ZigBee HA(家庭自动化)配置文件传感器进行通信?如果可以,如何进行通信?有谁知道我在哪里可以找到有关 ZigBee HA 配置文件的规范? 非常感谢
我已经有一段时间不了解 ZigBee 了。谁拥有最成熟的 Zigbee 堆栈?是 Microchip、Chipcon 还是 Atmel? 是否有价格低于 10 美元的 RF 模块? 我记得不久前某些堆
我之前的经验是能够接收我的温度/湿度zigbee传感器发送的数据。此外,我还可以发送命令来控制 zigbee 功率计/开关。 我购买了一个运动检测传感器,其中包含一行 IAS 数据包的文档。我知道这是
我之前的经验是能够接收我的温度/湿度zigbee传感器发送的数据。此外,我还可以发送命令来控制 zigbee 功率计/开关。 我购买了一个运动检测传感器,其中包含一行 IAS 数据包的文档。我知道这是
我目前正在研究 ZigBee,我遇到了以下问题: 每个 ZigBee 设备都有一个 16 位短地址,这意味着我最多可以连接 2^16=65536 个不同的设备(当然减去一些保留地址)。现在每个设备最多
关于这个问题,我询问了一些从事ZigBee应用开发的开发人员。他们告诉我,一个 radio 模块(对我来说,这是指一个节点,同一件事)在形成网络时只能有一个配置文件。 但是,当我阅读“Drew Gis
智能家居连接,不仅仅只有 Wi-Fi 和蓝牙这些大家熟悉的技术,还有一些更加符合智能家居应用的行业专有协议,比如Zigbee,Z-Wave 和 Thread等等。 当谈到家庭自动化时
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeApsFrame类的一些代码示例,展示了ZigBeeApsFrame类的具体用法。这些代码示例主要来源于Github/
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeEndpointAddress类的一些代码示例,展示了ZigBeeEndpointAddress类的具体用法。这些代码
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeChannel类的一些代码示例,展示了ZigBeeChannel类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNetworkManager类的一些代码示例,展示了ZigBeeNetworkManager类的具体用法。这些代码示例
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeEndpoint类的一些代码示例,展示了ZigBeeEndpoint类的具体用法。这些代码示例主要来源于Github/
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNode类的一些代码示例,展示了ZigBeeNode类的具体用法。这些代码示例主要来源于Github/Stackove
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeProfileType类的一些代码示例,展示了ZigBeeProfileType类的具体用法。这些代码示例主要来源于G
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeAddress类的一些代码示例,展示了ZigBeeAddress类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeGroupAddress类的一些代码示例,展示了ZigBeeGroupAddress类的具体用法。这些代码示例主要来源
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeCommand类的一些代码示例,展示了ZigBeeCommand类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeNetworkNodeListener类的一些代码示例,展示了ZigBeeNetworkNodeListener类的具
本文整理了Java中com.zsmartsystems.zigbee.ZigBeeBroadcastDestination类的一些代码示例,展示了ZigBeeBroadcastDestination类
我是一名优秀的程序员,十分优秀!