Examples of FHTBindingConfig


Examples of org.openhab.binding.fht.FHTBindingConfig

  protected void internalReceiveCommand(String itemName, Command command) {
    if (!checkCULDevice()) {
      return;
    }
    logger.debug("internalReceiveCommand() is called!");
    FHTBindingConfig config = null;
    for (FHTBindingProvider provider : providers) {
      config = provider.getConfigByItemName(itemName);
      if (config != null) {
        break;
      }
    }
    if (config != null) {
      if (Datapoint.DESIRED_TEMP == config.getDatapoint() && command instanceof DecimalType) {
        setDesiredTemperature(config, (DecimalType) command);
      } else {
        logger.error("You can only manipulate the desired temperature via commands, all other data points are read only");
      }
    }
View Full Code Here

Examples of org.openhab.binding.fht.FHTBindingConfig

  }

  private void receivedFHTState(String device, String state) {
    logger.debug("Received state " + state + " for FHT device " + device);
    int stateValue = Integer.parseInt(state, 16);
    FHTBindingConfig config = getConfig(device, Datapoint.BATTERY);
    OnOffType batteryAlarm = null;
    if (stateValue % 2 == 0) {
      batteryAlarm = OnOffType.OFF;
    } else {
      stateValue = stateValue - 1;
      batteryAlarm = OnOffType.ON;
    }
    if (config != null) {
      logger.debug("Updating item " + config.getItem().getName() + " with battery state");
      eventPublisher.postUpdate(config.getItem().getName(), batteryAlarm);
    }

    OpenClosedType windowState = null;
    if (stateValue == 0) {
      windowState = OpenClosedType.CLOSED;
    } else {
      windowState = OpenClosedType.OPEN;
    }
    config = getConfig(device, Datapoint.WINDOW);
    if (config != null) {
      logger.debug("Updating item " + config.getItem().getName() + " with window state");
      eventPublisher.postUpdate(config.getItem().getName(), windowState);
    } else {
      logger.debug("Received FHT state from unknown device " + device);
    }
  }
View Full Code Here

Examples of org.openhab.binding.fht.FHTBindingConfig

      logger.debug("Received FHT state from unknown device " + device);
    }
  }

  private void receivedNewFHT8bState(String device, FHTState state) {
    FHTBindingConfig config = null;
    if (state == FHTState.BATTERY_LOW) {
      config = getConfig(device, Datapoint.BATTERY);
    } else {
      config = getConfig(device, Datapoint.WINDOW);
    }
    if (config != null) {
      logger.debug("Updating item " + config.getItem().getName() + " with new FHT state " + state.toString());
      State newState = null;
      if (state == FHTState.BATTERY_LOW) {
        // Battery alarm goes on
        newState = OnOffType.ON;
      } else if (state == FHTState.WINDOW_OPEN) {
        newState = OpenClosedType.OPEN;
      } else if (state == FHTState.WINDOW_CLOSED) {
        newState = OpenClosedType.CLOSED;
      }
      if (newState != null) {
        eventPublisher.postUpdate(config.getItem().getName(), newState);
      } else {
        logger.warn("Unknown FHT8b state, which is unmapped to openHAB state " + state.toString());
      }
    } else {
      logger.debug("Received FHT8b state for unknown device with address " + device);
View Full Code Here

Examples of org.openhab.binding.fht.FHTBindingConfig

    }
  }

  private void receivedNewValveOpening(String device, int actuatorNumber, double valve) {
    String fullAddress = device + "0" + actuatorNumber;
    FHTBindingConfig config = getConfig(fullAddress, Datapoint.VALVE);
    if (config != null) {
      logger.debug("Updating item " + config.getItem().getName() + " with new valve opening");
      DecimalType state = new DecimalType(valve);
      eventPublisher.postUpdate(config.getItem().getName(), state);
    } else {
      logger.debug("Received valve opening of unkown actuator with address " + fullAddress);
    }
  }
View Full Code Here

Examples of org.openhab.binding.fht.FHTBindingConfig

      logger.debug("Received valve opening of unkown actuator with address " + fullAddress);
    }
  }

  private void receivedNewMeasuredTemperature(String deviceAddress, double temperature) {
    FHTBindingConfig config = getConfig(deviceAddress, Datapoint.MEASURED_TEMP);
    if (config != null) {
      logger.debug("Updating item " + config.getItem().getName() + " with new measured temperature "
          + temperature);
      DecimalType state = new DecimalType(temperature);
      eventPublisher.postUpdate(config.getItem().getName(), state);
    } else {
      logger.debug("Received new measured temp for unkown device with address " + deviceAddress);
    }
  }
View Full Code Here

Examples of org.openhab.binding.fht.FHTBindingConfig

      logger.debug("Received new measured temp for unkown device with address " + deviceAddress);
    }
  }

  private void receivedNewDesiredTemperature(String deviceAddress, double temperature) {
    FHTBindingConfig config = getConfig(deviceAddress, Datapoint.DESIRED_TEMP);
    if (config != null) {
      logger.debug("Updating item " + config.getItem().getName() + " with new desired temperature " + temperature);
      DecimalType state = new DecimalType(temperature);
      eventPublisher.postUpdate(config.getItem().getName(), state);
    } else {
      logger.debug("Received new desired temperature for currently unknown device with address " + deviceAddress);
    }
  }
View Full Code Here

Examples of org.openhab.binding.fht.FHTBindingConfig

    }
  }

  private FHTBindingConfig getConfig(String deviceAddress, Datapoint datapoint) {
    for (FHTBindingProvider provider : providers) {
      FHTBindingConfig config = provider.getConfigByFullAddress(deviceAddress, datapoint);
      if (config != null) {
        return config;
      }
    }
    return null;
View Full Code Here

Examples of org.openhab.binding.fht.FHTBindingConfig

    if ((datapoint == Datapoint.WINDOW || datapoint == Datapoint.VALVE)
        && address == null) {
      throw new BindingConfigParseException(
          "Address of window contact needed");
    }
    FHTBindingConfig config = new FHTBindingConfig(item, housecode,
        address, datapoint);
    addBindingConfig(item, config);
  }
View Full Code Here

Examples of org.openhab.binding.fht.FHTBindingConfig

  @Override
  public FHTBindingConfig getConfigByFullAddress(String fullAddress,
      Datapoint datapoint) {
    for (BindingConfig c : bindingConfigs.values()) {
      FHTBindingConfig fhtConfig = (FHTBindingConfig) c;
      if (fhtConfig.getFullAddress().equals(fullAddress)
          && fhtConfig.getDatapoint() == datapoint) {
        return fhtConfig;
      }
    }
    return null;
  }
View Full Code Here

Examples of org.openhab.binding.fht.FHTBindingConfig

  @Override
  public List<FHTBindingConfig> getAllFHT80bBindingConfigs() {
    List<FHTBindingConfig> configs = new ArrayList<FHTBindingConfig>();
    for (BindingConfig c : bindingConfigs.values()) {
      FHTBindingConfig config = (FHTBindingConfig) c;
      if (config.getFullAddress().length() == 4
          && !configs.contains(config)) {
        configs.add(config);
      }
    }
    return configs;
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.