Source:
<code>public void handleEvent(ZWaveCommandClassValueEvent event, Item item, Map<String,String> arguments) { ZWaveStateConverter<?,?> converter = this.getStateConverter(item, event.getValue()); String sensorType = arguments.get("sensor_type"); String sensorScale = arguments.get("sensor_scale"); ZWaveMultiLevelSensorValueEvent sensorEvent = (ZWaveMultiLevelSensorValueEvent)event; if (converter == null) { logger.warn("NODE {}: No converter found for item = {}, endpoint = {}, ignoring event.", event.getNodeId(), item.getName(), event.getEndpoint()); return; } if (sensorType != null && SensorType.getSensorType(Integer.parseInt(sensorType)) != sensorEvent.getSensorType()) { return; } BigDecimal val = (BigDecimal)event.getValue(); if (sensorScale != null && Integer.parseInt(sensorScale) != sensorEvent.getSensorScale()) { int intType = Integer.parseInt(sensorType); SensorType senType = SensorType.getSensorType(intType); if(senType == null) { logger.error("NODE {}: Error parsing sensor type {}", event.getNodeId(), sensorType); } else { switch(senType) { case TEMPERATURE: if (sensorEvent.getSensorScale() == 0) { <START> val = val.multiply(ONE_POINT_EIGHT).add(THIRTY_TWO).movePointRight(1); <END> } else if (sensorEvent.getSensorScale() == 1) { val = val.movePointLeft(1).subtract(THIRTY_TWO).divide(ONE_POINT_EIGHT, MathContext.DECIMAL32); } break; default: break; } } logger.debug("NODE {}: Sensor is reporting scale {}, requiring conversion to {}. Value is now {}.", event.getNodeId(), sensorEvent.getSensorScale(), sensorScale, val); } State state = converter.convertFromValueToState(val); this.getEventPublisher().postUpdate(item.getName(), state); }</code><technical_language>movePointRight Left for a vendor-specific F*10 to/from C implementation, drop those! :)</technical_language>

Target:
public void handleEvent(ZWaveCommandClassValueEvent event, Item item, Map<String,String> arguments) { ZWaveStateConverter<?,?> converter = this.getStateConverter(item, event.getValue()); String sensorType = arguments.get("sensor_type"); String sensorScale = arguments.get("sensor_scale"); ZWaveMultiLevelSensorValueEvent sensorEvent = (ZWaveMultiLevelSensorValueEvent)event; if (converter == null) { logger.warn("NODE {}: No converter found for item = {}, endpoint = {}, ignoring event.", event.getNodeId(), item.getName(), event.getEndpoint()); return; } if (sensorType != null && SensorType.getSensorType(Integer.parseInt(sensorType)) != sensorEvent.getSensorType()) { return; } BigDecimal val = (BigDecimal)event.getValue(); if (sensorScale != null && Integer.parseInt(sensorScale) != sensorEvent.getSensorScale()) { int intType = Integer.parseInt(sensorType); SensorType senType = SensorType.getSensorType(intType); if(senType == null) { logger.error("NODE {}: Error parsing sensor type {}", event.getNodeId(), sensorType); } else { switch(senType) { case TEMPERATURE: if (sensorEvent.getSensorScale() == 0) { val = val.multiply(ONE_POINT_EIGHT).add(THIRTY_TWO); } else if (sensorEvent.getSensorScale() == 1) { val = val.subtract(THIRTY_TWO).divide(ONE_POINT_EIGHT, MathContext.DECIMAL32); } break; default: break; } } logger.debug("NODE {}: Sensor is reporting scale {}, requiring conversion to {}. Value is now {}.", event.getNodeId(), sensorEvent.getSensorScale(), sensorScale, val); } State state = converter.convertFromValueToState(val); this.getEventPublisher().postUpdate(item.getName(), state); }