mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 00:39:50 +03:00
mixing updates
This commit is contained in:
@@ -428,11 +428,9 @@ void Boiler::show_values(uuid::console::Shell & shell) {
|
||||
if (hpSpeed_ != EMS_VALUE_UINT_NOTSET) {
|
||||
print_value(shell, F("Heat Pump speed"), F_(percent), Helpers::render_value(buffer, hpSpeed_, 1));
|
||||
}
|
||||
|
||||
shell.println();
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Check if hot tap water or heating is active
|
||||
* If a value has changed, post it immediately to MQTT so we get real time data
|
||||
*/
|
||||
@@ -510,7 +508,7 @@ void Boiler::process_UBAMonitorFast(std::shared_ptr<const Telegram> telegram) {
|
||||
check_active();
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* UBATotalUptime - type 0x14 - total uptime
|
||||
* received only after requested (not broadcasted)
|
||||
*/
|
||||
@@ -518,7 +516,7 @@ void Boiler::process_UBATotalUptime(std::shared_ptr<const Telegram> telegram) {
|
||||
telegram->read_value(UBAuptime_, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* UBAParameters - type 0x16
|
||||
*/
|
||||
void Boiler::process_UBAParameters(std::shared_ptr<const Telegram> telegram) {
|
||||
@@ -527,7 +525,7 @@ void Boiler::process_UBAParameters(std::shared_ptr<const Telegram> telegram) {
|
||||
telegram->read_value(pump_mod_min_, 10);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* UBAMonitorWW - type 0x34 - warm water monitor. 19 bytes long
|
||||
* received every 10 seconds
|
||||
*/
|
||||
@@ -545,7 +543,7 @@ void Boiler::process_UBAMonitorWW(std::shared_ptr<const Telegram> telegram) {
|
||||
telegram->read_value(wWTemperatureOK_, 5, 5);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* UBAMonitorFastPlus - type 0xE4 - central heating monitor EMS+
|
||||
*/
|
||||
void Boiler::process_UBAMonitorFastPlus(std::shared_ptr<const Telegram> telegram) {
|
||||
@@ -570,7 +568,7 @@ void Boiler::process_UBAMonitorFastPlus(std::shared_ptr<const Telegram> telegram
|
||||
check_active();
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* UBAMonitorSlow - type 0x19 - central heating monitor part 2 (27 bytes long)
|
||||
* received every 60 seconds
|
||||
* e.g. 08 00 19 00 80 00 02 41 80 00 00 00 00 00 03 91 7B 05 B8 40 00 00 00 04 92 AD 00 5E EE 80 00
|
||||
@@ -588,7 +586,7 @@ void Boiler::process_UBAMonitorSlow(std::shared_ptr<const Telegram> telegram) {
|
||||
telegram->read_value(heatWorkMin_, 19);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* UBAMonitorSlowPlus - type 0xE5 - central heating monitor EMS+
|
||||
*/
|
||||
void Boiler::process_UBAMonitorSlowPlus(std::shared_ptr<const Telegram> telegram) {
|
||||
@@ -635,7 +633,7 @@ void Boiler::process_UBADHWStatus(std::shared_ptr<const Telegram> telegram) {
|
||||
telegram->read_value(wWDisinfectTemp_, 9);
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* UBAOutdoorTemp - type 0xD1 - external temperature EMS+
|
||||
*/
|
||||
void Boiler::process_UBAOutdoorTemp(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
{101, DeviceType::SOLAR, F("ISM1"), DeviceFlags::EMS_DEVICE_FLAG_SM100},
|
||||
{162, DeviceType::SOLAR, F("SM50"), DeviceFlags::EMS_DEVICE_FLAG_SM100},
|
||||
|
||||
// Mixing Modules - 0x20 / 0x21
|
||||
// Mixing Modules - 0x20-0x27 for HC, 0x28-0x29 for WWC
|
||||
{160, DeviceType::MIXING, F("MM100"), DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{161, DeviceType::MIXING, F("MM200"), DeviceFlags::EMS_DEVICE_FLAG_MMPLUS},
|
||||
{ 69, DeviceType::MIXING, F("MM10"), DeviceFlags::EMS_DEVICE_FLAG_MM10},
|
||||
|
||||
@@ -194,6 +194,8 @@ void EMSESP::show_values(uuid::console::Shell & shell) {
|
||||
shell.println();
|
||||
}
|
||||
}
|
||||
|
||||
shell.println();
|
||||
}
|
||||
|
||||
// publish all values from each EMS device to MQTT
|
||||
@@ -301,7 +303,7 @@ std::string EMSESP::pretty_telegram(std::shared_ptr<const Telegram> telegram) {
|
||||
return str;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* Type 0x07 - UBADevices - shows us the connected EMS devices
|
||||
* e.g. 08 00 07 00 0B 80 00 00 00 00 00 00 00 00 00 00 00
|
||||
* Junkers has 15 bytes of data
|
||||
|
||||
@@ -52,8 +52,6 @@ void Heatpump::add_context_menu() {
|
||||
// display all values into the shell console
|
||||
void Heatpump::show_values(uuid::console::Shell & shell) {
|
||||
EMSdevice::show_values(shell); // always call this to show header
|
||||
|
||||
shell.println();
|
||||
}
|
||||
|
||||
// publish values via MQTT
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
#include "mixing.h"
|
||||
|
||||
// MAKE_PSTR_WORD(mixing)
|
||||
|
||||
namespace emsesp {
|
||||
|
||||
REGISTER_FACTORY(Mixing, EMSdevice::DeviceType::MIXING);
|
||||
@@ -55,15 +53,22 @@ void Mixing::add_context_menu() {
|
||||
void Mixing::show_values(uuid::console::Shell & shell) {
|
||||
EMSdevice::show_values(shell); // always call this to show header
|
||||
|
||||
if (type_ == Type::NONE) {
|
||||
return; // don't have any values yet
|
||||
}
|
||||
|
||||
char buffer[10]; // used for formatting
|
||||
|
||||
shell.printfln(F(" Circuit #: %d"), hc_);
|
||||
if (type_ == Type::WWC) {
|
||||
shell.printfln(F(" Warm Water Circuit #: %d"), hc_);
|
||||
|
||||
} else {
|
||||
shell.printfln(F(" Heating Circuit #: %d"), hc_);
|
||||
}
|
||||
print_value(shell, F("Current flow temperature"), F_(degrees), Helpers::render_value(buffer, flowTemp_, 10));
|
||||
print_value(shell, F("Setpoint flow temperature"), F_(degrees), Helpers::render_value(buffer, flowSetTemp_, 1));
|
||||
print_value(shell, F("Current pump modulation"), Helpers::render_value(buffer, pumpMod_, 1));
|
||||
print_value(shell, F("Current valve status"), Helpers::render_value(buffer, valveStatus_, 1));
|
||||
|
||||
shell.println();
|
||||
print_value(shell, F("Current valve status"), Helpers::render_value(buffer, status_, 1));
|
||||
}
|
||||
|
||||
// publish values via MQTT
|
||||
@@ -71,6 +76,18 @@ void Mixing::show_values(uuid::console::Shell & shell) {
|
||||
void Mixing::publish_values() {
|
||||
DynamicJsonDocument doc(EMSESP_MAX_JSON_SIZE_SMALL);
|
||||
|
||||
switch (type_) {
|
||||
case Type::HC:
|
||||
doc["type"] = F("hc");
|
||||
break;
|
||||
case Type::WWC:
|
||||
doc["type"] = F("wwc");
|
||||
break;
|
||||
case Type::NONE:
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
if (flowTemp_ != EMS_VALUE_USHORT_NOTSET) {
|
||||
doc["flowTemp"] = (float)flowTemp_ / 10;
|
||||
}
|
||||
@@ -79,12 +96,12 @@ void Mixing::publish_values() {
|
||||
doc["pumpMod"] = pumpMod_;
|
||||
}
|
||||
|
||||
if (valveStatus_ != EMS_VALUE_UINT_NOTSET) {
|
||||
doc["valveStatus_"] = valveStatus_;
|
||||
if (status_ != EMS_VALUE_UINT_NOTSET) {
|
||||
doc["status"] = status_;
|
||||
}
|
||||
|
||||
if (flowSetTemp_ != EMS_VALUE_UINT_NOTSET) {
|
||||
doc["flowSetTemp_"] = flowSetTemp_;
|
||||
doc["flowSetTemp"] = flowSetTemp_;
|
||||
}
|
||||
|
||||
#ifdef EMSESP_DEBUG
|
||||
@@ -107,27 +124,34 @@ bool Mixing::updated_values() {
|
||||
void Mixing::console_commands() {
|
||||
}
|
||||
|
||||
// 0x02D7, 0x02D8 etc...
|
||||
// heating circuits 0x02D7, 0x02D8 etc...
|
||||
void Mixing::process_MMPLUSStatusMessage_HC(std::shared_ptr<const Telegram> telegram) {
|
||||
hc_ = 0x02D8 - telegram->type_id; // determine which circuit this is
|
||||
telegram->read_value(flowTemp_, 3); // isd * 10
|
||||
type_ = Type::HC;
|
||||
hc_ = telegram->type_id - 0x02D7 + 1; // determine which circuit this is
|
||||
telegram->read_value(flowTemp_, 3); // is * 10
|
||||
telegram->read_value(pumpMod_, 5);
|
||||
telegram->read_value(valveStatus_, 2);
|
||||
telegram->read_value(status_, 2); // valve status
|
||||
}
|
||||
|
||||
// Mixing module warm water loading - 0x0331, 0x0332
|
||||
// Mixing module warm water loading/DHW - 0x0331, 0x0332
|
||||
// e.g. A9 00 FF 00 02 32 02 6C 00 3C 00 3C 3C 46 02 03 03 00 3C // on 0x28
|
||||
// A8 00 FF 00 02 31 02 35 00 3C 00 3C 3C 46 02 03 03 00 3C // in 0x29
|
||||
void Mixing::process_MMPLUSStatusMessage_WWC(std::shared_ptr<const Telegram> telegram) {
|
||||
hc_ = 0x0332 - telegram->type_id; // determine which circuit this is. There are max 2.
|
||||
telegram->read_value(flowTemp_, 0); // isd * 10
|
||||
type_ = Type::WWC;
|
||||
hc_ = telegram->type_id - 0x0331 + 1; // determine which circuit this is. There are max 2.
|
||||
telegram->read_value(flowTemp_, 0); // is * 10
|
||||
telegram->read_value(pumpMod_, 2);
|
||||
telegram->read_value(valveStatus_, 11);
|
||||
telegram->read_value(status_, 11); // temp status
|
||||
}
|
||||
|
||||
// Mixing on a MM10 - 0xAB
|
||||
// We assume MM10 is on HC2 and WM10 is using HC1 - https://github.com/proddy/EMS-ESP/issues/270
|
||||
void Mixing::process_MMStatusMessage(std::shared_ptr<const Telegram> telegram) {
|
||||
hc_ = 1; // fixed
|
||||
telegram->read_value(flowTemp_, 1); // isd * 10
|
||||
type_ = Type::HC;
|
||||
hc_ = 1; // fixed to circuit 1
|
||||
telegram->read_value(flowTemp_, 1); // is * 10
|
||||
telegram->read_value(pumpMod_, 3);
|
||||
telegram->read_value(valveStatus_, 0);
|
||||
telegram->read_value(flowSetTemp_, 0);
|
||||
}
|
||||
|
||||
} // namespace emsesp
|
||||
@@ -50,12 +50,19 @@ class Mixing : public EMSdevice {
|
||||
void process_MMPLUSStatusMessage_WWC(std::shared_ptr<const Telegram> telegram);
|
||||
void process_MMStatusMessage(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
enum class Type {
|
||||
NONE,
|
||||
HC, // heating circuit
|
||||
WWC // warm water circuit
|
||||
};
|
||||
|
||||
private:
|
||||
uint16_t hc_ = EMS_VALUE_USHORT_NOTSET;
|
||||
uint16_t flowTemp_ = EMS_VALUE_USHORT_NOTSET;
|
||||
uint8_t pumpMod_ = EMS_VALUE_UINT_NOTSET;
|
||||
uint8_t valveStatus_ = EMS_VALUE_UINT_NOTSET;
|
||||
uint8_t status_ = EMS_VALUE_UINT_NOTSET;
|
||||
uint8_t flowSetTemp_ = EMS_VALUE_UINT_NOTSET;
|
||||
Type type_ = Type::NONE;
|
||||
};
|
||||
|
||||
} // namespace emsesp
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "solar.h"
|
||||
|
||||
// MAKE_PSTR_WORD(solar)
|
||||
MAKE_PSTR(kwh, "kWh")
|
||||
MAKE_PSTR(wh, "Wh")
|
||||
|
||||
@@ -69,8 +68,6 @@ void Solar::show_values(uuid::console::Shell & shell) {
|
||||
print_value(shell, F("Energy last hour"), F_(wh), Helpers::render_value(buffer, energyLastHour_, 10));
|
||||
print_value(shell, F("Energy today"), F_(wh), Helpers::render_value(buffer, energyToday_, 0)); // no division
|
||||
print_value(shell, F("Energy total"), F_(kwh), Helpers::render_value(buffer, energyTotal_, 10));
|
||||
|
||||
shell.println();
|
||||
}
|
||||
|
||||
// publish values via MQTT
|
||||
|
||||
@@ -339,6 +339,32 @@ void EMSESP::run_test(uuid::console::Shell & shell, const std::string & command)
|
||||
return;
|
||||
}
|
||||
|
||||
if (command == "mixing") {
|
||||
shell.printfln(F("Mixing Solar"));
|
||||
|
||||
rxservice_.ems_mask(EMSbus::EMS_MASK_BUDERUS);
|
||||
|
||||
std::string version("1.2.3");
|
||||
add_device(0x28, 160, version, EMSdevice::Brand::BUDERUS); // MM100, WWC
|
||||
add_device(0x29, 161, version, EMSdevice::Brand::BUDERUS); // MM200, WWC
|
||||
|
||||
rxservice_.loop();
|
||||
|
||||
// WWC1 on 0x29
|
||||
uint8_t m1[] = {0xA9, 0x00, 0xFF, 0x00, 0x02, 0x32, 0x02, 0x6C, 0x00, 0x3C, 0x00, 0x3C, 0x3C, 0x46, 0x02, 0x03, 0x03, 0x00, 0x3C, 0x57};
|
||||
rxservice_.add(m1, sizeof(m1));
|
||||
rxservice_.loop();
|
||||
|
||||
// WWC2 on 0x28
|
||||
uint8_t m2[] = {0xA8, 0x00, 0xFF, 0x00, 0x02, 0x31, 0x02, 0x35, 0x00, 0x3C, 0x00, 0x3C, 0x3C, 0x46, 0x02, 0x03, 0x03, 0x00, 0x3C, 0x71};
|
||||
rxservice_.add(m2, sizeof(m2));
|
||||
rxservice_.loop();
|
||||
|
||||
shell.loop_all();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
shell.printfln(F("[Test] Unknown test command"));
|
||||
}
|
||||
|
||||
|
||||
@@ -676,8 +676,6 @@ void Thermostat::show_values(uuid::console::Shell & shell) {
|
||||
shell.printfln(F(" Building: heavy"));
|
||||
}
|
||||
}
|
||||
|
||||
shell.println();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define EMSESP_APP_VERSION "2.0.0a2"
|
||||
#define EMSESP_APP_VERSION "2.0.0a3"
|
||||
|
||||
Reference in New Issue
Block a user