From 1e2f2385b89dd6fcd5fc193bc4aab1939cae3e09 Mon Sep 17 00:00:00 2001 From: Norbert Richter Date: Sat, 9 Apr 2022 18:33:45 +0200 Subject: [PATCH 1/5] Add filtration toggle --- tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino index e2171bcfb..09e71b77c 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino @@ -732,8 +732,11 @@ const char HTTP_SNS_NEOPOOL_STATUS_ACTIVE[] PROGMEM = "filter:invert(1)"; * Commands * * NPFiltration { {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 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 {} @@ -2129,12 +2132,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(); From 720b3f7c9b27b4b688c94330ecd4c491a321bfd0 Mon Sep 17 00:00:00 2001 From: Norbert Richter Date: Tue, 12 Apr 2022 08:36:02 +0200 Subject: [PATCH 2/5] Change json unlocalized --- .../tasmota_xsns_sensor/xsns_83_neopool.ino | 103 ++++++++++-------- 1 file changed, 59 insertions(+), 44 deletions(-) diff --git a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino index 09e71b77c..93c67abbb 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino @@ -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, @@ -1420,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 "\":")); @@ -2179,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); } @@ -2199,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)); } From 3fb19a633afa4806509fb28a7d704953cc8b9796 Mon Sep 17 00:00:00 2001 From: Norbert Richter Date: Tue, 12 Apr 2022 10:30:22 +0200 Subject: [PATCH 3/5] Rework register const --- .../tasmota_xsns_sensor/xsns_83_neopool.ino | 47 +++++++------------ 1 file changed, 18 insertions(+), 29 deletions(-) diff --git a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino index 93c67abbb..b06b6bb1e 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino @@ -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 @@ -278,28 +278,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 +358,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 @@ -1658,7 +1647,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 ); @@ -1782,7 +1771,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)); @@ -1825,7 +1814,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 { @@ -1870,9 +1859,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("") ); @@ -1880,7 +1869,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("") ); } From 2fa0a6edf35b84e33fcd52000c9a3901b1b89f39 Mon Sep 17 00:00:00 2001 From: Norbert Richter Date: Tue, 19 Jul 2022 16:57:49 +0200 Subject: [PATCH 4/5] Add MBV_TIMER_OFFMB_TIMER_ENABLE countdown keys --- tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino index b06b6bb1e..c4acec94a 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino @@ -501,7 +501,9 @@ 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_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 From b4dfd87912745909fe7ceb3943b53f6bf03a06de Mon Sep 17 00:00:00 2001 From: Norbert Richter Date: Sun, 9 Oct 2022 15:34:22 +0200 Subject: [PATCH 5/5] Update NeoPool register desc --- .../tasmota_xsns_sensor/xsns_83_neopool.ino | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino index c4acec94a..6865f38cb 100644 --- a/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino +++ b/tasmota/tasmota_xsns_sensor/xsns_83_neopool.ino @@ -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 @@ -503,18 +505,25 @@ enum NeoPoolConstAndBitMask { MBV_PAR_CTIMER_ALWAYS_OFF = 4, // Relay assigned to this timer always off 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