From 0d99126c1636493865577bd4324c7be243cd7cd4 Mon Sep 17 00:00:00 2001 From: Norbert Richter Date: Fri, 11 Mar 2022 17:32:27 +0100 Subject: [PATCH] Add JSON modules info --- CHANGELOG.md | 2 +- tasmota/xsns_83_neopool.ino | 21 ++++++++++++++------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 40d6e4634..28b3799e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,7 +21,7 @@ All notable changes to this project will be documented in this file. - ESP32 TasmotaSerial uart mapping to support multiple ``begin()`` and implement ``getUart()`` (#14981) - Commands ``Sensor12 D0 .. D5, S0 .. S5`` allowing differential or single-ended modes (#15001) - NeoPool commands ``NPpHMin``, ``NPpHMax``, ``NPpH``, ``NPRedox``, ``NPHydrolysis``, ``NPIonization``, ``NPChlorine`` and ``NPControl`` (#15015) -- NeoPool system voltages display, add JSON power module, cell info, chlorine, conductivity and ionization to SENSOR +- NeoPool system voltages display, JSON modules, power module, cell info, chlorine, conductivity and ionization - Full DS3231 integration and synchronisation when using UBX (=GPS), NTP or manual time - LVGL Splash screen and ``SetOption135 1`` to disable splash screen - Command ``RfTimeout 100..60000`` to disable duplicate RfReceive. Default 1000 (#15061) diff --git a/tasmota/xsns_83_neopool.ino b/tasmota/xsns_83_neopool.ino index cdb465b9f..28f00a6bd 100644 --- a/tasmota/xsns_83_neopool.ino +++ b/tasmota/xsns_83_neopool.ino @@ -1390,7 +1390,7 @@ 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" @@ -1449,14 +1449,21 @@ void NeoPoolShow(bool json) #ifndef NEOPOOL_OPTIMIZE_READINGS // Time - ResponseAppend_P(PSTR("\"" D_JSON_TIME "\":\"%s\""), - GetDT(NeoPoolGetDataLong(MBF_PAR_TIME_LOW)).c_str()); + ResponseAppend_P(PSTR("\"" D_JSON_TIME "\":\"%s\","), GetDT(NeoPoolGetDataLong(MBF_PAR_TIME_LOW)).c_str()); +#endif // NEOPOOL_OPTIMIZE_READINGS // Type - ResponseAppend_P(PSTR(",")); -#endif // NEOPOOL_OPTIMIZE_READINGS - // Type - ResponseAppend_P(PSTR("\"" D_NEOPOOL_TYPE "\":\"%s\""), neopool_type); + ResponseAppend_P(PSTR("\"" D_JSON_TYPE "\":\"%s\""), neopool_type); + + // Module + ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_MODULES "\":{")); + ResponseAppend_P(PSTR( "\"" D_JSON_PH "\":%d"), NeoPoolIspHModule()); + ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_REDOX "\":%d"), NeoPoolIsRedox()); + ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_HYDROLYSIS "\":%d"), NeoPoolIsHydrolysis()); + ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_CHLORINE "\":%d"), NeoPoolIsChlorine()); + ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_CONDUCTIVITY "\":%d"), NeoPoolIsConductivity()); + ResponseAppend_P(PSTR(",\"" D_NEOPOOL_JSON_IONIZATION "\":%d"), NeoPoolIsIonization()); + ResponseJsonEnd(); // Temperature if (NeoPoolGetData(MBF_PAR_TEMPERATURE_ACTIVE)) {