Examples of ZWaveWakeUpCommandClass


Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass

        }
      }
    }

    // Add the wakeup destination node to the list for battery devices
    ZWaveWakeUpCommandClass wakeupCmdClass = (ZWaveWakeUpCommandClass) getCommandClass(CommandClass.WAKE_UP);
    if(wakeupCmdClass != null) {
      Integer wakeupNodeId = wakeupCmdClass.getTargetNodeId();
      routedNodes.add(wakeupNodeId);
    }

    // Are there any nodes to which we need to set routes?
    if(routedNodes.size() == 0) {
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass

     
      // Keep track of the number of packets sent to this device
      node.incrementSendCount();

      if (!node.isListening() && !node.isFrequentlyListening() && serialMessage.getPriority() != SerialMessagePriority.Low) {
      ZWaveWakeUpCommandClass wakeUpCommandClass = (ZWaveWakeUpCommandClass)node.getCommandClass(CommandClass.WAKE_UP);

      // If it's a battery operated device, check if it's awake or place in wake-up queue.
      if (wakeUpCommandClass != null && !wakeUpCommandClass.processOutgoingWakeupMessage(serialMessage)) {
        return;
      }
    }
     
      serialMessage.setTransmitOptions(TRANSMIT_OPTION_ACK | TRANSMIT_OPTION_AUTO_ROUTE | TRANSMIT_OPTION_EXPLORE);
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass

          arg0.getMessageClass() == SerialMessageClass.SendData)) {
        ZWaveNode node = this.controller.getNode(arg0.getMessageNode());
       
        if (node != null && !node.isListening() && !node.isFrequentlyListening()) {
          arg0Listening = false;
          ZWaveWakeUpCommandClass wakeUpCommandClass = (ZWaveWakeUpCommandClass)node.getCommandClass(CommandClass.WAKE_UP);
         
          if (wakeUpCommandClass != null && wakeUpCommandClass.isAwake())
            arg0Awake = true;
        }
      }
     
      if ((arg1.getMessageClass() == SerialMessageClass.RequestNodeInfo ||
          arg1.getMessageClass() == SerialMessageClass.SendData)) {
        ZWaveNode node = this.controller.getNode(arg1.getMessageNode());
       
        if (node != null && !node.isListening() && !node.isFrequentlyListening()) {
          arg1Listening = false;
          ZWaveWakeUpCommandClass wakeUpCommandClass = (ZWaveWakeUpCommandClass)node.getCommandClass(CommandClass.WAKE_UP);
         
          if (wakeUpCommandClass != null && wakeUpCommandClass.isAwake())
            arg1Awake = true;
        }
      }
     
      // messages for awake nodes get priority over
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass

      }
     
      checkTransactionComplete(lastSentMessage, incomingMessage);

      // Treat the node information frame as a wakeup
      ZWaveWakeUpCommandClass wakeUp = (ZWaveWakeUpCommandClass)node.getCommandClass(ZWaveCommandClass.CommandClass.WAKE_UP);
      if(wakeUp != null) {
        wakeUp.setAwake(true);
      }
      break;
    case NODE_INFO_REQ_FAILED:
      logger.debug("NODE {}: Application update request, Node Info Request Failed, re-request node info.", nodeId);
     
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass

            records.add(record);
          }
        }
      } else if (arg.equals("wakeup/")) {
        ZWaveWakeUpCommandClass wakeupCommandClass = (ZWaveWakeUpCommandClass) node
            .getCommandClass(CommandClass.WAKE_UP);

        if(wakeupCommandClass == null) {
          logger.error("NODE {}: Error getting wakeupCommandClass", nodeId);
          return null;
        }

        // Display the wakeup parameters.
        // Note that only the interval is writable.
        record = new OpenHABConfigurationRecord(domain, "Interval", "Wakeup Interval", false);
        record.minimum = wakeupCommandClass.getMinInterval();
        record.maximum = wakeupCommandClass.getMaxInterval();
        record.value = Integer.toString(wakeupCommandClass.getInterval());
        // If the value is in our PENDING list, then use that instead
        Integer pendingValue = PendingCfg.Get(ZWaveCommandClass.CommandClass.WAKE_UP.getKey(), nodeId);
        if(pendingValue != null) {
          record.value = Integer.toString(pendingValue);
          record.state = OpenHABConfigurationRecord.STATE.PENDING;
        }
        records.add(record);

        record = new OpenHABConfigurationRecord(domain, "Minimum", "Minimum Interval", true);
        record.value = Integer.toString(wakeupCommandClass.getMinInterval());
        records.add(record);

        record = new OpenHABConfigurationRecord(domain, "Maximum", "Maximum Interval", true);
        record.value = Integer.toString(wakeupCommandClass.getMaxInterval());
        records.add(record);

        record = new OpenHABConfigurationRecord(domain, "Default", "Default Interval", true);
        record.value = Integer.toString(wakeupCommandClass.getDefaultInterval());
        records.add(record);

        record = new OpenHABConfigurationRecord(domain, "Step", "Interval Step", true);
        record.value = Integer.toString(wakeupCommandClass.getIntervalStep());
        records.add(record);
      } else if (arg.equals("neighbors/")) {
        // Check that we have the neighbor list for this node
        if(node.getNeighbors() == null)
          return null;
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass

      if (splitDomain[2].equals("wakeup")) {
        if (action.equals("Refresh")) {
          logger.debug("NODE {}: Refresh wakeup capabilities", nodeId);

          ZWaveWakeUpCommandClass wakeupCommandClass = (ZWaveWakeUpCommandClass) node
              .getCommandClass(CommandClass.WAKE_UP);

          if (wakeupCommandClass == null) {
            logger.error("NODE {}: Error getting wakeupCommandClass in doAction", nodeId);
            return;
          }

          // Request the wakeup interval for this node
          this.zController.sendData(wakeupCommandClass.getIntervalMessage());

          // Request the wakeup parameters for this node
          this.zController.sendData(wakeupCommandClass.getIntervalCapabilitiesMessage());
        }
      }

      if (splitDomain[2].equals("neighbors")) {
        if (action.equals("Refresh")) {
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass

          this.zController.sendData(configurationCommandClass.setConfigMessage(configurationParameter));
          // And request a read-back
          this.zController.sendData(configurationCommandClass.getConfigMessage(paramIndex));
        }
        if (splitDomain[2].equals("wakeup")) {
          ZWaveWakeUpCommandClass wakeupCommandClass = (ZWaveWakeUpCommandClass) node
              .getCommandClass(CommandClass.WAKE_UP);

          if (wakeupCommandClass == null) {
            logger.error("NODE {}: Error getting wakeupCommandClass in doSet", nodeId);
            return;
          }
         
          logger.debug("NODE {}: Set wakeup interval to '{}'", nodeId, value);

          // Add this as a pending transaction
          PendingCfg.Add(ZWaveCommandClass.CommandClass.WAKE_UP.getKey(), node.getNodeId(), Integer.parseInt(value));

          // Set the wake-up interval
          this.zController.sendData(wakeupCommandClass.setInterval(Integer.parseInt(value)));
          // And request a read-back
          this.zController.sendData(wakeupCommandClass.getIntervalMessage());
        }
        if (splitDomain[2].equals("controller")) {
          if(splitDomain[3].equals("Type")) {
            ZWaveDeviceType type = ZWaveDeviceType.fromString(value);
            logger.error("NODE {}: Setting controller type to {}", nodeId, type.toString());
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass

          // If it's a battery device, it needs to be awake, or we queue the frame until it is.
          if (lastSentMessage.getMessageClass() == SerialMessageClass.SendData) {
            ZWaveNode node = getNode(lastSentMessage.getMessageNode());
           
            if (node != null && !node.isListening() && !node.isFrequentlyListening() && lastSentMessage.getPriority() != SerialMessagePriority.Low) {
              ZWaveWakeUpCommandClass wakeUpCommandClass = (ZWaveWakeUpCommandClass)node.getCommandClass(CommandClass.WAKE_UP);
 
              // If it's a battery operated device, check if it's awake or place in wake-up queue.
              if (wakeUpCommandClass != null && !wakeUpCommandClass.processOutgoingWakeupMessage(lastSentMessage)) {
                continue;
              }
            }
          }
         
View Full Code Here

Examples of org.openhab.binding.zwave.internal.protocol.commandclass.ZWaveWakeUpCommandClass

    }

    // High priority messages get requeued, low priority get dropped
    if (!node.isListening() && !node.isFrequentlyListening()
        && originalMessage.getPriority() != SerialMessagePriority.Low) {
      ZWaveWakeUpCommandClass wakeUpCommandClass = (ZWaveWakeUpCommandClass) node
          .getCommandClass(CommandClass.WAKE_UP);

      if (wakeUpCommandClass != null) {
        // It's a battery operated device, place in wake-up queue.
        wakeUpCommandClass.setAwake(false);
        wakeUpCommandClass.processOutgoingWakeupMessage(originalMessage);
        return false;
      }
    } else if (!node.isListening() && !node.isFrequentlyListening()
        && originalMessage.getPriority() == SerialMessagePriority.Low)
      return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.