Skip to content

Commit 1dc0088

Browse files
committedJan 28, 2023
Moduline 400 manual temp, emsesp#932
1 parent bbf4431 commit 1dc0088

File tree

2 files changed

+30
-4
lines changed

2 files changed

+30
-4
lines changed
 

‎src/devices/thermostat.cpp

+29-4
Original file line numberDiff line numberDiff line change
@@ -1131,6 +1131,7 @@ void Thermostat::process_RC300Floordry(std::shared_ptr<const Telegram> telegram)
11311131
}
11321132

11331133
// type 0x41 - data from the RC30 thermostat(0x10) - 14 bytes long
1134+
// RC30Monitor(0x41), data: 80 20 00 AC 00 00 00 02 00 05 09 00 AC 00
11341135
void Thermostat::process_RC30Monitor(std::shared_ptr<const Telegram> telegram) {
11351136
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
11361137
if (hc == nullptr) {
@@ -1144,6 +1145,8 @@ void Thermostat::process_RC30Monitor(std::shared_ptr<const Telegram> telegram) {
11441145
}
11451146

11461147
// type 0xA7 - for reading the mode from the RC30 thermostat (0x10) and all the installation settings
1148+
// RC30Set(0xA7), data: 01 00 FF F6 01 06 00 01 0D 00 00 FF FF 01 02 02 02 00 00 05 1F 05 1F 01 0E 00 FF
1149+
// RC30Set(0xA7), data: 00 00 20 02 (offset 27)
11471150
void Thermostat::process_RC30Set(std::shared_ptr<const Telegram> telegram) {
11481151
std::shared_ptr<Thermostat::HeatingCircuit> hc = heating_circuit(telegram);
11491152
if (hc == nullptr) {
@@ -1158,12 +1161,15 @@ void Thermostat::process_RC30Set(std::shared_ptr<const Telegram> telegram) {
11581161
has_update(telegram, mixingvalves_, 17); // Number of Mixing Valves: (0x00=0, 0x01=1, 0x02=2)
11591162
has_update(telegram, brightness_, 18); // Screen brightness 0F=dark F1=light
11601163
has_update(telegram, hc->mode, 23);
1161-
has_update(telegram, offtemp_, 24); // Set Temperature when mode is Off / 10 (e.g.: 0x0F = 7.5 degrees Celsius)
1162-
has_update(telegram, heatingpid_, 25); // PID setting 00=1 01=2 02=3
1163-
has_update(telegram, preheating_, 26); // Preheating in the clock program: (0x00 = off, 0xFF = on)
1164+
has_update(telegram, offtemp_, 24); // Set Temperature when mode is Off / 10 (e.g.: 0x0F = 7.5 degrees Celsius)
1165+
has_update(telegram, heatingpid_, 25); // PID setting 00=1 01=2 02=3
1166+
has_update(telegram, preheating_, 26); // Preheating in the clock program: (0x00 = off, 0xFF = on)
1167+
has_update(telegram, hc->tempautotemp, 28); // is * 2
1168+
has_update(telegram, hc->manualtemp, 29); // manualtemp is * 2
11641169
}
11651170

11661171
// type 0x40 (HC1) - for reading the operating mode from the RC30 thermostat (0x10)
1172+
// RC30Temp(0x40), data: 01 01 02 20 24 28 2A 1E 0E 00 01 5A 32 05 4B 2D 00 28 00 3C FF 11 00 05 00
11671173
void Thermostat::process_RC30Temp(std::shared_ptr<const Telegram> telegram) {
11681174
// check to see we have a valid type. heating: 1 radiator, 2 convectors, 3 floors
11691175
if (telegram->offset == 0 && telegram->message_data[0] == 0x00) {
@@ -2949,6 +2955,12 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
29492955

29502956
} else if (model == EMS_DEVICE_FLAG_RC30) {
29512957
switch (mode) {
2958+
case HeatingCircuit::Mode::MANUAL: // change the manual temp
2959+
offset = EMS_OFFSET_RC30Set_temp_manual;
2960+
break;
2961+
case HeatingCircuit::Mode::TEMPAUTO: // change the tempautotemp
2962+
offset = EMS_OFFSET_RC30Set_temp;
2963+
break;
29522964
case HeatingCircuit::Mode::NIGHT: // change the night temp
29532965
set_typeid = curve_typeids[hc->hc()];
29542966
offset = EMS_OFFSET_RC30Temp_temp_night;
@@ -2970,7 +2982,11 @@ bool Thermostat::set_temperature(const float temperature, const uint8_t mode, co
29702982
offset = EMS_OFFSET_RC30Temp_temp_holiday;
29712983
break;
29722984
default:
2973-
offset = EMS_OFFSET_RC30Set_temp;
2985+
if (hc->manualtemp == 0) {
2986+
offset = EMS_OFFSET_RC30Set_temp;
2987+
} else {
2988+
offset = EMS_OFFSET_RC30Set_temp_manual;
2989+
}
29742990
break;
29752991
}
29762992

@@ -4264,6 +4280,15 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
42644280
tag, &hc->daymidtemp, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(daymidtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_daymidtemp));
42654281
register_device_value(
42664282
tag, &hc->daytemp, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(dayhightemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_daytemp));
4283+
register_device_value(
4284+
tag, &hc->manualtemp, DeviceValueType::UINT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(manualtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_manualtemp));
4285+
register_device_value(tag,
4286+
&hc->tempautotemp,
4287+
DeviceValueType::UINT,
4288+
DeviceValueNumOp::DV_NUMOP_DIV2,
4289+
FL_(tempautotemp),
4290+
DeviceValueUOM::DEGREES,
4291+
MAKE_CF_CB(set_tempautotemp));
42674292
break;
42684293
case EMS_DEVICE_FLAG_RC30_N:
42694294
case EMS_DEVICE_FLAG_RC35:

‎src/devices/thermostat.h

+1
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ class Thermostat : public EMSdevice {
266266
static constexpr uint8_t EMS_OFFSET_RC30StatusMessage_curr = 2; // current temp
267267
static constexpr uint8_t EMS_OFFSET_RC30Set_mode = 23; // position of thermostat mode
268268
static constexpr uint8_t EMS_OFFSET_RC30Set_temp = 28; // position of thermostat setpoint temperature
269+
static constexpr uint8_t EMS_OFFSET_RC30Set_temp_manual = 29; // position of thermostat setpoint temperature for manual mode
269270
static constexpr uint8_t EMS_OFFSET_RC30Temp_temp_night = 3; // position of thermostat setpoint temperature for night time (T1)
270271
static constexpr uint8_t EMS_OFFSET_RC30Temp_temp_daylow = 4; // position of thermostat setpoint temperature for daylow time (T2)
271272
static constexpr uint8_t EMS_OFFSET_RC30Temp_temp_daymid = 5; // position of thermostat setpoint temperature for daymid time (T3)

0 commit comments

Comments
 (0)