Skip to content

Commit 09473f1

Browse files
authored
Merge pull request #2994 from MichaelDvP/dev
dev.12, add dhw4, 5,.. circuits, #2991
2 parents 4db8e43 + bbc2de0 commit 09473f1

File tree

6 files changed

+55
-80
lines changed

6 files changed

+55
-80
lines changed

CHANGELOG_LATEST.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ For more details go to [emsesp.org](https://emsesp.org/).
1212
- prometheus metrics for temperature/analog/scheduler/custom [#2962](https://github.com/emsesp/EMS-ESP32/issues/2962)
1313
- boiler pumpkick [#2965](https://github.com/emsesp/EMS-ESP32/discussions/2965)
1414
- heatpump reset [#2933](https://github.com/emsesp/EMS-ESP32/issues/2933)
15+
- 2.nd freshwater module (dhw4) [#2991](https://github.com/emsesp/EMS-ESP32/issues/2991)
1516

1617
## Fixed
1718

interface/pnpm-lock.yaml

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

platformio.ini

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ board_build.filesystem = littlefs
106106
lib_deps =
107107
bblanchon/ArduinoJson @ 7.4.2
108108
ESP32Async/AsyncTCP @ 3.4.10
109-
ESP32Async/ESPAsyncWebServer @ 3.10.2
109+
ESP32Async/ESPAsyncWebServer @ 3.10.3
110110
https://github.com/emsesp/EMS-ESP-Modules.git @ 1.0.8
111111

112112

@@ -168,19 +168,6 @@ build_flags =
168168
${common.build_flags}
169169
-DBOARD_C3_MINI_V1
170170

171-
; XIAO ESP32C - 512KB SRAM & 4MB Flash - https://wiki.seeedstudio.com/xiao_esp32c6_getting_started/
172-
[env:c6]
173-
framework = arduino
174-
board_build.partitions = partitions/esp32_partition_4M.csv
175-
board_upload.flash_size = 4MB
176-
board_build.app_partition_name = app0
177-
platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip ; Arduino Release v3.2.1 based on ESP-IDF v5.4.2
178-
; platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.30-2/platform-espressif32.zip ; Arduino Release v3.3.0 based on ESP-IDF v5.5.0
179-
board = seeed_xiao_esp32c6
180-
build_flags =
181-
${common.build_flags}
182-
-DBOARD_C6
183-
184171
; foundation for building and testing natively, standalone without an ESP32
185172
; use the `standalone` environment instead of `native` for testing
186173
[env:native]

src/core/system.cpp

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,25 +34,7 @@
3434
#endif
3535

3636
#ifndef EMSESP_STANDALONE
37-
#ifdef ESP_IDF_VERSION_MAJOR // IDF 4+
38-
#if CONFIG_IDF_TARGET_ESP32 // ESP32/PICO-D4
39-
#include "../esp32/rom/rtc.h"
40-
#elif CONFIG_IDF_TARGET_ESP32S2
41-
#include "../esp32s2/rom/rtc.h"
42-
#elif CONFIG_IDF_TARGET_ESP32C3
43-
#include "../esp32c3/rom/rtc.h"
44-
#elif CONFIG_IDF_TARGET_ESP32S3
45-
#include "../esp32s3/rom/rtc.h"
46-
#else
47-
#error Target CONFIG_IDF_TARGET is not supported
48-
#endif
49-
#else // ESP32 Before IDF 4.0
50-
#include "../rom/rtc.h"
51-
#endif
5237
#include <esp_mac.h>
53-
#endif
54-
55-
#ifndef EMSESP_STANDALONE
5638
#include "esp_efuse.h"
5739
#endif
5840

@@ -2534,37 +2516,38 @@ bool System::command_restart(const char * value, const int8_t id) {
25342516

25352517
std::string System::reset_reason(uint8_t cpu) const {
25362518
#ifndef EMSESP_STANDALONE
2537-
switch (rtc_get_reset_reason(cpu)) {
2538-
case 1:
2519+
switch (esp_rom_get_reset_reason(cpu)) {
2520+
case RESET_REASON_CHIP_POWER_ON:
25392521
return ("Power on reset");
2540-
// case 2 :reset pin not on esp32
2541-
case 3:
2522+
case 2: // not on esp32
2523+
return ("reset pin");
2524+
case RESET_REASON_CORE_SW:
25422525
return ("Software reset");
25432526
case 4: // not on S2, C3
25442527
return ("Legacy watch dog reset");
2545-
case 5:
2528+
case RESET_REASON_CORE_DEEP_SLEEP:
25462529
return ("Deep sleep reset");
2547-
case 6: // not on S2, C3
2548-
return ("Reset by SDIO");
2549-
case 7:
2530+
case 6: // RESET_REASON_CORE_SDIO: // not on S2, S3, C3
2531+
return ("Reset by SDIO");
2532+
case RESET_REASON_CORE_MWDT0:
25502533
return ("Timer group0 watch dog reset");
2551-
case 8:
2534+
case RESET_REASON_CORE_MWDT1:
25522535
return ("Timer group1 watch dog reset");
2553-
case 9:
2536+
case RESET_REASON_CORE_RTC_WDT:
25542537
return ("RTC watch dog reset");
25552538
case 10:
25562539
return ("Intrusion reset CPU");
2557-
case 11:
2540+
case RESET_REASON_CPU0_MWDT0:
25582541
return ("Timer group reset CPU");
2559-
case 12:
2542+
case RESET_REASON_CPU0_SW:
25602543
return ("Software reset CPU");
2561-
case 13:
2544+
case RESET_REASON_CPU0_RTC_WDT:
25622545
return ("RTC watch dog reset: CPU");
2563-
case 14: // not on S2, C3
2546+
case 14: // RESET_REASON_CPU1_CPU0: // not on S2, S3, C3
25642547
return ("APP CPU reset by PRO CPU");
2565-
case 15:
2548+
case RESET_REASON_SYS_BROWN_OUT:
25662549
return ("Brownout reset");
2567-
case 16:
2550+
case RESET_REASON_SYS_RTC_WDT:
25682551
return ("RTC watch dog reset: CPU+RTC");
25692552
default:
25702553
break;

src/devices/water.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,21 @@ Water::Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
2929
dhw_ = device_id - EMSdevice::EMS_DEVICE_ID_DHW1;
3030
int8_t tag = DeviceValueTAG::TAG_DHW1 + dhw_;
3131
if (flags == EMSdevice::EMS_DEVICE_FLAG_SM100) { // device_id 0x2A, DHW3
32+
3233
// telegram handlers
33-
register_telegram_type(0x07D6, "SM100wwTemperature", false, MAKE_PF_CB(process_SM100wwTemperature));
34-
register_telegram_type(0x07AA, "SM100wwStatus", false, MAKE_PF_CB(process_SM100wwStatus));
35-
register_telegram_type(0x07AB, "SM100wwCommand", false, MAKE_PF_CB(process_SM100wwCommand));
36-
register_telegram_type(0x07AC, "SM100wwParam1", false, MAKE_PF_CB(process_SM100wwParam2));
37-
register_telegram_type(0x07A5, "SM100wwCirc", true, MAKE_PF_CB(process_SM100wwCirc));
38-
register_telegram_type(0x07A6, "SM100wwParam", true, MAKE_PF_CB(process_SM100wwParam));
39-
register_telegram_type(0x07AE, "SM100wwKeepWarm", true, MAKE_PF_CB(process_SM100wwKeepWarm));
40-
register_telegram_type(0x07E0, "SM100wwStatus2", true, MAKE_PF_CB(process_SM100wwStatus2));
41-
register_telegram_type(0x07AD, "SM100ValveStatus", false, MAKE_PF_CB(process_SM100ValveStatus));
34+
register_telegram_type(0x07D6 + dhw_ - 2, "SM100wwTemperature", false, MAKE_PF_CB(process_SM100wwTemperature));
35+
register_telegram_type(0x07E0 + dhw_ - 2, "SM100wwStatus2", true, MAKE_PF_CB(process_SM100wwStatus2));
36+
register_telegram_type(0x07A6, "SM100wwParam", true, MAKE_PF_CB(process_SM100wwParam)); // same telegram for all circuits
37+
if (tag == DeviceValueTAG::TAG_DHW3) {
38+
register_telegram_type(0x07AA, "SM100wwStatus", false, MAKE_PF_CB(process_SM100wwStatus));
39+
register_telegram_type(0x07AC, "SM100wwParam1", false, MAKE_PF_CB(process_SM100wwParam2));
40+
register_telegram_type(0x07A5, "SM100wwCirc", true, MAKE_PF_CB(process_SM100wwCirc));
41+
register_telegram_type(0x07AE, "SM100wwKeepWarm", true, MAKE_PF_CB(process_SM100wwKeepWarm));
42+
register_telegram_type(0x07AD, "SM100ValveStatus", false, MAKE_PF_CB(process_SM100ValveStatus));
43+
register_telegram_type(0x07AB, "SM100wwCommand", false, MAKE_PF_CB(process_SM100wwCommand)); // command from thermostat
44+
} else if (tag == DeviceValueTAG::TAG_DHW4) {
45+
register_telegram_type(0x07C3, "SM100wwCommand", false, MAKE_PF_CB(process_SM100wwCommand)); // command from dhw3->dhw4
46+
}
4247
// device values...
4348
register_device_value(tag, &wwTemp_, DeviceValueType::UINT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwTemp), DeviceValueUOM::DEGREES);
4449
register_device_value(tag, &wwTemp2_, DeviceValueType::UINT16, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(wwStorageTemp1), DeviceValueUOM::DEGREES);
@@ -100,7 +105,7 @@ Water::Water(uint8_t device_type, uint8_t device_id, uint8_t product_id, const c
100105
}
101106
}
102107

103-
// SM100wwTemperature - 0x07D6
108+
// SM100wwTemperature - 0x07D6, dhw4: 0x07D7
104109
// Solar Module(0x2A) -> (0x00), (0x7D6), data: 01 C1 00 00 02 5B 01 AF 01 AD 80 00 01 90
105110
void Water::process_SM100wwTemperature(std::shared_ptr<const Telegram> telegram) {
106111
has_update(telegram, wwTemp_, 0); // is *10 TS17
@@ -156,12 +161,10 @@ void Water::process_SM100ValveStatus(std::shared_ptr<const Telegram> telegram) {
156161
has_update(telegram, wwRetValve_, 1);
157162
}
158163

159-
/*
160-
// SM100ww? - 0x7E0, some kind of status
164+
// SM100ww? - 0x7E0, some kind of status, dhw4: 0x7E1
161165
// data: 00 00 46 00 00 01 06 0E 06 0E 00 00 00 00 00 03 03 03 03
162166
// publishes single values offset 1/2(16bit), offset 5, offset 6, offset 7, offset 8, offset 9,
163167
// status2 = 03:"no heat", 06:"heat request", 08:"disinfecting", 09:"hold"
164-
*/
165168
void Water::process_SM100wwStatus2(std::shared_ptr<const Telegram> telegram) {
166169
// has_update(telegram, wwFlow_, 7); // single byte, wrong see #1387
167170
has_update(telegram, wwStatus2_, 8);
@@ -170,6 +173,7 @@ void Water::process_SM100wwStatus2(std::shared_ptr<const Telegram> telegram) {
170173

171174
// SM100wwCommand - 0x07AB
172175
// Thermostat(0x10) -> Solar Module(0x2A), (0x7AB), data: 01 00 01
176+
// or dhw3 module (0x2A) -> dhw4 module(0x2B), (0x7C3), data: 01 01 00
173177
void Water::process_SM100wwCommand(std::shared_ptr<const Telegram> telegram) {
174178
// not implemented yet
175179
}

src/emsesp_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
#define EMSESP_APP_VERSION "3.8.2-dev.11"
1+
#define EMSESP_APP_VERSION "3.8.2-dev.12"

0 commit comments

Comments
 (0)