logger.warn("Could not configure item " + item + " - Unsupported meter type for webservice");
return;
}
} else {
if ("voltage".equalsIgnoreCase(configParts[2])) {
config = new FritzahaQueryscriptMeter(configParts[0], configParts[1], MeterType.VOLTAGE);
} else if ("current".equalsIgnoreCase(configParts[2])) {
config = new FritzahaQueryscriptMeter(configParts[0], configParts[1], MeterType.CURRENT);
} else if ("power".equalsIgnoreCase(configParts[2])) {
config = new FritzahaQueryscriptMeter(configParts[0], configParts[1], MeterType.POWER);
} else if ("energy".equalsIgnoreCase(configParts[2])) {
if(configParts.length > 3) {
if("mins".equalsIgnoreCase(configParts[3])) timedef = TimeDef.MINUTES;
else if ("day".equalsIgnoreCase(configParts[3])) timedef = TimeDef.DAY;
else if ("month".equalsIgnoreCase(configParts[3])) timedef = TimeDef.MONTH;
else if ("year".equalsIgnoreCase(configParts[3])) timedef = TimeDef.YEAR;
else {
timedef = TimeDef.YEAR;
logger.warn("Timedef of item " + item + "is set to default YEAR. " +
"Please check your syntax. Shall be year, month, day or mins.");
}
} else {
timedef = TimeDef.YEAR;
logger.debug("Timedef of item " + item + "is set to default YEAR because no timespec was given.");
}
config = new FritzahaQueryscriptMeter(configParts[0], configParts[1], MeterType.ENERGY, timedef);
} else {
logger.warn("Could not configure item " + item + " - Unsupported meter type for query script");
return;
}
}