Added salt cell config Added system version Tweaked pool status to pre-adjust values Chem data uses big endian encoding for most of its values (but not all) while everything else (so far) has used little endian. Chem data also encodes bits like whether there's a system error or not inside other pieces of data like salt levels. There are also bytes in the returned data that I don't know the significance of just yet. Pool status was tweaked such that asking for pH is corrected down to its proper float representation (e.g. 7.60) instead of the integer representation that is sent by the system (760). Same for water balance/saturation. Salt now returns the proper value (scaled up by 50) instead of the value sent over by the system, which I guess is the maximum precision the system can provide.
36 lines
1.2 KiB
JavaScript
Executable File
36 lines
1.2 KiB
JavaScript
Executable File
const ScreenLogic = require('./index');
|
|
|
|
var finder = new ScreenLogic.FindUnits();
|
|
finder.on('serverFound', function(server) {
|
|
var client = new ScreenLogic.UnitConnection(server);
|
|
client.on('loggedIn', function() {
|
|
this.getVersion();
|
|
this.getPoolStatus();
|
|
this.getChemicalData();
|
|
this.getSaltCellConfig();
|
|
this.getControllerConfig();
|
|
}).on('poolStatus', function(status) {
|
|
console.log(" pool ok=" + status.ok);
|
|
console.log(" air temp=" + status.airTemp);
|
|
console.log(" salt ppm=" + status.saltPPM);
|
|
console.log(" pH=" + status.pH);
|
|
console.log(" saturation=" + status.saturation);
|
|
}).on('controllerConfig', function(config) {
|
|
console.log(" controller is in celsius=" + config.degC);
|
|
client.close();
|
|
finder.close();
|
|
}).on('chemicalData', function(chemData) {
|
|
console.log(" calcium=" + chemData.calcium);
|
|
console.log(" cyanuric acid=" + chemData.cyanuricAcid);
|
|
console.log(" alkalinity=" + chemData.alkalinity);
|
|
}).on('saltCellConfig', function(saltCellConfig) {
|
|
console.log(" salt cell installed=" + saltCellConfig.installed);
|
|
}).on('version', function(version) {
|
|
console.log(" version=" + version.version);
|
|
});
|
|
|
|
client.connect();
|
|
});
|
|
|
|
finder.search();
|