add MM10 valvetime

This commit is contained in:
MichaelDvP
2021-09-20 08:51:16 +02:00
parent 5686094151
commit e92a3ad025
3 changed files with 39 additions and 5 deletions

View File

@@ -78,6 +78,8 @@ Mixer::Mixer(uint8_t device_type, uint8_t device_id, uint8_t product_id, const s
register_device_value(tag, &status_, DeviceValueType::INT, nullptr, FL_(mixerStatus), DeviceValueUOM::PERCENT);
register_device_value(tag, &flowSetTemp_, DeviceValueType::UINT, nullptr, FL_(flowSetTemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_flowSetTemp));
register_device_value(tag, &pumpStatus_, DeviceValueType::BOOL, nullptr, FL_(pumpStatus), DeviceValueUOM::BOOLEAN, MAKE_CF_CB(set_pump));
register_device_value(tag, &activated_, DeviceValueType::BOOL, nullptr, FL_(activated), DeviceValueUOM::BOOLEAN, MAKE_CF_CB(set_activated));
register_device_value(tag, &setValveTime_, DeviceValueType::UINT, FL_(mul10), FL_(mixerSetTime), DeviceValueUOM::SECONDS, MAKE_CF_CB(set_setValveTime), 1, 12);
}
// HT3
@@ -231,16 +233,16 @@ void Mixer::process_HpPoolStatus(std::shared_ptr<const Telegram> telegram) {
poolShuntStatus_ = poolShunt_ == 100 ? 3 : (poolShunt_ == 0 ? 4 : poolShuntStatus__);
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
// Mixer on a MM10 - 0xAA
// e.g. Thermostat -> Mixer Module, type 0xAA, telegram: 10 21 AA 00 FF 0C 0A 11 0A 32 xx
void Mixer::process_MMConfigMessage(std::shared_ptr<const Telegram> telegram) {
// pos 0: active FF = on
// pos 1: valve runtime 0C = 120 sec in units of 10 sec
has_update(telegram->read_value(activated_, 0)); // on = 0xFF
has_update(telegram->read_value(setValveTime_, 1)); // valve runtime in 10 sec, max 120 s
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
// Mixer on a MM10 - 0xAC
// e.g. Thermostat -> Mixer Module, type 0xAC, telegram: 10 21 AC 00 1E 64 01 AB
void Mixer::process_MMSetMessage(std::shared_ptr<const Telegram> telegram) {
@@ -300,4 +302,31 @@ bool Mixer::set_pump(const char * value, const int8_t id) {
return false;
}
bool Mixer::set_activated(const char * value, const int8_t id) {
bool b;
if (!Helpers::value2bool(value, b)) {
return false;
}
if (flags() == EMSdevice::EMS_DEVICE_FLAG_MM10) {
LOG_INFO(F("Setting mixer %s"), value);
write_command(0xAA, 0, b ? 0xFF : 0, 0xAA);
return true;
}
return false;
}
bool Mixer::set_setValveTime(const char * value, const int8_t id) {
int v;
if (!Helpers::value2number(value, v)) {
return false;
}
if (flags() == EMSdevice::EMS_DEVICE_FLAG_MM10) {
v = (v + 5) / 10;
LOG_INFO(F("Setting mixer valve time to %ds"), v * 10);
write_command(0xAA, 1, v, 0xAA);
return true;
}
return false;
}
} // namespace emsesp

View File

@@ -44,6 +44,8 @@ class Mixer : public EMSdevice {
bool set_flowSetTemp(const char * value, const int8_t id);
bool set_pump(const char * value, const int8_t id);
bool set_activated(const char * value, const int8_t id);
bool set_setValveTime(const char * value, const int8_t id);
enum class Type {
NONE,
@@ -59,6 +61,8 @@ class Mixer : public EMSdevice {
uint8_t pumpStatus_;
int8_t status_;
uint8_t flowSetTemp_;
uint8_t activated_;
uint8_t setValveTime_;
int16_t poolTemp_;
int8_t poolShuntStatus__;

View File

@@ -597,6 +597,7 @@ MAKE_PSTR_LIST(flowTempHc, F("flowtemphc"), F("flow temperature in assigned hc (
MAKE_PSTR_LIST(pumpStatus, F("pumpstatus"), F("pump status in assigned hc (PC1)"))
MAKE_PSTR_LIST(mixerStatus, F("valvestatus"), F("mixing valve actuator in assigned hc (VC1)"))
MAKE_PSTR_LIST(flowTempVf, F("flowtempvf"), F("flow temperature in header (T0/Vf)"))
MAKE_PSTR_LIST(mixerSetTime, F("valvesettime"), F("time to set valve"))
MAKE_PSTR_LIST(wwPumpStatus, F("pumpstatus"), F("pump status in assigned wwc (PC1)"))
MAKE_PSTR_LIST(wwTempStatus, F("wwtempstatus"), F("temperature switch in assigned wwc (MC1)"))
MAKE_PSTR_LIST(wwTemp, F("wwtemp"), F("current temperature"))