From c1effa9681e2890cd735da9fc3391e9140d2875c Mon Sep 17 00:00:00 2001 From: proddy Date: Tue, 23 Feb 2021 14:10:55 +0100 Subject: [PATCH] merge in https://github.com/proddy/EMS-ESP/pull/714 --- src/devices/boiler.cpp | 18 +++++++++--------- src/devices/boiler.h | 21 +++++++++++---------- src/devices/solar.cpp | 10 +++++----- src/devices/solar.h | 4 ++-- src/test/test.cpp | 4 ++++ src/test/test.h | 2 ++ 6 files changed, 33 insertions(+), 26 deletions(-) diff --git a/src/devices/boiler.cpp b/src/devices/boiler.cpp index b9a35189a..56757f807 100644 --- a/src/devices/boiler.cpp +++ b/src/devices/boiler.cpp @@ -143,8 +143,8 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const register_device_value(TAG_BOILER_DATA_WW, &wWCurTemp_, DeviceValueType::USHORT, FL_(div10), F("wWCurTemp"), F("Warm Water current temperature (intern)"), DeviceValueUOM::DEGREES); register_device_value(TAG_BOILER_DATA_WW, &wWCurTemp2_, DeviceValueType::USHORT, FL_(div10), F("wWCurTemp2"), F("Warm Water current temperature (extern)"), DeviceValueUOM::DEGREES); register_device_value(TAG_BOILER_DATA_WW, &wWCurFlow_, DeviceValueType::UINT, FL_(div10), F("wWCurFlow"), F("Warm Water current tap water flow"), DeviceValueUOM::LMIN); - register_device_value(TAG_BOILER_DATA_WW, &wwStorageTemp1_, DeviceValueType::USHORT, FL_(div10), F("wwStorageTemp1"), F("Warm water storage temperature (intern)"), DeviceValueUOM::DEGREES); - register_device_value(TAG_BOILER_DATA_WW, &wwStorageTemp2_, DeviceValueType::USHORT, FL_(div10), F("wwStorageTemp2"), F("Warm water storage temperature (extern)"), DeviceValueUOM::DEGREES); + register_device_value(TAG_BOILER_DATA_WW, &wWStorageTemp1_, DeviceValueType::USHORT, FL_(div10), F("wWStorageTemp1"), F("Warm water storage temperature (intern)"), DeviceValueUOM::DEGREES); + register_device_value(TAG_BOILER_DATA_WW, &wWStorageTemp2_, DeviceValueType::USHORT, FL_(div10), F("wWStorageTemp2"), F("Warm water storage temperature (extern)"), DeviceValueUOM::DEGREES); register_device_value(TAG_BOILER_DATA_WW, &wWActivated_, DeviceValueType::BOOL, nullptr, F("wWActivated"), F("Warm Water activated"), DeviceValueUOM::NONE); register_device_value(TAG_BOILER_DATA_WW, &wWOneTime_, DeviceValueType::BOOL, nullptr, F("wWOneTime"), F("Warm Water one time charging"), DeviceValueUOM::NONE); register_device_value(TAG_BOILER_DATA_WW, &wWDisinfecting_, DeviceValueType::BOOL, nullptr, F("wWDisinfecting"), F("Warm Water disinfecting"), DeviceValueUOM::NONE); @@ -154,8 +154,8 @@ Boiler::Boiler(uint8_t device_type, int8_t device_id, uint8_t product_id, const register_device_value(TAG_BOILER_DATA_WW, &wWActive_, DeviceValueType::BOOL, nullptr, F("wWActive"), F("Warm Water active"), DeviceValueUOM::NONE); register_device_value(TAG_BOILER_DATA_WW, &wWHeat_, DeviceValueType::BOOL, nullptr, F("wWHeat"), F("Warm Water heating"), DeviceValueUOM::NONE); register_device_value(TAG_BOILER_DATA_WW, &wWSetPumpPower_, DeviceValueType::UINT, nullptr, F("wWSetPumpPower"), F("Warm Water pump set power"), DeviceValueUOM::PERCENT); - register_device_value(TAG_BOILER_DATA_WW, &wwMixTemperature_, DeviceValueType::USHORT, nullptr, F("wwMixTemperature"), F("Warm Water mix temperature"), DeviceValueUOM::DEGREES); - register_device_value(TAG_BOILER_DATA_WW, &wwBufferTemperature_, DeviceValueType::USHORT, nullptr, F("wwBufferTemperature"), F("Warm Water buffer boiler temperature"), DeviceValueUOM::DEGREES); + register_device_value(TAG_BOILER_DATA_WW, &mixerTemp_, DeviceValueType::USHORT, FL_(div10), F("mixerTemp"), F("Mixer temperature"), DeviceValueUOM::DEGREES); + register_device_value(TAG_BOILER_DATA_WW, &tankMiddleTemp_, DeviceValueType::USHORT, FL_(div10), F("tankMiddleTemp"), F("Tank middle temperature (TS3)"), DeviceValueUOM::DEGREES); register_device_value(TAG_BOILER_DATA_WW, &wWStarts_, DeviceValueType::ULONG, nullptr, F("wWStarts"), F("Warm Water # starts"), DeviceValueUOM::NONE); register_device_value(TAG_BOILER_DATA_WW, &wWStarts2_, DeviceValueType::ULONG, nullptr, F("wWStarts2"), F("Warm Water # starts (control)"), DeviceValueUOM::NONE); register_device_value(TAG_BOILER_DATA_WW, &wWWorkM_, DeviceValueType::TIME, nullptr, F("wWWorkM"), F("Warm Water active time"), DeviceValueUOM::MINUTES); @@ -291,9 +291,9 @@ void Boiler::process_UBAMonitorFast(std::shared_ptr telegram) { has_update(telegram->read_bitvalue(wWCirc_, 7, 7)); // warm water storage sensors (if present) - // wwStorageTemp2 is also used by some brands as the boiler temperature - see https://github.com/proddy/EMS-ESP/issues/206 - has_update(telegram->read_value(wwStorageTemp1_, 9)); // 0x8300 if not available - has_update(telegram->read_value(wwStorageTemp2_, + // wWStorageTemp2 is also used by some brands as the boiler temperature - see https://github.com/proddy/EMS-ESP/issues/206 + has_update(telegram->read_value(wWStorageTemp1_, 9)); // 0x8300 if not available + has_update(telegram->read_value(wWStorageTemp2_, 11)); // 0x8000 if not available - this is boiler temp has_update(telegram->read_value(retTemp_, 13)); @@ -550,8 +550,8 @@ void Boiler::process_UBAEnergySupplied(std::shared_ptr telegram) // e.g. 88 00 2A 00 00 00 00 00 00 00 00 00 D2 00 00 80 00 00 01 08 80 00 02 47 00 // see https://github.com/proddy/EMS-ESP/issues/397 void Boiler::process_MC10Status(std::shared_ptr telegram) { - has_update(telegram->read_value(wwMixTemperature_, 14)); - has_update(telegram->read_value(wwBufferTemperature_, 18)); + has_update(telegram->read_value(mixerTemp_, 14)); + has_update(telegram->read_value(tankMiddleTemp_, 18)); } /* diff --git a/src/devices/boiler.h b/src/devices/boiler.h index e48402ac8..ee846385a 100644 --- a/src/devices/boiler.h +++ b/src/devices/boiler.h @@ -61,22 +61,23 @@ class Boiler : public EMSdevice { uint16_t wWCurTemp_; // Warm Water current temperature uint16_t wWCurTemp2_; // Warm Water current temperature storage uint8_t wWCurFlow_; // Warm Water current flow temp in l/min - uint16_t wwStorageTemp1_; // warm water storage temp 1 - uint16_t wwStorageTemp2_; // warm water storage temp 2 + uint16_t wWStorageTemp1_; // warm water storage temp 1 + uint16_t wWStorageTemp2_; // warm water storage temp 2 uint8_t wWActivated_; // Warm Water activated uint8_t wWOneTime_; // Warm Water one time function on/off uint8_t wWDisinfecting_; // Warm Water disinfection on/off uint8_t wWCharging_; // Warm Water charging on/off uint8_t wWRecharging_; // Warm Water recharge on/off uint8_t wWTempOK_; // Warm Water temperature ok on/off - uint8_t wWActive_; - uint8_t wWHeat_; // 3-way valve on WW - uint8_t wWSetPumpPower_; // ww pump speed/power? - uint16_t wwMixTemperature_; // mixing temperature - uint16_t wwBufferTemperature_; // buffertemperature - uint32_t wWStarts_; // Warm Water # starts - uint32_t wWStarts2_; // Warm water starts (control) - uint32_t wWWorkM_; // Warm Water # minutes + uint8_t wWActive_; // + uint8_t wWHeat_; // 3-way valve on WW + uint8_t wWSetPumpPower_; // ww pump speed/power? + uint32_t wWStarts_; // Warm Water # starts + uint32_t wWStarts2_; // Warm water starts (control) + uint32_t wWWorkM_; // Warm Water # minutes + + uint16_t mixerTemp_; // mixing temperature + uint16_t tankMiddleTemp_; // Tank middle temperature (TS3) // main uint8_t heatingActive_; // Central heating is on/off diff --git a/src/devices/solar.cpp b/src/devices/solar.cpp index 5b5aabff7..333512cab 100644 --- a/src/devices/solar.cpp +++ b/src/devices/solar.cpp @@ -69,8 +69,8 @@ Solar::Solar(uint8_t device_type, uint8_t device_id, uint8_t product_id, const s } register_device_value(TAG_NONE, &collectorTemp_, DeviceValueType::SHORT, FL_(div10), F("collectorTemp"), F("Collector temperature (TS1)"), DeviceValueUOM::DEGREES); - register_device_value(TAG_NONE, &tankBottomTemp_, DeviceValueType::SHORT, FL_(div10), F("tankBottomTemp"), F("Bottom temperature (TS2)"), DeviceValueUOM::DEGREES); - register_device_value(TAG_NONE, &tankBottomTemp2_, DeviceValueType::SHORT, FL_(div10), F("tankBottomTemp2"), F("Bottom temperature (TS5)"), DeviceValueUOM::DEGREES); + register_device_value(TAG_NONE, &tankBottomTemp_, DeviceValueType::SHORT, FL_(div10), F("tankBottomTemp"), F("Tank Bottom temperature (TS2)"), DeviceValueUOM::DEGREES); + register_device_value(TAG_NONE, &tankBottomTemp2_, DeviceValueType::SHORT, FL_(div10), F("tankBottomTemp2"), F("Tank Bottom temperature (TS5)"), DeviceValueUOM::DEGREES); register_device_value(TAG_NONE, &heatExchangerTemp_, DeviceValueType::SHORT, FL_(div10), F("heatExchangerTemp"), F("Heat exchanger temperature (TS6)"), DeviceValueUOM::DEGREES); register_device_value(TAG_NONE, &tank1MaxTempCurrent_, DeviceValueType::UINT, nullptr, F("tank1MaxTempCurrent"), F("Maximum Tank temperature"), DeviceValueUOM::NONE); @@ -118,7 +118,7 @@ bool Solar::publish_ha_config() { // SM10Monitor - type 0x97 void Solar::process_SM10Monitor(std::shared_ptr telegram) { has_update(telegram->read_value(collectorTemp_, 2)); // collector temp from SM10, is *10 - has_update(telegram->read_value(tankBottomTemp_, 5)); // bottom temp from SM10, is *10 + has_update(telegram->read_value(tankBottomTemp_, 5)); // tank bottom temp from SM10, is *10 has_update(telegram->read_value(solarPumpModulation_, 4)); // modulation solar pump has_update(telegram->read_bitvalue(solarPump_, 7, 1)); has_update(telegram->read_value(pumpWorkMin_, 8, 3)); @@ -187,7 +187,7 @@ void Solar::process_SM100ParamCfg(std::shared_ptr telegram) { * e.g. B0 0B FF 00 02 62 00 77 01 D4 80 00 80 00 80 00 80 00 80 00 80 00 80 00 80 00 00 F9 80 00 80 9E - for heat exchanger temp * e.g, 30 00 FF 00 02 62 01 AC * 30 00 FF 18 02 62 80 00 - * 30 00 FF 00 02 62 01 A1 - for bottom temps + * 30 00 FF 00 02 62 01 A1 - for tank bottom temps * bytes 0+1 = TS1 Temperature sensor for collector * bytes 2+3 = TS2 Temperature sensor 1 cylinder, bottom * bytes 16+17 = TS5 Temperature sensor 2 cylinder, bottom, or swimming pool @@ -308,7 +308,7 @@ void Solar::process_SM100Time(std::shared_ptr telegram) { */ void Solar::process_ISM1StatusMessage(std::shared_ptr telegram) { has_update(telegram->read_value(collectorTemp_, 4)); // Collector Temperature - has_update(telegram->read_value(tankBottomTemp_, 6)); // Temperature Bottom of Solar Boiler + has_update(telegram->read_value(tankBottomTemp_, 6)); // Temperature Bottom of Solar Boiler tank uint16_t Wh = 0xFFFF; has_update(telegram->read_value(Wh, 2)); // Solar Energy produced in last hour only ushort, is not * 10 diff --git a/src/devices/solar.h b/src/devices/solar.h index 4a3bbca84..09ff8c639 100644 --- a/src/devices/solar.h +++ b/src/devices/solar.h @@ -33,8 +33,8 @@ class Solar : public EMSdevice { static uuid::log::Logger logger_; int16_t collectorTemp_; // TS1: Temperature sensor for collector array 1 - int16_t tankBottomTemp_; // TS2: Temperature sensor 1 cylinder, bottom (solar thermal system) - int16_t tankBottomTemp2_; // TS5: Temperature sensor 2 cylinder, bottom, or swimming pool (solar thermal system) + int16_t tankBottomTemp_; // TS2: Temperature sensor 1 cylinder, bottom tank (solar thermal system) + int16_t tankBottomTemp2_; // TS5: Temperature sensor 2 cylinder, bottom tank, or swimming pool (solar thermal system) int16_t heatExchangerTemp_; // TS6: Heat exchanger temperature sensor uint8_t solarPumpModulation_; // PS1: modulation solar pump uint8_t cylinderPumpModulation_; // PS5: modulation cylinder pump diff --git a/src/test/test.cpp b/src/test/test.cpp index ec83a6284..968b1c879 100644 --- a/src/test/test.cpp +++ b/src/test/test.cpp @@ -953,6 +953,7 @@ void Test::add_device(uint8_t device_id, uint8_t product_id) { uart_telegram({device_id, EMSESP_DEFAULT_EMS_BUS_ID, EMSdevice::EMS_TYPE_VERSION, 0, product_id, 1, 0}); } +#ifndef EMSESP_STANDALONE void Test::listDir(fs::FS & fs, const char * dirname, uint8_t levels) { Serial.printf("Listing directory: %s\r\n", dirname); @@ -983,6 +984,7 @@ void Test::listDir(fs::FS & fs, const char * dirname, uint8_t levels) { file = root.openNextFile(); } } +#endif void Test::debug(uuid::console::Shell & shell, const std::string & cmd) { // shell.add_flags(CommandFlags::ADMIN); // switch to su @@ -994,9 +996,11 @@ void Test::debug(uuid::console::Shell & shell, const std::string & cmd) { command = cmd; } +#ifndef EMSESP_STANDALONE if (command == "ls") { listDir(LITTLEFS, "/", 3); } +#endif } } // namespace emsesp diff --git a/src/test/test.h b/src/test/test.h index 0e93118c9..6abad1c1a 100644 --- a/src/test/test.h +++ b/src/test/test.h @@ -45,7 +45,9 @@ class Test { static void debug(uuid::console::Shell & shell, const std::string & command); private: +#ifndef EMSESP_STANDALONE static void listDir(fs::FS & fs, const char * dirname, uint8_t levels); +#endif }; } // namespace emsesp