homebridge-pentair-intellicenter-ai
Version:
Homebridge plugin for the Pentair IntelliCenter pool control system (maintained with AI assistance)
161 lines • 6.77 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.PUMP_PERFORMANCE_CURVES = exports.PUMP_TYPE_MAPPING = exports.VARIABLE_SPEED_PUMP_SUBTYPES = exports.DISCOVER_COMMANDS = exports.CURRENT_TEMP_MAX_C = exports.CURRENT_TEMP_MIN_C = exports.DEFAULT_BRIGHTNESS = exports.DEFAULT_COLOR_TEMPERATURE = exports.NO_HEATER_ID = exports.THERMOSTAT_STEP_VALUE = exports.RPM_KEY = exports.WATTS_KEY = exports.GPM_KEY = exports.PROBE_KEY = exports.PARENT_KEY = exports.SELECT_KEY = exports.SPEED_KEY = exports.COOL_KEY = exports.HIGH_TEMP_KEY = exports.LOW_TEMP_KEY = exports.HTMODE_KEY = exports.MODE_KEY = exports.HEATER_KEY = exports.HEAT_SOURCE_KEY = exports.LAST_TEMP_KEY = exports.ACT_KEY = exports.STATUS_KEY = exports.CIRCUIT_KEY = exports.CIRCUITS_KEY = exports.OBJ_MAX_FLOW_KEY = exports.OBJ_MIN_FLOW_KEY = exports.OBJ_MAX_KEY = exports.OBJ_MIN_KEY = exports.OBJ_LIST_KEY = exports.OBJ_SUBTYPE_KEY = exports.OBJ_NAME_KEY = exports.OBJ_ID_KEY = exports.OBJ_TYPE_KEY = exports.PARAMS_KEY = void 0;
exports.PARAMS_KEY = 'params';
exports.OBJ_TYPE_KEY = 'OBJTYP';
exports.OBJ_ID_KEY = 'objnam';
exports.OBJ_NAME_KEY = 'SNAME';
exports.OBJ_SUBTYPE_KEY = 'SUBTYP';
exports.OBJ_LIST_KEY = 'OBJLIST';
exports.OBJ_MIN_KEY = 'MIN';
exports.OBJ_MAX_KEY = 'MAX';
exports.OBJ_MIN_FLOW_KEY = 'MINF';
exports.OBJ_MAX_FLOW_KEY = 'MAXF';
exports.CIRCUITS_KEY = 'CIRCUITS';
exports.CIRCUIT_KEY = 'CIRCUIT';
exports.STATUS_KEY = 'STATUS';
exports.ACT_KEY = 'ACT';
exports.LAST_TEMP_KEY = 'LSTTMP';
exports.HEAT_SOURCE_KEY = 'HTSRC';
exports.HEATER_KEY = 'HEATER';
exports.MODE_KEY = 'MODE';
exports.HTMODE_KEY = 'HTMODE';
exports.LOW_TEMP_KEY = 'LOTMP';
exports.HIGH_TEMP_KEY = 'HITMP';
exports.COOL_KEY = 'COOL';
exports.SPEED_KEY = 'SPEED';
exports.SELECT_KEY = 'SELECT';
exports.PARENT_KEY = 'PARENT';
exports.PROBE_KEY = 'PROBE';
exports.GPM_KEY = 'GPM';
exports.WATTS_KEY = 'WATTS';
exports.RPM_KEY = 'RPM';
exports.THERMOSTAT_STEP_VALUE = 0.5;
exports.NO_HEATER_ID = '00000';
exports.DEFAULT_COLOR_TEMPERATURE = 140;
exports.DEFAULT_BRIGHTNESS = 100;
exports.CURRENT_TEMP_MIN_C = -100;
exports.CURRENT_TEMP_MAX_C = 100;
exports.DISCOVER_COMMANDS = ['CIRCUITS', 'PUMPS', 'CHEMS', 'VALVES', 'HEATERS', 'SENSORS', 'GROUPS'];
exports.VARIABLE_SPEED_PUMP_SUBTYPES = new Set(['SPEED', 'VSF']);
// Pump type mapping from telnet SubType to actual pump type
exports.PUMP_TYPE_MAPPING = new Map([
['SPEED', 'VS'], // Variable Speed
['VSF', 'VSF'], // Variable Speed/Flow
['FLOW', 'VF'], // Variable Flow
['SINGLE', 'SS'], // Single Speed
['DUAL', 'DS'], // Dual Speed
]);
// Pump performance curves based on Pentair specifications
exports.PUMP_PERFORMANCE_CURVES = {
VS: {
// Variable Speed pump (IntelliFlo VS series)
maxRPM: 3450,
minRPM: 450,
// GPM calculation: Based on typical IntelliFlo VS pump curves
calculateGPM: (rpm) => {
if (rpm < 450) {
return 0;
}
if (rpm > 3450) {
rpm = 3450;
}
// Typical VS pump: ~20 GPM at 1000 RPM, ~110 GPM at 3450 RPM
// Using polynomial approximation of pump curve
return Math.max(0, rpm * 0.032 - 14.4);
},
// WATTS calculation: Calibrated to match IntelliCenter actual readings
calculateWATTS: (rpm) => {
if (rpm < 450) {
return 0;
}
if (rpm > 3450) {
rpm = 3450;
}
// Calibrated to actual VS pump data: 1800=225W, 3400=1483W
// Using linear interpolation between the two known points
if (rpm <= 1800) {
// Linear from 450 RPM (assumed ~30W) to 1800 RPM (225W)
return Math.round(30 + ((rpm - 450) * (225 - 30)) / (1800 - 450));
}
else {
// Linear from 1800 RPM (225W) to 3400 RPM (1483W)
return Math.round(225 + ((rpm - 1800) * (1483 - 225)) / (3400 - 1800));
}
},
},
VSF: {
// Variable Speed/Flow pump (IntelliFlo VSF series)
maxRPM: 3450,
minRPM: 450,
// GPM calculation: Calibrated from real IntelliCenter data
calculateGPM: (rpm) => {
if (rpm < 450) {
return 0;
}
if (rpm > 3450) {
rpm = 3450;
}
// Calibrated to actual VSF pump data: 2450=55 GPM, 3450=80 GPM
// Using linear interpolation between the two known points
if (rpm <= 2450) {
// Linear from 450 RPM (assumed ~5 GPM) to 2450 RPM (55 GPM)
return Math.round(5 + ((rpm - 450) * (55 - 5)) / (2450 - 450));
}
else {
// Linear from 2450 RPM (55 GPM) to 3450 RPM (80 GPM)
return Math.round(55 + ((rpm - 2450) * (80 - 55)) / (3450 - 2450));
}
},
// WATTS calculation: Calibrated from real IntelliCenter data
calculateWATTS: (rpm) => {
if (rpm < 450) {
return 0;
}
if (rpm > 3450) {
rpm = 3450;
}
// Calibrated to actual VSF pump data: 2450=820W, 3450=1982W
// Using linear interpolation between the two known points
if (rpm <= 2450) {
// Linear from 450 RPM (assumed ~50W) to 2450 RPM (820W)
return Math.round(50 + ((rpm - 450) * (820 - 50)) / (2450 - 450));
}
else {
// Linear from 2450 RPM (820W) to 3450 RPM (1982W)
return Math.round(820 + ((rpm - 2450) * (1982 - 820)) / (3450 - 2450));
}
},
},
VF: {
// Variable Flow pump
maxRPM: 3450,
minRPM: 450,
calculateGPM: (rpm) => {
if (rpm < 450) {
return 0;
}
if (rpm > 3450) {
rpm = 3450;
}
return Math.max(0, rpm * 0.035 - 15.75);
},
calculateWATTS: (rpm) => {
if (rpm < 450) {
return 0;
}
if (rpm > 3450) {
rpm = 3450;
}
// Fourth-degree polynomial derived from VS pump with 11% efficiency improvement
// VF pumps are similar to VSF but slightly less efficient (1325W max vs 1489W)
const r = rpm / 3450;
const a = -489.86724322;
const b = 2206.76415578;
const c = -482.4110795;
const d = 90.72416694;
return Math.round(a * Math.pow(r, 4) + b * Math.pow(r, 3) + c * Math.pow(r, 2) + d * r);
},
},
};
//# sourceMappingURL=constants.js.map