The issue might be a difference in the two existing influxDB persistence services
conversions for org.openhab.persistence.influxdb
/**
* Converts {@link State} to objects fitting into influxdb values.
*
* @param state to be converted
* @return integer or double value for DecimalType, 0 or 1 for OnOffType and OpenClosedType,
* integer for DateTimeType, String for all others
*/
private Object stateToObject(State state) {
Object value;
if (state instanceof HSBType) {
value = ((HSBType) state).toString();
logger.debug("got HSBType value {}", value);
} else if (state instanceof PointType) {
value = point2String((PointType) state);
logger.debug("got PointType value {}", value);
} else if (state instanceof DecimalType) {
value = convertBigDecimalToNum(((DecimalType) state).toBigDecimal());
logger.debug("got DecimalType value {}", value);
} else if (state instanceof OnOffType) {
value = (OnOffType) state == OnOffType.ON ? 1 : 0;
logger.debug("got OnOffType value {}", value);
} else if (state instanceof OpenClosedType) {
value = (OpenClosedType) state == OpenClosedType.OPEN ? 1 : 0;
logger.debug("got OpenClosedType value {}", value);
} else if (state instanceof DateTimeType) {
value = ((DateTimeType) state).getCalendar().getTime().getTime();
logger.debug("got DateTimeType value {}", value);
} else {
value = state.toString();
logger.debug("got String value {}", value);
}
return value;
}
and for org.openhab.persistence.influxdb08
/**
* Converts {@link State} to objects fitting into influxdb values.
*
* @param state to be converted
* @return integer or double value for DecimalType,
* 0 or 1 for OnOffType and OpenClosedType,
* integer for DateTimeType,
* String for all others
*/
private Object stateToObject(State state) {
Object value;
if (state instanceof DecimalType) {
value = convertBigDecimalToNum(((DecimalType) state).toBigDecimal());
} else if (state instanceof OnOffType) {
value = (OnOffType) state == OnOffType.ON ? 1 : 0;
} else if (state instanceof OpenClosedType) {
value = (OpenClosedType) state == OpenClosedType.OPEN ? 1 : 0;
} else if (state instanceof HSBType) {
value = ((HSBType) state).toString();
} else if (state instanceof DateTimeType) {
value = ((DateTimeType) state).getCalendar().getTime().getTime();
} else {
value = state.toString();
}
return value;
}