Merge pull request #16859 from curzon01/dev-neopool

Update xsns_83_neopool.ino
This commit is contained in:
Theo Arends 2022-10-19 13:45:32 +02:00 committed by GitHub
commit a57fb5e50e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 109 additions and 84 deletions

View File

@ -117,7 +117,7 @@ enum NeoPoolRegister {
MBF_CELL_RUNTIME_HIGH, // 0x0207* undocumented - cell runtime (32 bit) - high word
MBF_CELL_RUNTIME_PART_LOW, // 0x0208* undocumented - cell part runtime (32 bit) - low word
MBF_CELL_RUNTIME_PART_HIGH, // 0x0209* undocumented - cell part runtime (32 bit) - high word
MBF_CELL_BOOST = 0x020C, // 0x020C* undocumented - 0x0000 = Boost Off, 0x05A0 = Boost with redox ctrl, 0x85A0 = Boost without redox ctrl
MBF_CELL_BOOST = 0x020C, // 0x020C* mask undocumented - 0x0000 = Boost Off, 0x05A0 = Boost with redox ctrl, 0x85A0 = Boost without redox ctrl
MBF_CELL_RUNTIME_POLA_LOW = 0x0214, // 0x0214* undocumented - cell runtime polarity A (32 bit) - low word
MBF_CELL_RUNTIME_POLA_HIGH, // 0x0215* undocumented - cell runtime polarity A (32 bit) - high word
MBF_CELL_RUNTIME_POLB_LOW, // 0x0216* undocumented - cell runtime polarity B (32 bit) - low word
@ -126,7 +126,9 @@ enum NeoPoolRegister {
MBF_CELL_RUNTIME_POL_CHANGES_HIGH, // 0x0219* undocumented - cell runtime polarity changes (32 bit) - high word
MBF_HIDRO_MODULE_VERSION = 0x0280, // 0x0280 undocumented - Hydrolysis module version
MBF_HIDRO_MODULE_CONNECTIVITY = 0x0281, // 0x0281 undocumented - Hydrolysis module connection quality (in myriad: 0..10000)
MBF_SET_MANUAL_CTRL = 0x0289, // 0x0289 undocumented - write a 1 before manual control MBF_RELAY_STATE, after done write 0 and do MBF_EXEC
MBF_SET_COUNTDOWN_KEY_AUX_OFF = 0x0287, // 0x0287 mask undocumented - switch AUX1-4 OFF - only for AUX which is assigned as AUX and set to MBV_PAR_CTIMER_COUNTDOWN_KEY_* mode - see MBV_PAR_CTIMER_COUNTDOWN_KEY_AUX*
MBF_SET_COUNTDOWN_KEY_AUX_ON, // 0x0288 mask undocumented - switch AUX1-4 ON - only for AUX which is assigned as AUX and set to MBV_PAR_CTIMER_COUNTDOWN_KEY_* mode - see MBV_PAR_CTIMER_COUNTDOWN_KEY_AUX*
MBF_SET_MANUAL_CTRL, // 0x0289 undocumented - write a 1 before manual control MBF_RELAY_STATE, after done write 0 and do MBF_EXEC
MBF_ESCAPE = 0x0297, // 0x0297 undocumented - A write operation to this register is the same as using the ESC button on main screen - clears error
MBF_SAVE_TO_EEPROM = 0x02F0, // 0x02F0 A write operation to this register starts a EEPROM storage operation immediately. During the EEPROM storage procedure, the system may be unresponsive to MODBUS requests. The operation will last always less than 1 second.
MBF_EXEC = 0x02F5, // 0x02F5 undocumented - immediately take over settings - a write operation to this register take over the previous written data
@ -278,28 +280,12 @@ enum NeoPoolConstAndBitMask {
MBMSK_PH_STATUS_ALARM = 0x000F, // PH alarm. The possible alarm values are depending on the regulation model:
// Valid alarm values for pH regulation with acid and base:
MBV_PH_ACID_BASE_ALARM0 = 0, // no alarm
MBV_PH_ACID_BASE_ALARM1 = 1, // pH too high; the pH value is 0.8 points higher than the setpoint value set in PH1
MBV_PH_ACID_BASE_ALARM2 = 2, // pH too low: the pH value is 0.8 points lower than the set point value set in PH2
MBV_PH_ACID_BASE_ALARM3 = 3, // pH pump (acid or base, it does not matter) has exceeded the working time set by the MBF_PAR_RELAY_PH_MAX_TIME parameter and has stopped.
MBV_PH_ACID_BASE_ALARM4 = 4, // pH higher than the set point indicated in PH1
MBV_PH_ACID_BASE_ALARM5 = 5, // pH lower than the set point indicated in PH2
MBV_PH_ACID_BASE_ALARM6 = 6, // undocumented - acid tank level alarm
// Valid alarm values for pH regulation with acid only:
MBV_PH_ACID_ALARM0 = 0, // no alarm
MBV_PH_ACID_ALARM1 = 1, // pH too high; the pH value is 0.8 points higher than the setpoint value set in PH1
MBV_PH_ACID_ALARM2 = 2, // pH too low: the pH value is 0.8 points lower than the setpoint value set in PH1
MBV_PH_ACID_ALARM3 = 3, // pH pump acid has exceeded the working time set by the MBF_PAR_RELAY_PH_MAX_TIME parameter and has stopped.
MBV_PH_ACID_ALARM4 = 4, // pH higher than the setpoint indicated in PH1 by 0.1
MBV_PH_ACID_ALARM5 = 5, // pH lower than the set point indicated in PH1 by 0.3
MBV_PH_ACID_ALARM6 = 6, // undocumented - acid tank level alarm
// Valid alarm values for pH regulation with base only:
MBV_PH_BASE_ALARM0 = 0, // no alarm
MBV_PH_BASE_ALARM1 = 1, // pH too high; the pH value is 0.8 points higher than the set point value set in PH2
MBV_PH_BASE_ALARM2 = 2, // pH too low: the pH value is 0.8 points lower than the set point value set in PH2
MBV_PH_BASE_ALARM3 = 3, // pH pump has exceeded the working time set by the MBF_PAR_RELAY_PH_MAX_TIME parameter and has stopped.
MBV_PH_BASE_ALARM4 = 4, // pH higher than the set point indicated in PH2 by 0.1
MBV_PH_BASE_ALARM5 = 5, // pH lower than the set point indicated in PH2 by 0.3
MBV_PH_BASE_ALARM6 = 6, // undocumented - acid tank level alarm
MBV_PH_ACID_BASE_ALARM1 = 1, // pH too high; the pH value is 0.8 points higher than the setpoint (PH1 on acid systems, PH2 on base systems, PH1 on acid+base systems)
MBV_PH_ACID_BASE_ALARM2 = 2, // pH too low: the pH value is 0.8 points lower than the set point value set in (PH1 on acid systems, PH2 on base systems, PH2 on acid+base systems)
MBV_PH_ACID_BASE_ALARM3 = 3, // pH pump has exceeded the working time set by the MBF_PAR_RELAY_PH_MAX_TIME parameter and has stopped.
MBV_PH_ACID_BASE_ALARM4 = 4, // pH higher than the set point (PH1 + 0.1 on acid systems, PH2 + 0.1 on base systems, PH1 on acid+base systems)
MBV_PH_ACID_BASE_ALARM5 = 5, // pH lower than the set point (PH1 - 0.3 on acid systems, PH2 - 0.3 on base systems, PH2 on acid+base systems)
MBV_PH_ACID_BASE_ALARM6 = 6, // undocumented - tank level alarm
MBMSK_PH_STATUS_CTRL_BY_FL = 0x0400, // 10 Control status of the pH module by flow detection (if enabled by MBF_PAR_HIDRO_ION_CAUDAL)
MBMSK_PH_STATUS_ACID_PUMP_ACTIVE = 0x0800, // 11 Acid pH pump relay on (pump on)
@ -374,6 +360,11 @@ enum NeoPoolConstAndBitMask {
MBMSK_NOTIF_USER_CHANGED = 0x0010, // 4 User page changed
MBMSK_NOTIF_MISC_CHANGED = 0x0020, // 5 Misc page changed
// MBF_CELL_BOOST
MBMSK_CELL_BOOST_REDOX_CTL = 0x8000, // undocumented - Disable redox ctrl
MBMSK_CELL_BOOST_STATE = 0x0500, // undocumented - Boost
MBMSK_CELL_BOOST_START = 0x00A0, // undocumented - Start boost
// MBF_PAR_MODEL
MBMSK_MODEL_ION = 0x0001, // 0 The equipment includes ionization control
MBMSK_MODEL_HIDRO = 0x0002, // 1 The equipment includes hydrolysis or electrolysis
@ -512,18 +503,27 @@ enum NeoPoolConstAndBitMask {
MBV_PAR_CTIMER_ENABLED_LINKED = 2, // Timer enabled and linked to relay from timer 0
MBV_PAR_CTIMER_ALWAYS_ON = 3, // Relay assigned to this timer always on
MBV_PAR_CTIMER_ALWAYS_OFF = 4, // Relay assigned to this timer always off
MBV_PAR_CTIMER_COUNTDOWN = 5, // Timer in countdown mode
MBV_PAR_CTIMER_COUNTDOWN_KEY_PLUS = 0x0105, // Timer in countdown mode using + key
MBV_PAR_CTIMER_COUNTDOWN_KEY_MINUS = 0x0205, // Timer in countdown mode using - key
MBV_PAR_CTIMER_COUNTDOWN_KEY_ARROWDOWN = 0x0405, // Timer in countdown mode using arrow-down key
// MBF_SET_COUNTDOWN_KEY_AUX_* mask:
MBV_PAR_CTIMER_COUNTDOWN_KEY_AUX1 = 0x0100, // Aux1 ON/OFF, when MBV_TIMER_OFFMB_TIMER_ENABLE is set to MBV_PAR_CTIMER_COUNTDOWN_KEY_*
MBV_PAR_CTIMER_COUNTDOWN_KEY_AUX2 = 0x0200, // Aux2 ON/OFF, when MBV_TIMER_OFFMB_TIMER_ENABLE is set to MBV_PAR_CTIMER_COUNTDOWN_KEY_*
MBV_PAR_CTIMER_COUNTDOWN_KEY_AUX3 = 0x0400, // Aux3 ON/OFF, when MBV_TIMER_OFFMB_TIMER_ENABLE is set to MBV_PAR_CTIMER_COUNTDOWN_KEY_*
MBV_PAR_CTIMER_COUNTDOWN_KEY_AUX4 = 0x0800, // Aux4 ON/OFF, when MBV_TIMER_OFFMB_TIMER_ENABLE is set to MBV_PAR_CTIMER_COUNTDOWN_KEY_*
// MBV_TIMER_OFFMB_TIMER_FUNCTION codes:
MBV_PAR_CTIMER_FCT_FILTRATION = 0x0001, // Filtration function of the system
MBV_PAR_CTIMER_FCT_LIGHTING = 0x0002, // Lighting function of the system
MBV_PAR_CTIMER_FCT_HEATING = 0x0004, // Heating function of the system
MBV_PAR_CTIMER_FCT_AUXREL1 = 0x0100, // Auxiliary function assigned to relay 1
MBV_PAR_CTIMER_FCT_AUXREL2 = 0x0200, // Auxiliary function assigned to relay 2
MBV_PAR_CTIMER_FCT_AUXREL3 = 0x0400, // Auxiliary function assigned to relay 3
MBV_PAR_CTIMER_FCT_AUXREL4 = 0x0800, // Auxiliary function assigned to relay 4
MBV_PAR_CTIMER_FCT_AUXREL5 = 0x1000, // Auxiliary function assigned to relay 5
MBV_PAR_CTIMER_FCT_AUXREL6 = 0x2000, // Auxiliary function assigned to relay 6
MBV_PAR_CTIMER_FCT_AUXREL7 = 0x4000, // Auxiliary function assigned to relay 7
MBV_PAR_CTIMER_FCT_AUXREL1 = 0x0100, // Function assigned to relay 1 (Filtration)
MBV_PAR_CTIMER_FCT_AUXREL2 = 0x0200, // Function assigned to relay 2 (Light)
MBV_PAR_CTIMER_FCT_AUXREL3 = 0x0400, // Function assigned to relay 3 (Heating)
MBV_PAR_CTIMER_FCT_AUXREL4 = 0x0800, // Function assigned to relay 4 (AUX1)
MBV_PAR_CTIMER_FCT_AUXREL5 = 0x1000, // Function assigned to relay 5 (AUX2)
MBV_PAR_CTIMER_FCT_AUXREL6 = 0x2000, // Function assigned to relay 6 (AUX3)
MBV_PAR_CTIMER_FCT_AUXREL7 = 0x4000, // Function assigned to relay 7 (AUX4)
// MBF_PAR_UICFG_SOUND
MBMSK_PAR_SOUND_CLICK = 0x0001, // 0 Click sounds every time a key is pressed
@ -654,6 +654,55 @@ NeoPoolResMBitfield neopool_resolution {
#define D_NEOPOOL_NAME "NeoPool"
#define D_NEOPOOL_JSON_FILTRATION_NONE ""
#define D_NEOPOOL_JSON_FILTRATION_MANUAL "Manual"
#define D_NEOPOOL_JSON_FILTRATION_AUTO "Auto"
#define D_NEOPOOL_JSON_FILTRATION_HEATING "Heating"
#define D_NEOPOOL_JSON_FILTRATION_SMART "Smart"
#define D_NEOPOOL_JSON_FILTRATION_INTELLIGENT "Intelligent"
#define D_NEOPOOL_JSON_FILTRATION_BACKWASH "Backwash"
#define D_NEOPOOL_JSON_MODULES "Modules"
#define D_NEOPOOL_JSON_CHLORINE "Chlorine"
#define D_NEOPOOL_JSON_CONDUCTIVITY "Conductivity"
#define D_NEOPOOL_JSON_FILTRATION "Filtration"
#define D_NEOPOOL_JSON_FILTRATION_MODE "Mode"
#define D_NEOPOOL_JSON_FILTRATION_SPEED "Speed"
#define D_NEOPOOL_JSON_HYDROLYSIS "Hydrolysis"
#define D_NEOPOOL_JSON_CELL_RUNTIME "Runtime"
#define D_NEOPOOL_JSON_CELL_RUNTIME_TOTAL "Total"
#define D_NEOPOOL_JSON_CELL_RUNTIME_PART "Part"
#define D_NEOPOOL_JSON_CELL_RUNTIME_POL1 "Pol1"
#define D_NEOPOOL_JSON_CELL_RUNTIME_POL2 "Pol2"
#define D_NEOPOOL_JSON_CELL_RUNTIME_CHANGES "Changes"
#define D_NEOPOOL_JSON_IONIZATION "Ionization"
#define D_NEOPOOL_JSON_LIGHT "Light"
#define D_NEOPOOL_JSON_LIGHT_MODE "Mode"
#define D_NEOPOOL_JSON_REDOX "Redox"
#define D_NEOPOOL_JSON_RELAY "Relay"
#define D_NEOPOOL_JSON_RELAY_PH_ACID "Acid"
#define D_NEOPOOL_JSON_RELAY_PH_BASE "Base"
#define D_NEOPOOL_JSON_RELAY_RX "Redox"
#define D_NEOPOOL_JSON_RELAY_CL "Chlorine"
#define D_NEOPOOL_JSON_RELAY_CD "Conductivity"
#define D_NEOPOOL_JSON_RELAY_HEATING "Heating"
#define D_NEOPOOL_JSON_RELAY_UV "UV"
#define D_NEOPOOL_JSON_RELAY_FILTVALVE "Valve"
#define D_NEOPOOL_JSON_AUX "Aux"
#define D_NEOPOOL_JSON_STATE "State"
#define D_NEOPOOL_JSON_TYPE "Type"
#define D_NEOPOOL_JSON_UNIT "Unit"
#define D_NEOPOOL_JSON_COVER "Cover"
#define D_NEOPOOL_JSON_SHOCK "Boost"
#define D_NEOPOOL_JSON_LOW "Low"
#define D_NEOPOOL_JSON_SETPOINT "Setpoint"
#define D_NEOPOOL_JSON_MIN "Min"
#define D_NEOPOOL_JSON_MAX "Max"
#define D_NEOPOOL_JSON_PHPUMP "Pump"
#define D_NEOPOOL_JSON_FLOW1 "FL1"
#define D_NEOPOOL_JSON_TANK "Tank"
#define D_NEOPOOL_JSON_BIT "Bit"
#define D_NEOPOOL_JSON_NODE_ID "NodeID"
const char kNeoPoolMachineNames[] PROGMEM =
D_NEOPOOL_MACH_NONE "|"
D_NEOPOOL_MACH_HIDROLIFE "|"
@ -677,6 +726,14 @@ const char kNeoPoolFiltrationMode[] PROGMEM =
D_NEOPOOL_FILTRATION_INTELLIGENT "|"
D_NEOPOOL_FILTRATION_BACKWASH
;
const char kNeoPoolFiltrationModeCmnd[] PROGMEM =
D_NEOPOOL_JSON_FILTRATION_MANUAL "|"
D_NEOPOOL_JSON_FILTRATION_AUTO "|"
D_NEOPOOL_JSON_FILTRATION_HEATING "|"
D_NEOPOOL_JSON_FILTRATION_SMART "|"
D_NEOPOOL_JSON_FILTRATION_INTELLIGENT "|"
D_NEOPOOL_JSON_FILTRATION_BACKWASH
;
const uint8_t sNeoPoolFiltrationMode[] PROGMEM = {
MBV_PAR_FILT_MANUAL,
MBV_PAR_FILT_AUTO,
@ -732,8 +789,11 @@ const char HTTP_SNS_NEOPOOL_STATUS_ACTIVE[] PROGMEM = "filter:invert(1)";
* Commands
*
* NPFiltration {<state> {speed}}
* get/set manual filtration (state = 0|1, speed = 1..3)
* get/set manual filtration (state = 0..2, speed = 1..3)
* get filtration state if <state> is omitted, otherwise set new state
* 0 - switch filtration pump off
* 1 - switch filtration pump on
* 2 - toggle filtration pump
* for non-standard filtration types additional speed control is possible
*
* NPFiltrationMode {<mode>}
@ -1417,48 +1477,6 @@ bool NeoPoolIsIonization(void)
/*********************************************************************************************/
#define D_NEOPOOL_JSON_MODULES "Modules"
#define D_NEOPOOL_JSON_CHLORINE "Chlorine"
#define D_NEOPOOL_JSON_CONDUCTIVITY "Conductivity"
#define D_NEOPOOL_JSON_FILTRATION "Filtration"
#define D_NEOPOOL_JSON_FILTRATION_MODE "Mode"
#define D_NEOPOOL_JSON_FILTRATION_SPEED "Speed"
#define D_NEOPOOL_JSON_HYDROLYSIS "Hydrolysis"
#define D_NEOPOOL_JSON_CELL_RUNTIME "Runtime"
#define D_NEOPOOL_JSON_CELL_RUNTIME_TOTAL "Total"
#define D_NEOPOOL_JSON_CELL_RUNTIME_PART "Part"
#define D_NEOPOOL_JSON_CELL_RUNTIME_POL1 "Pol1"
#define D_NEOPOOL_JSON_CELL_RUNTIME_POL2 "Pol2"
#define D_NEOPOOL_JSON_CELL_RUNTIME_CHANGES "Changes"
#define D_NEOPOOL_JSON_IONIZATION "Ionization"
#define D_NEOPOOL_JSON_LIGHT "Light"
#define D_NEOPOOL_JSON_LIGHT_MODE "Mode"
#define D_NEOPOOL_JSON_REDOX "Redox"
#define D_NEOPOOL_JSON_RELAY "Relay"
#define D_NEOPOOL_JSON_RELAY_PH_ACID "Acid"
#define D_NEOPOOL_JSON_RELAY_PH_BASE "Base"
#define D_NEOPOOL_JSON_RELAY_RX "Redox"
#define D_NEOPOOL_JSON_RELAY_CL "Chlorine"
#define D_NEOPOOL_JSON_RELAY_CD "Conductivity"
#define D_NEOPOOL_JSON_RELAY_HEATING "Heating"
#define D_NEOPOOL_JSON_RELAY_UV "UV"
#define D_NEOPOOL_JSON_RELAY_FILTVALVE "Valve"
#define D_NEOPOOL_JSON_AUX "Aux"
#define D_NEOPOOL_JSON_STATE "State"
#define D_NEOPOOL_JSON_TYPE "Type"
#define D_NEOPOOL_JSON_UNIT "Unit"
#define D_NEOPOOL_JSON_COVER "Cover"
#define D_NEOPOOL_JSON_SHOCK "Boost"
#define D_NEOPOOL_JSON_LOW "Low"
#define D_NEOPOOL_JSON_SETPOINT "Setpoint"
#define D_NEOPOOL_JSON_MIN "Min"
#define D_NEOPOOL_JSON_MAX "Max"
#define D_NEOPOOL_JSON_PHPUMP "Pump"
#define D_NEOPOOL_JSON_FLOW1 "FL1"
#define D_NEOPOOL_JSON_TANK "Tank"
#define D_NEOPOOL_JSON_BIT "Bit"
#define D_NEOPOOL_JSON_NODE_ID "NodeID"
void NeoPoolAppendModules(void)
{
ResponseAppend_P(PSTR("\"" D_NEOPOOL_JSON_MODULES "\":"));
@ -1640,7 +1658,7 @@ void NeoPoolShow(bool json)
// S2
ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_COVER "\":%d"), (NeoPoolGetData(MBF_HIDRO_STATUS) & MBMSK_HIDRO_STATUS_COVER) ? 1 : 0 );
// S3
ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_SHOCK "\":%d"), (NeoPoolGetData(MBF_HIDRO_STATUS) & MBMSK_HIDRO_STATUS_SHOCK_ENABLED) ? ((NeoPoolGetData(MBF_CELL_BOOST) & 0x8000) ? 1 : 2) : 0 );
ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_SHOCK "\":%d"), (NeoPoolGetData(MBF_HIDRO_STATUS) & MBMSK_HIDRO_STATUS_SHOCK_ENABLED) ? ((NeoPoolGetData(MBF_CELL_BOOST) & MBMSK_CELL_BOOST_REDOX_CTL) ? 1 : 2) : 0 );
// S4
ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_LOW "\":%d"), (NeoPoolGetData(MBF_HIDRO_STATUS) & MBMSK_HIDRO_STATUS_LOW) ? 1 : 0 );
@ -1764,7 +1782,7 @@ void NeoPoolShow(bool json)
WSContentSend_PD(PSTR(" "));
// S3
if (NeoPoolGetData(MBF_HIDRO_STATUS) & MBMSK_HIDRO_STATUS_SHOCK_ENABLED) {
if ((NeoPoolGetData(MBF_CELL_BOOST) & 0x8000) == 0) {
if ((NeoPoolGetData(MBF_CELL_BOOST) & MBMSK_CELL_BOOST_REDOX_CTL) == 0) {
WSContentSend_PD(HTTP_SNS_NEOPOOL_STATUS, bg_color, HTTP_SNS_NEOPOOL_STATUS_ACTIVE, PSTR(D_NEOPOOL_SHOCK "+" D_NEOPOOL_REDOX));
} else {
WSContentSend_PD(HTTP_SNS_NEOPOOL_STATUS, bg_color, HTTP_SNS_NEOPOOL_STATUS_ACTIVE, PSTR(D_NEOPOOL_SHOCK));
@ -1807,7 +1825,7 @@ void NeoPoolShow(bool json)
WSContentSend_PD(HTTP_SNS_NEOPOOL_STATUS, bg_color, HTTP_SNS_NEOPOOL_STATUS_ACTIVE, PSTR(D_NEOPOOL_STATUS_TANK));
} else if (NeoPoolGetData(MBF_PH_STATUS) & (MBMSK_PH_STATUS_ACID_PUMP_ACTIVE | MBMSK_PH_STATUS_BASE_PUMP_ACTIVE)) {
WSContentSend_PD(HTTP_SNS_NEOPOOL_STATUS, bg_color, HTTP_SNS_NEOPOOL_STATUS_ACTIVE, PSTR(D_NEOPOOL_STATUS_ON));
} else if (MBV_PH_ACID_ALARM0 != (NeoPoolGetData(MBF_PH_STATUS) & MBMSK_PH_STATUS_ALARM)) {
} else if (MBV_PH_ACID_BASE_ALARM0 != (NeoPoolGetData(MBF_PH_STATUS) & MBMSK_PH_STATUS_ALARM)) {
WSContentSend_PD(HTTP_SNS_NEOPOOL_STATUS, bg_color, HTTP_SNS_NEOPOOL_STATUS_NORMAL, PSTR(D_NEOPOOL_STATUS_WAIT));
}
} else {
@ -1852,9 +1870,9 @@ void NeoPoolShow(bool json)
// Ionization
if (NeoPoolIsIonization()) {
char spol[100];
snprintf_P(spol, sizeof(spol), PSTR(" " D_NEOPOOL_POLARIZATION "%d"), (NeoPoolGetData(MBF_ION_STATUS) & 0x6000) >> 13);
snprintf_P(spol, sizeof(spol), PSTR(" " D_NEOPOOL_POLARIZATION "%d"), (NeoPoolGetData(MBF_ION_STATUS) & (MBMSK_ION_STATUS_POL1 | MBMSK_ION_STATUS_POL2)) >> 13);
snprintf_P(stemp, sizeof(stemp), PSTR("%s%s%s"),
(NeoPoolGetData(MBF_ION_STATUS) & 0x6000) >> 13 ? spol : PSTR(""),
(NeoPoolGetData(MBF_ION_STATUS) & (MBMSK_ION_STATUS_POL1 | MBMSK_ION_STATUS_POL2)) ? spol : PSTR(""),
NeoPoolGetData(MBF_ION_STATUS) & MBMSK_ION_STATUS_ON_TARGET ? PSTR(" " D_NEOPOOL_SETPOINT_OK) : PSTR(""),
NeoPoolGetData(MBF_ION_STATUS) & MBMSK_ION_STATUS_PROGTIME_EXCEEDED ? PSTR(" " D_NEOPOOL_PR_OFF) : PSTR("")
);
@ -1862,7 +1880,7 @@ void NeoPoolShow(bool json)
WSContentSend_PD(HTTP_SNS_NEOPOOL_IONIZATION, neopool_type,
neopool_resolution.ion, &fvalue,
stemp,
NeoPoolGetData(MBF_ION_STATUS)&0x0002?PSTR(" " D_NEOPOOL_LOW):PSTR("")
NeoPoolGetData(MBF_ION_STATUS) & MBMSK_ION_STATUS_LOW ? PSTR(" " D_NEOPOOL_LOW) : PSTR("")
);
}
@ -2129,12 +2147,19 @@ void CmndNeopoolFiltration(void)
return;
}
}
if (value[0] >= 0 && value[0] <= 1) {
if (value[0] >= 0 && value[0] <= 2) {
// Set MBF_PAR_FILT_MODE
if (NEOPOOL_MODBUS_OK != NeoPoolWriteRegisterWord(MBF_PAR_FILT_MODE, MBV_PAR_FILT_MANUAL)) {
NeopoolResponseError();
return;
}
if (2 == value[0]) {
if (NEOPOOL_MODBUS_OK != NeoPoolReadRegister(MBF_PAR_FILTRATION_STATE, &data, 1)) {
NeopoolResponseError();
return;
}
value[0] = data ? 0 : 1;
}
// Set filtration mode to manual
if (NEOPOOL_MODBUS_OK != NeoPoolWriteRegisterWord(MBF_PAR_FILT_MANUAL_STATE, value[0])) {
NeopoolResponseError();
@ -2169,7 +2194,7 @@ void CmndNeopoolFiltrationMode(void)
if (XdrvMailbox.data_len) {
char command[CMDSZ];
int mode = GetCommandCode(command, sizeof(command), XdrvMailbox.data, kNeoPoolFiltrationMode);
int mode = GetCommandCode(command, sizeof(command), XdrvMailbox.data, kNeoPoolFiltrationModeCmnd);
if (mode >= 0) {
XdrvMailbox.payload = pgm_read_byte(sNeoPoolFiltrationMode + mode);
}
@ -2189,7 +2214,7 @@ void CmndNeopoolFiltrationMode(void)
NeopoolResponseError();
return;
}
ResponseCmndChar(GetTextIndexed(stemp, sizeof(stemp), data < MBV_PAR_FILT_INTELLIGENT ? data : nitems(kNeoPoolFiltrationMode)-1, kNeoPoolFiltrationMode));
ResponseCmndChar(GetTextIndexed(stemp, sizeof(stemp), data < MBV_PAR_FILT_INTELLIGENT ? data : nitems(kNeoPoolFiltrationModeCmnd)-1, kNeoPoolFiltrationMode));
}