mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 08:49:52 +03:00
merged in lobo's code
This commit is contained in:
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Buderus Logamax plus
|
- Buderus Logamax plus
|
||||||
- EMS+ support (thanks @GlennArens, @gl3nni3)
|
- EMS+ support (thanks @GlennArens, @gl3nni3)
|
||||||
- MQTT 'restart' topic to reboot ESP (thanks @balk77)
|
- MQTT 'restart' topic to reboot ESP (thanks @balk77)
|
||||||
|
- Support for multiple thermostat heating circuits like the HC1/HC2 on a RC35, also via MQTT (thanks @lobocobra)
|
||||||
|
|
||||||
## [1.6.0] 2019-03-24
|
## [1.6.0] 2019-03-24
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ DS18 ds18;
|
|||||||
// set to value >0 if the ESP is overheating or there are timing issues. Recommend a value of 1.
|
// set to value >0 if the ESP is overheating or there are timing issues. Recommend a value of 1.
|
||||||
#define EMSESP_DELAY 1 // initially set to 0 for no delay
|
#define EMSESP_DELAY 1 // initially set to 0 for no delay
|
||||||
|
|
||||||
|
#define DEFAULT_HEATINGCIRCUIT 1 // default to HC1 for thermostats that support multiple heating circuits like the RC35
|
||||||
|
|
||||||
// timers, all values are in seconds
|
// timers, all values are in seconds
|
||||||
#define DEFAULT_PUBLISHWAIT 120 // every 2 minutes publish MQTT values, including Dallas sensors
|
#define DEFAULT_PUBLISHWAIT 120 // every 2 minutes publish MQTT values, including Dallas sensors
|
||||||
Ticker publishValuesTimer;
|
Ticker publishValuesTimer;
|
||||||
@@ -72,9 +74,10 @@ typedef struct {
|
|||||||
bool led; // LED on/off
|
bool led; // LED on/off
|
||||||
bool silent_mode; // stop automatic Tx on/off
|
bool silent_mode; // stop automatic Tx on/off
|
||||||
uint16_t publish_wait; // frequency of MQTT publish in seconds
|
uint16_t publish_wait; // frequency of MQTT publish in seconds
|
||||||
uint8_t led_gpio;
|
uint8_t led_gpio; // pin for LED
|
||||||
uint8_t dallas_gpio;
|
uint8_t dallas_gpio; // pin for attaching external dallas temperature sensors
|
||||||
uint8_t dallas_parasite;
|
bool dallas_parasite; // on/off is using parasite
|
||||||
|
uint8_t heating_circuit; // number of heating circuit, 1 or 2
|
||||||
} _EMSESP_Status;
|
} _EMSESP_Status;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -97,6 +100,7 @@ command_t PROGMEM project_cmds[] = {
|
|||||||
{true, "shower_timer <on | off>", "notify via MQTT all shower durations"},
|
{true, "shower_timer <on | off>", "notify via MQTT all shower durations"},
|
||||||
{true, "shower_alert <on | off>", "send a warning of cold water after shower time is exceeded"},
|
{true, "shower_alert <on | off>", "send a warning of cold water after shower time is exceeded"},
|
||||||
{true, "publish_wait <seconds>", "set frequency for publishing to MQTT"},
|
{true, "publish_wait <seconds>", "set frequency for publishing to MQTT"},
|
||||||
|
{true, "heating_circuit <1 | 2>", "set the thermostat HC to work with if using multiple heating circuits"},
|
||||||
|
|
||||||
{false, "info", "show data captured on the EMS bus"},
|
{false, "info", "show data captured on the EMS bus"},
|
||||||
{false, "log <n | b | t | r | v>", "set logging mode to none, basic, thermostat only, raw or verbose"},
|
{false, "log <n | b | t | r | v>", "set logging mode to none, basic, thermostat only, raw or verbose"},
|
||||||
@@ -615,12 +619,20 @@ void publishValues(bool force) {
|
|||||||
doc.clear();
|
doc.clear();
|
||||||
JsonObject rootThermostat = doc.to<JsonObject>();
|
JsonObject rootThermostat = doc.to<JsonObject>();
|
||||||
|
|
||||||
|
rootThermostat[THERMOSTAT_HC] = _int_to_char(s, EMSESP_Status.heating_circuit);
|
||||||
|
|
||||||
if ((ems_getThermostatModel() == EMS_MODEL_EASY) || (ems_getThermostatModel() == EMS_MODEL_BOSCHEASY)) {
|
if ((ems_getThermostatModel() == EMS_MODEL_EASY) || (ems_getThermostatModel() == EMS_MODEL_BOSCHEASY)) {
|
||||||
rootThermostat[THERMOSTAT_SELTEMP] = _short_to_char(s, EMS_Thermostat.setpoint_roomTemp, 10);
|
rootThermostat[THERMOSTAT_SELTEMP] = _short_to_char(s, EMS_Thermostat.setpoint_roomTemp, 10);
|
||||||
rootThermostat[THERMOSTAT_CURRTEMP] = _short_to_char(s, EMS_Thermostat.curr_roomTemp, 10);
|
rootThermostat[THERMOSTAT_CURRTEMP] = _short_to_char(s, EMS_Thermostat.curr_roomTemp, 10);
|
||||||
} else {
|
} else {
|
||||||
rootThermostat[THERMOSTAT_SELTEMP] = _int_to_char(s, EMS_Thermostat.setpoint_roomTemp, 2);
|
rootThermostat[THERMOSTAT_SELTEMP] = _int_to_char(s, EMS_Thermostat.setpoint_roomTemp, 2);
|
||||||
rootThermostat[THERMOSTAT_CURRTEMP] = _int_to_char(s, EMS_Thermostat.curr_roomTemp, 10);
|
rootThermostat[THERMOSTAT_CURRTEMP] = _int_to_char(s, EMS_Thermostat.curr_roomTemp, 10);
|
||||||
|
|
||||||
|
rootThermostat[THERMOSTAT_DAYTEMP] = _int_to_char(s, EMS_Thermostat.daytemp, 2);
|
||||||
|
rootThermostat[THERMOSTAT_NIGHTTEMP] = _int_to_char(s, EMS_Thermostat.nighttemp, 2);
|
||||||
|
rootThermostat[THERMOSTAT_HOLIDAYTEMP] = _int_to_char(s, EMS_Thermostat.holidaytemp, 2);
|
||||||
|
rootThermostat[THERMOSTAT_HEATINGTYPE] = _int_to_char(s, EMS_Thermostat.heatingtype);
|
||||||
|
rootThermostat[THERMOSTAT_CIRCUITCALCTEMP] = _int_to_char(s, EMS_Thermostat.circuitcalctemp);
|
||||||
}
|
}
|
||||||
|
|
||||||
// RC20 has different mode settings
|
// RC20 has different mode settings
|
||||||
@@ -749,7 +761,7 @@ void do_publishSensorValues() {
|
|||||||
void do_publishValues() {
|
void do_publishValues() {
|
||||||
// don't publish if we're not connected to the EMS bus
|
// don't publish if we're not connected to the EMS bus
|
||||||
if ((ems_getBusConnected()) && (!myESP.getUseSerial()) && myESP.isMQTTConnected()) {
|
if ((ems_getBusConnected()) && (!myESP.getUseSerial()) && myESP.isMQTTConnected()) {
|
||||||
publishValues(false);
|
publishValues(true); // force publish
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -845,9 +857,7 @@ bool FSCallback(MYESP_FSACTION action, const JsonObject json) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// dallas_parasite
|
// dallas_parasite
|
||||||
if (!(EMSESP_Status.dallas_parasite = json["dallas_parasite"])) {
|
EMSESP_Status.dallas_parasite = json["dallas_parasite"];
|
||||||
EMSESP_Status.dallas_parasite = EMSESP_DALLAS_PARASITE; // default value
|
|
||||||
}
|
|
||||||
|
|
||||||
// thermostat_type
|
// thermostat_type
|
||||||
if (!(EMS_Thermostat.type_id = json["thermostat_type"])) {
|
if (!(EMS_Thermostat.type_id = json["thermostat_type"])) {
|
||||||
@@ -874,20 +884,28 @@ bool FSCallback(MYESP_FSACTION action, const JsonObject json) {
|
|||||||
EMSESP_Status.publish_wait = DEFAULT_PUBLISHWAIT; // default value
|
EMSESP_Status.publish_wait = DEFAULT_PUBLISHWAIT; // default value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// heating_circuit
|
||||||
|
if (!(EMSESP_Status.heating_circuit = json["heating_circuit"])) {
|
||||||
|
EMSESP_Status.heating_circuit = DEFAULT_HEATINGCIRCUIT; // default value
|
||||||
|
}
|
||||||
|
ems_setThermostatHC(EMSESP_Status.heating_circuit);
|
||||||
|
|
||||||
return recreate_config; // return false if some settings are missing and we need to rebuild the file
|
return recreate_config; // return false if some settings are missing and we need to rebuild the file
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == MYESP_FSACTION_SAVE) {
|
if (action == MYESP_FSACTION_SAVE) {
|
||||||
|
json["thermostat_type"] = EMS_Thermostat.type_id;
|
||||||
|
json["boiler_type"] = EMS_Boiler.type_id;
|
||||||
|
|
||||||
json["led"] = EMSESP_Status.led;
|
json["led"] = EMSESP_Status.led;
|
||||||
json["led_gpio"] = EMSESP_Status.led_gpio;
|
json["led_gpio"] = EMSESP_Status.led_gpio;
|
||||||
json["dallas_gpio"] = EMSESP_Status.dallas_gpio;
|
json["dallas_gpio"] = EMSESP_Status.dallas_gpio;
|
||||||
json["dallas_parasite"] = EMSESP_Status.dallas_parasite;
|
json["dallas_parasite"] = EMSESP_Status.dallas_parasite;
|
||||||
json["thermostat_type"] = EMS_Thermostat.type_id;
|
|
||||||
json["boiler_type"] = EMS_Boiler.type_id;
|
|
||||||
json["silent_mode"] = EMSESP_Status.silent_mode;
|
json["silent_mode"] = EMSESP_Status.silent_mode;
|
||||||
json["shower_timer"] = EMSESP_Status.shower_timer;
|
json["shower_timer"] = EMSESP_Status.shower_timer;
|
||||||
json["shower_alert"] = EMSESP_Status.shower_alert;
|
json["shower_alert"] = EMSESP_Status.shower_alert;
|
||||||
json["publish_wait"] = EMSESP_Status.publish_wait;
|
json["publish_wait"] = EMSESP_Status.publish_wait;
|
||||||
|
json["heating_circuit"] = EMSESP_Status.heating_circuit;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1005,6 +1023,18 @@ bool SettingsCallback(MYESP_FSACTION action, uint8_t wc, const char * setting, c
|
|||||||
EMSESP_Status.publish_wait = atoi(value);
|
EMSESP_Status.publish_wait = atoi(value);
|
||||||
ok = true;
|
ok = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// heating_circuit
|
||||||
|
if ((strcmp(setting, "heating_circuit") == 0) && (wc == 2)) {
|
||||||
|
uint8_t hc = atoi(value);
|
||||||
|
if ((hc >= 1) && (hc <= 2)) {
|
||||||
|
EMSESP_Status.heating_circuit = hc;
|
||||||
|
ems_setThermostatHC(hc);
|
||||||
|
ok = true;
|
||||||
|
} else {
|
||||||
|
myDebug("Error. Usage: set heating_circuit <1 | 2>");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (action == MYESP_FSACTION_LIST) {
|
if (action == MYESP_FSACTION_LIST) {
|
||||||
@@ -1015,14 +1045,14 @@ bool SettingsCallback(MYESP_FSACTION action, uint8_t wc, const char * setting, c
|
|||||||
|
|
||||||
if (EMS_Thermostat.type_id == EMS_ID_NONE) {
|
if (EMS_Thermostat.type_id == EMS_ID_NONE) {
|
||||||
myDebug(" thermostat_type=<not set>");
|
myDebug(" thermostat_type=<not set>");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
myDebug(" thermostat_type=%02X", EMS_Thermostat.type_id);
|
myDebug(" thermostat_type=%02X", EMS_Thermostat.type_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
myDebug(" heating_circuit=%d", EMSESP_Status.heating_circuit);
|
||||||
|
|
||||||
if (EMS_Boiler.type_id == EMS_ID_NONE) {
|
if (EMS_Boiler.type_id == EMS_ID_NONE) {
|
||||||
myDebug(" boiler_type=<not set>");
|
myDebug(" boiler_type=<not set>");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
myDebug(" boiler_type=%02X", EMS_Boiler.type_id);
|
myDebug(" boiler_type=%02X", EMS_Boiler.type_id);
|
||||||
}
|
}
|
||||||
@@ -1225,7 +1255,7 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
char s[10] = {0};
|
char s[10] = {0};
|
||||||
myDebug("MQTT topic: thermostat temperature value %s", _float_to_char(s, f));
|
myDebug("MQTT topic: thermostat temperature value %s", _float_to_char(s, f));
|
||||||
ems_setThermostatTemp(f);
|
ems_setThermostatTemp(f);
|
||||||
publishValues(true); // publish back immediately
|
publishValues(true); // publish back immediately, can't remember why I do this?!
|
||||||
}
|
}
|
||||||
|
|
||||||
// thermostat mode changes
|
// thermostat mode changes
|
||||||
@@ -1240,6 +1270,41 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// thermostat heating circuit change
|
||||||
|
if (strcmp(topic, TOPIC_THERMOSTAT_CMD_HC) == 0) {
|
||||||
|
myDebug("MQTT topic: thermostat heating circuit value %s", message);
|
||||||
|
uint8_t hc = atoi((char *)message);
|
||||||
|
if ((hc >= 1) && (hc <= 2)) {
|
||||||
|
EMSESP_Status.heating_circuit = hc;
|
||||||
|
ems_setThermostatHC(hc);
|
||||||
|
// TODO: save setting to SPIFFS??
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// set night temp value
|
||||||
|
if (strcmp(topic, TOPIC_THERMOSTAT_CMD_NIGHTTEMP) == 0) {
|
||||||
|
float f = strtof((char *)message, 0);
|
||||||
|
char s[10] = {0};
|
||||||
|
myDebug("MQTT topic: new thermostat night temperature value %s", _float_to_char(s, f));
|
||||||
|
ems_setThermostatTemp(f,1);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set daytemp value
|
||||||
|
if (strcmp(topic, TOPIC_THERMOSTAT_CMD_DAYTEMP) == 0) {
|
||||||
|
float f = strtof((char *)message, 0);
|
||||||
|
char s[10] = {0};
|
||||||
|
myDebug("MQTT topic: new thermostat day temperature value %s", _float_to_char(s, f));
|
||||||
|
ems_setThermostatTemp(f,2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// set holiday value
|
||||||
|
if (strcmp(topic, TOPIC_THERMOSTAT_CMD_HOLIDAYTEMP) == 0) {
|
||||||
|
float f = strtof((char *)message, 0);
|
||||||
|
char s[10] = {0};
|
||||||
|
myDebug("MQTT topic: new thermostat holiday temperature value %s", _float_to_char(s, f));
|
||||||
|
ems_setThermostatTemp(f,3);
|
||||||
|
}
|
||||||
|
|
||||||
// wwActivated
|
// wwActivated
|
||||||
if (strcmp(topic, TOPIC_BOILER_WWACTIVATED) == 0) {
|
if (strcmp(topic, TOPIC_BOILER_WWACTIVATED) == 0) {
|
||||||
if (message[0] == '1' || strcmp(message, "on") == 0) {
|
if (message[0] == '1' || strcmp(message, "on") == 0) {
|
||||||
@@ -1254,7 +1319,7 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
|
|||||||
uint8_t t = atoi((char *)message);
|
uint8_t t = atoi((char *)message);
|
||||||
myDebug("MQTT topic: boiler warm water temperature value %d", t);
|
myDebug("MQTT topic: boiler warm water temperature value %d", t);
|
||||||
ems_setWarmWaterTemp(t);
|
ems_setWarmWaterTemp(t);
|
||||||
publishValues(true); // publish back immediately
|
publishValues(true); // publish back immediately, can't remember why I do this?!
|
||||||
}
|
}
|
||||||
|
|
||||||
// boiler ww comfort setting
|
// boiler ww comfort setting
|
||||||
@@ -1322,12 +1387,11 @@ void initEMSESP() {
|
|||||||
EMSESP_Status.led = true; // LED is on by default
|
EMSESP_Status.led = true; // LED is on by default
|
||||||
EMSESP_Status.silent_mode = false;
|
EMSESP_Status.silent_mode = false;
|
||||||
EMSESP_Status.publish_wait = DEFAULT_PUBLISHWAIT;
|
EMSESP_Status.publish_wait = DEFAULT_PUBLISHWAIT;
|
||||||
|
|
||||||
EMSESP_Status.timestamp = millis();
|
EMSESP_Status.timestamp = millis();
|
||||||
EMSESP_Status.dallas_sensors = 0;
|
EMSESP_Status.dallas_sensors = 0;
|
||||||
|
|
||||||
EMSESP_Status.led_gpio = EMSESP_LED_GPIO;
|
EMSESP_Status.led_gpio = EMSESP_LED_GPIO;
|
||||||
EMSESP_Status.dallas_gpio = EMSESP_DALLAS_GPIO;
|
EMSESP_Status.dallas_gpio = EMSESP_DALLAS_GPIO;
|
||||||
|
EMSESP_Status.heating_circuit = 1; // default heating circuit
|
||||||
|
|
||||||
// shower settings
|
// shower settings
|
||||||
EMSESP_Shower.timerStart = 0;
|
EMSESP_Shower.timerStart = 0;
|
||||||
|
|||||||
200
src/ems.cpp
200
src/ems.cpp
@@ -27,8 +27,6 @@ CircularBuffer<_EMS_TxTelegram, EMS_TX_TELEGRAM_QUEUE_MAX> EMS_TxQueue; // FIFO
|
|||||||
#define _toLong(i) ((data[i] << 16) + (data[i + 1] << 8) + (data[i + 2]))
|
#define _toLong(i) ((data[i] << 16) + (data[i + 1] << 8) + (data[i + 2]))
|
||||||
#define _bitRead(i, bit) (((data[i]) >> (bit)) & 0x01)
|
#define _bitRead(i, bit) (((data[i]) >> (bit)) & 0x01)
|
||||||
|
|
||||||
void _printMessage(_EMS_RxTelegram * EMS_RxTelegram);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// process callbacks per type
|
// process callbacks per type
|
||||||
//
|
//
|
||||||
@@ -120,14 +118,16 @@ const _EMS_Type EMS_Types[] = {
|
|||||||
// RC35
|
// RC35
|
||||||
{EMS_MODEL_RC35, EMS_TYPE_RCOutdoorTempMessage, "RCOutdoorTempMessage", _process_RCOutdoorTempMessage, false},
|
{EMS_MODEL_RC35, EMS_TYPE_RCOutdoorTempMessage, "RCOutdoorTempMessage", _process_RCOutdoorTempMessage, false},
|
||||||
{EMS_MODEL_RC35, EMS_TYPE_RCTime, "RCTime", _process_RCTime, false},
|
{EMS_MODEL_RC35, EMS_TYPE_RCTime, "RCTime", _process_RCTime, false},
|
||||||
{EMS_MODEL_RC35, EMS_TYPE_RC35Set, "RC35Set", _process_RC35Set, false},
|
{EMS_MODEL_RC35, EMS_TYPE_RC35Set_HC1, "RC35Set_HC1", _process_RC35Set, false},
|
||||||
{EMS_MODEL_RC35, EMS_TYPE_RC35StatusMessage, "RC35StatusMessage", _process_RC35StatusMessage, false},
|
{EMS_MODEL_RC35, EMS_TYPE_RC35StatusMessage_HC1, "RC35StatusMessage_HC1", _process_RC35StatusMessage, false},
|
||||||
|
{EMS_MODEL_RC35, EMS_TYPE_RC35Set_HC2, "RC35Set_HC2", _process_RC35Set, false},
|
||||||
|
{EMS_MODEL_RC35, EMS_TYPE_RC35StatusMessage_HC2, "RC35StatusMessage_HC2", _process_RC35StatusMessage, false},
|
||||||
|
|
||||||
// ES73
|
// ES73
|
||||||
{EMS_MODEL_ES73, EMS_TYPE_RCOutdoorTempMessage, "RCOutdoorTempMessage", _process_RCOutdoorTempMessage, false},
|
{EMS_MODEL_ES73, EMS_TYPE_RCOutdoorTempMessage, "RCOutdoorTempMessage", _process_RCOutdoorTempMessage, false},
|
||||||
{EMS_MODEL_ES73, EMS_TYPE_RCTime, "RCTime", _process_RCTime, false},
|
{EMS_MODEL_ES73, EMS_TYPE_RCTime, "RCTime", _process_RCTime, false},
|
||||||
{EMS_MODEL_ES73, EMS_TYPE_RC35Set, "RC35Set", _process_RC35Set, false},
|
{EMS_MODEL_ES73, EMS_TYPE_RC35Set_HC1, "RC35Set", _process_RC35Set, false},
|
||||||
{EMS_MODEL_ES73, EMS_TYPE_RC35StatusMessage, "RC35StatusMessage", _process_RC35StatusMessage, false},
|
{EMS_MODEL_ES73, EMS_TYPE_RC35StatusMessage_HC1, "RC35StatusMessage", _process_RC35StatusMessage, false},
|
||||||
|
|
||||||
// Easy
|
// Easy
|
||||||
{EMS_MODEL_EASY, EMS_TYPE_EasyStatusMessage, "EasyStatusMessage", _process_EasyStatusMessage, false},
|
{EMS_MODEL_EASY, EMS_TYPE_EasyStatusMessage, "EasyStatusMessage", _process_EasyStatusMessage, false},
|
||||||
@@ -201,10 +201,16 @@ void ems_init() {
|
|||||||
EMS_Thermostat.year = 0;
|
EMS_Thermostat.year = 0;
|
||||||
EMS_Thermostat.mode = 255; // dummy value
|
EMS_Thermostat.mode = 255; // dummy value
|
||||||
EMS_Thermostat.day_mode = 255; // dummy value
|
EMS_Thermostat.day_mode = 255; // dummy value
|
||||||
|
|
||||||
EMS_Thermostat.type_id = EMS_ID_NONE;
|
EMS_Thermostat.type_id = EMS_ID_NONE;
|
||||||
EMS_Thermostat.read_supported = false;
|
EMS_Thermostat.read_supported = false;
|
||||||
EMS_Thermostat.write_supported = false;
|
EMS_Thermostat.write_supported = false;
|
||||||
|
EMS_Thermostat.hc = 1; // default heating circuit is 1
|
||||||
|
EMS_Thermostat.daytemp = EMS_VALUE_INT_NOTSET; // 0x47 byte
|
||||||
|
EMS_Thermostat.nighttemp = EMS_VALUE_INT_NOTSET; // 0x47 byte
|
||||||
|
EMS_Thermostat.holidaytemp = EMS_VALUE_INT_NOTSET; // 0x47 byte
|
||||||
|
EMS_Thermostat.heatingtype = EMS_VALUE_INT_NOTSET; // 0x47 byte floor heating = 3
|
||||||
|
EMS_Thermostat.circuitcalctemp = EMS_VALUE_INT_NOTSET; // 0x48 byte 14
|
||||||
|
|
||||||
|
|
||||||
// UBAParameterWW
|
// UBAParameterWW
|
||||||
EMS_Boiler.wWActivated = EMS_VALUE_INT_NOTSET; // Warm Water activated
|
EMS_Boiler.wWActivated = EMS_VALUE_INT_NOTSET; // Warm Water activated
|
||||||
@@ -297,6 +303,10 @@ void ems_setEmsRefreshed(bool b) {
|
|||||||
EMS_Sys_Status.emsRefreshed = b;
|
EMS_Sys_Status.emsRefreshed = b;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ems_setThermostatHC(uint8_t hc) {
|
||||||
|
EMS_Thermostat.hc = hc;
|
||||||
|
}
|
||||||
|
|
||||||
bool ems_getBoilerEnabled() {
|
bool ems_getBoilerEnabled() {
|
||||||
return (EMS_Boiler.type_id != EMS_ID_NONE);
|
return (EMS_Boiler.type_id != EMS_ID_NONE);
|
||||||
}
|
}
|
||||||
@@ -701,87 +711,28 @@ void _ems_readTelegram(uint8_t * telegram, uint8_t length) {
|
|||||||
_processType(&EMS_RxTelegram);
|
_processType(&EMS_RxTelegram);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* print detailed telegram
|
|
||||||
* and then call its callback if there is one defined
|
|
||||||
*/
|
|
||||||
void _ems_processTelegram(_EMS_RxTelegram * EMS_RxTelegram) {
|
|
||||||
// header
|
|
||||||
uint8_t * telegram = EMS_RxTelegram->telegram;
|
|
||||||
uint8_t length = EMS_RxTelegram->length;
|
|
||||||
uint8_t src = telegram[0] & 0x7F;
|
|
||||||
uint8_t type = telegram[2];
|
|
||||||
uint8_t offset = telegram[3];
|
|
||||||
uint8_t * data = &telegram[4]; // data block starts at position 4
|
|
||||||
|
|
||||||
// EMS Plus support
|
|
||||||
uint8_t ptype = telegram[3];
|
|
||||||
uint8_t poffset = telegram[4];
|
|
||||||
uint8_t * pdata = &telegram[5 + poffset]; // data block starts at position 5 plus the offset
|
|
||||||
|
|
||||||
_printMessage(EMS_RxTelegram);
|
|
||||||
|
|
||||||
// see if we recognize the type first by scanning our known EMS types list
|
|
||||||
// trying to match the type ID
|
|
||||||
bool commonType = false;
|
|
||||||
bool typeFound = false;
|
|
||||||
bool forUs = false;
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
while (i < _EMS_Types_max) {
|
|
||||||
if ((EMS_Types[i].type == type) || (EMS_Types[i].emsplus && type >= 240 && EMS_Types[i].type == ptype)) {
|
|
||||||
typeFound = true;
|
|
||||||
commonType = (EMS_Types[i].model_id == EMS_MODEL_ALL); // is it common type for everyone?
|
|
||||||
forUs = (src == EMS_Boiler.type_id) || (src == EMS_Thermostat.type_id); // is it for us? So the src must match
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if it's a common type (across ems devices) or something specifically for us process it.
|
|
||||||
// dest will be EMS_ID_NONE and offset 0x00 for a broadcast message
|
|
||||||
if (typeFound && (commonType || forUs)) {
|
|
||||||
if ((EMS_Types[i].processType_cb) != (void *)NULL) {
|
|
||||||
// print non-verbose message
|
|
||||||
if ((EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_BASIC) || (EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_VERBOSE)) {
|
|
||||||
if (EMS_Types[i].emsplus)
|
|
||||||
myDebug("<--- %s(0x%02X) received", EMS_Types[i].typeString, ptype);
|
|
||||||
else
|
|
||||||
myDebug("<--- %s(0x%02X) received", EMS_Types[i].typeString, type);
|
|
||||||
}
|
|
||||||
// call callback function to process it
|
|
||||||
if (EMS_Types[i].emsplus && poffset == EMS_PLUS_ID_NONE)
|
|
||||||
(void)EMS_Types[i].processType_cb(ptype, pdata, length - 6 - poffset);
|
|
||||||
// as we only handle complete telegrams (not partial) check that the offset is 0
|
|
||||||
else if (offset == EMS_ID_NONE && !EMS_Types[i].emsplus) {
|
|
||||||
(void)EMS_Types[i].processType_cb(type, data, length - 5);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* print the telegram
|
* print the telegram
|
||||||
*/
|
*/
|
||||||
void _printMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
void _printMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||||
uint8_t * telegram = EMS_RxTelegram->telegram;
|
uint8_t * telegram = EMS_RxTelegram->telegram;
|
||||||
|
|
||||||
bool emsp = false;
|
// header info
|
||||||
uint8_t src = telegram[0] & 0x7F;
|
uint8_t src = telegram[0] & 0x7F;
|
||||||
uint8_t dest = telegram[1] & 0x7F; // remove 8th bit to handle both reads and writes
|
uint8_t dest = telegram[1] & 0x7F; // remove 8th bit to handle both reads and writes
|
||||||
uint8_t type = telegram[2];
|
uint8_t type;
|
||||||
uint8_t offset = telegram[3];
|
bool emsp;
|
||||||
uint8_t * data = &telegram[4]; // data block starts at position 5
|
|
||||||
|
|
||||||
if (type >= 0xF0) {
|
// check if EMS or EMS+ by checking 3rd byte of telegram
|
||||||
|
if (telegram[2] >= 0xF0) {
|
||||||
|
// EMS+
|
||||||
type = telegram[3];
|
type = telegram[3];
|
||||||
offset = telegram[4];
|
|
||||||
data = &telegram[5 + offset];
|
|
||||||
emsp = true;
|
emsp = true;
|
||||||
|
} else {
|
||||||
|
type = telegram[2];
|
||||||
|
emsp = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// print detailed telegram data
|
|
||||||
if (EMS_Sys_Status.emsLogging >= EMS_SYS_LOGGING_THERMOSTAT) {
|
|
||||||
char output_str[200] = {0};
|
char output_str[200] = {0};
|
||||||
char buffer[16] = {0};
|
char buffer[16] = {0};
|
||||||
char color_s[20] = {0};
|
char color_s[20] = {0};
|
||||||
@@ -864,6 +815,29 @@ void _printMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* print detailed telegram
|
||||||
|
* and then call its callback if there is one defined
|
||||||
|
*/
|
||||||
|
void _ems_processTelegram(_EMS_RxTelegram * EMS_RxTelegram) {
|
||||||
|
// header
|
||||||
|
uint8_t * telegram = EMS_RxTelegram->telegram;
|
||||||
|
uint8_t length = EMS_RxTelegram->length;
|
||||||
|
uint8_t src = telegram[0] & 0x7F;
|
||||||
|
uint8_t type = telegram[2];
|
||||||
|
uint8_t offset = telegram[3];
|
||||||
|
uint8_t * data = &telegram[4]; // data block starts at position 4
|
||||||
|
|
||||||
|
// EMS Plus support
|
||||||
|
uint8_t ptype = telegram[3];
|
||||||
|
uint8_t poffset = telegram[4];
|
||||||
|
uint8_t * pdata = &telegram[5 + poffset]; // data block starts at position 5 plus the offset
|
||||||
|
|
||||||
|
// print out the telegram
|
||||||
|
if (EMS_Sys_Status.emsLogging >= EMS_SYS_LOGGING_THERMOSTAT) {
|
||||||
|
_printMessage(EMS_RxTelegram);
|
||||||
|
}
|
||||||
|
|
||||||
// see if we recognize the type first by scanning our known EMS types list
|
// see if we recognize the type first by scanning our known EMS types list
|
||||||
bool typeFound = false;
|
bool typeFound = false;
|
||||||
uint8_t i = 0;
|
uint8_t i = 0;
|
||||||
@@ -886,16 +860,22 @@ void _printMessage(_EMS_RxTelegram * EMS_RxTelegram) {
|
|||||||
if (typeFound) {
|
if (typeFound) {
|
||||||
if ((EMS_Types[i].processType_cb) != (void *)NULL) {
|
if ((EMS_Types[i].processType_cb) != (void *)NULL) {
|
||||||
// print non-verbose message
|
// print non-verbose message
|
||||||
if (EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_BASIC) {
|
if ((EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_BASIC) || (EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_VERBOSE)) {
|
||||||
|
if (EMS_Types[i].emsplus)
|
||||||
|
myDebug("<--- %s(0x%02X) received", EMS_Types[i].typeString, ptype);
|
||||||
|
else
|
||||||
myDebug("<--- %s(0x%02X) received", EMS_Types[i].typeString, type);
|
myDebug("<--- %s(0x%02X) received", EMS_Types[i].typeString, type);
|
||||||
}
|
}
|
||||||
// call callback function to process it
|
// call callback function to process it
|
||||||
|
if (EMS_Types[i].emsplus && poffset == EMS_PLUS_ID_NONE)
|
||||||
|
(void)EMS_Types[i].processType_cb(ptype, pdata, length - 6 - poffset);
|
||||||
// as we only handle complete telegrams (not partial) check that the offset is 0
|
// as we only handle complete telegrams (not partial) check that the offset is 0
|
||||||
if (offset == 0) {
|
else if (offset == EMS_ID_NONE && !EMS_Types[i].emsplus) {
|
||||||
(void)EMS_Types[i].processType_cb(src, data, EMS_RxTelegram->length - 5);
|
(void)EMS_Types[i].processType_cb(type, data, length - 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EMS_Sys_Status.emsTxStatus = EMS_TX_STATUS_IDLE;
|
EMS_Sys_Status.emsTxStatus = EMS_TX_STATUS_IDLE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1177,7 +1157,7 @@ void _process_RC30StatusMessage(uint8_t src, uint8_t * data, uint8_t length) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* type 0x3E - data from the RC35 thermostat (0x10) - 16 bytes
|
* type 0x3E and 0x48 - data from the RC35 thermostat (0x10) - 16 bytes
|
||||||
* For reading the temp values only
|
* For reading the temp values only
|
||||||
* received every 60 seconds
|
* received every 60 seconds
|
||||||
*/
|
*/
|
||||||
@@ -1185,12 +1165,15 @@ void _process_RC35StatusMessage(uint8_t src, uint8_t * data, uint8_t length) {
|
|||||||
EMS_Thermostat.setpoint_roomTemp = _toByte(EMS_OFFSET_RC35StatusMessage_setpoint); // is * 2
|
EMS_Thermostat.setpoint_roomTemp = _toByte(EMS_OFFSET_RC35StatusMessage_setpoint); // is * 2
|
||||||
|
|
||||||
// check if temp sensor is unavailable
|
// check if temp sensor is unavailable
|
||||||
if ((data[0] == 0x7D) && (data[1] = 0x00)) {
|
if (data[3] == 0x7D) {
|
||||||
EMS_Thermostat.curr_roomTemp = EMS_VALUE_SHORT_NOTSET;
|
EMS_Thermostat.curr_roomTemp = EMS_VALUE_SHORT_NOTSET;
|
||||||
} else {
|
} else {
|
||||||
EMS_Thermostat.curr_roomTemp = _toShort(EMS_OFFSET_RC35StatusMessage_curr);
|
EMS_Thermostat.curr_roomTemp = _toShort(EMS_OFFSET_RC35StatusMessage_curr);
|
||||||
}
|
}
|
||||||
EMS_Thermostat.day_mode = bitRead(data[EMS_OFFSET_RC35Get_mode_day], 1); // get day mode flag
|
EMS_Thermostat.day_mode = bitRead(data[EMS_OFFSET_RC35Get_mode_day], 1); // get day mode flag
|
||||||
|
|
||||||
|
EMS_Thermostat.circuitcalctemp = data[EMS_OFFSET_RC35Set_circuitcalctemp]; // 0x48 calculated temperature Vorlauf bit 14
|
||||||
|
|
||||||
EMS_Sys_Status.emsRefreshed = true; // triggers a send the values back via MQTT
|
EMS_Sys_Status.emsRefreshed = true; // triggers a send the values back via MQTT
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1244,12 +1227,19 @@ void _process_RC30Set(uint8_t src, uint8_t * data, uint8_t length) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* type 0x3D - for reading the mode from the RC35 thermostat (0x10)
|
* type 0x3D and 0x47 - for reading the mode from the RC35 thermostat (0x10)
|
||||||
* Working Mode Heating Circuit 1 (HC1)
|
* Working Mode Heating Circuit 1 & 2 (HC1, HC2)
|
||||||
* received only after requested
|
* received only after requested
|
||||||
*/
|
*/
|
||||||
void _process_RC35Set(uint8_t src, uint8_t * data, uint8_t length) {
|
void _process_RC35Set(uint8_t src, uint8_t * data, uint8_t length) {
|
||||||
EMS_Thermostat.mode = _toByte(EMS_OFFSET_RC35Set_mode);
|
EMS_Thermostat.mode = _toByte(EMS_OFFSET_RC35Set_mode);
|
||||||
|
|
||||||
|
EMS_Thermostat.daytemp = _toByte(EMS_OFFSET_RC35Set_temp_day); // is * 2
|
||||||
|
EMS_Thermostat.nighttemp = _toByte(EMS_OFFSET_RC35Set_temp_night); // is * 2
|
||||||
|
EMS_Thermostat.holidaytemp = _toByte(EMS_OFFSET_RC35Set_temp_holiday); // is * 2
|
||||||
|
EMS_Thermostat.heatingtype = _toByte(EMS_OFFSET_RC35Set_heatingtype); // byte 0 bit floor heating = 3 0x47
|
||||||
|
|
||||||
|
EMS_Sys_Status.emsRefreshed = true; // triggers a send the values back via MQTT
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1524,6 +1514,7 @@ void ems_getThermostatValues() {
|
|||||||
|
|
||||||
uint8_t model_id = EMS_Thermostat.model_id;
|
uint8_t model_id = EMS_Thermostat.model_id;
|
||||||
uint8_t type = EMS_Thermostat.type_id;
|
uint8_t type = EMS_Thermostat.type_id;
|
||||||
|
uint8_t hc = EMS_Thermostat.hc;
|
||||||
|
|
||||||
if (model_id == EMS_MODEL_RC20) {
|
if (model_id == EMS_MODEL_RC20) {
|
||||||
ems_doReadCommand(EMS_TYPE_RC20StatusMessage, type); // to get the setpoint temp
|
ems_doReadCommand(EMS_TYPE_RC20StatusMessage, type); // to get the setpoint temp
|
||||||
@@ -1532,8 +1523,13 @@ void ems_getThermostatValues() {
|
|||||||
ems_doReadCommand(EMS_TYPE_RC30StatusMessage, type); // to get the setpoint temp
|
ems_doReadCommand(EMS_TYPE_RC30StatusMessage, type); // to get the setpoint temp
|
||||||
ems_doReadCommand(EMS_TYPE_RC30Set, type); // to get the mode
|
ems_doReadCommand(EMS_TYPE_RC30Set, type); // to get the mode
|
||||||
} else if ((model_id == EMS_MODEL_RC35) || (model_id == EMS_MODEL_ES73)) {
|
} else if ((model_id == EMS_MODEL_RC35) || (model_id == EMS_MODEL_ES73)) {
|
||||||
ems_doReadCommand(EMS_TYPE_RC35StatusMessage, type); // to get the setpoint temp
|
if (hc == 1) {
|
||||||
ems_doReadCommand(EMS_TYPE_RC35Set, type); // to get the mode
|
ems_doReadCommand(EMS_TYPE_RC35StatusMessage_HC1, type); // to get the setpoint temp
|
||||||
|
ems_doReadCommand(EMS_TYPE_RC35Set_HC1, type); // to get the mode
|
||||||
|
} else if (hc == 2) {
|
||||||
|
ems_doReadCommand(EMS_TYPE_RC35StatusMessage_HC2, type); // to get the setpoint temp
|
||||||
|
ems_doReadCommand(EMS_TYPE_RC35Set_HC2, type); // to get the mode
|
||||||
|
}
|
||||||
} else if ((model_id == EMS_MODEL_EASY) || (model_id == EMS_MODEL_BOSCHEASY)) {
|
} else if ((model_id == EMS_MODEL_EASY) || (model_id == EMS_MODEL_BOSCHEASY)) {
|
||||||
ems_doReadCommand(EMS_TYPE_EasyStatusMessage, type);
|
ems_doReadCommand(EMS_TYPE_EasyStatusMessage, type);
|
||||||
}
|
}
|
||||||
@@ -1640,7 +1636,7 @@ char * ems_getBoilerDescription(char * buffer) {
|
|||||||
* Find the versions of our connected devices
|
* Find the versions of our connected devices
|
||||||
*/
|
*/
|
||||||
void ems_scanDevices() {
|
void ems_scanDevices() {
|
||||||
myDebug("Started scan of EMS bus for known devices");
|
myDebug("Started scan on EMS bus for known devices");
|
||||||
|
|
||||||
std::list<uint8_t> Device_Ids; // create a new list
|
std::list<uint8_t> Device_Ids; // create a new list
|
||||||
|
|
||||||
@@ -1814,8 +1810,9 @@ void ems_sendRawTelegram(char * telegram) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the temperature of the thermostat
|
* Set the temperature of the thermostat
|
||||||
|
* temptype 0 = normal, 1=night temp, 2=day temp, 3=holiday temp
|
||||||
*/
|
*/
|
||||||
void ems_setThermostatTemp(float temperature) {
|
void ems_setThermostatTemp(float temperature, uint8_t temptype) {
|
||||||
if (!ems_getThermostatEnabled()) {
|
if (!ems_getThermostatEnabled()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1831,6 +1828,7 @@ void ems_setThermostatTemp(float temperature) {
|
|||||||
|
|
||||||
uint8_t model_id = EMS_Thermostat.model_id;
|
uint8_t model_id = EMS_Thermostat.model_id;
|
||||||
uint8_t type = EMS_Thermostat.type_id;
|
uint8_t type = EMS_Thermostat.type_id;
|
||||||
|
uint8_t hc = EMS_Thermostat.hc; // heating circuit
|
||||||
|
|
||||||
EMS_TxTelegram.action = EMS_TX_TELEGRAM_WRITE;
|
EMS_TxTelegram.action = EMS_TX_TELEGRAM_WRITE;
|
||||||
EMS_TxTelegram.dest = type;
|
EMS_TxTelegram.dest = type;
|
||||||
@@ -1852,14 +1850,35 @@ void ems_setThermostatTemp(float temperature) {
|
|||||||
EMS_TxTelegram.offset = EMS_OFFSET_RC30Set_temp;
|
EMS_TxTelegram.offset = EMS_OFFSET_RC30Set_temp;
|
||||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC30StatusMessage;
|
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC30StatusMessage;
|
||||||
} else if ((model_id == EMS_MODEL_RC35) || (model_id == EMS_MODEL_ES73)) {
|
} else if ((model_id == EMS_MODEL_RC35) || (model_id == EMS_MODEL_ES73)) {
|
||||||
EMS_TxTelegram.type = EMS_TYPE_RC35Set;
|
switch (temptype) {
|
||||||
|
case 1: // change the night temp
|
||||||
|
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night;
|
||||||
|
break;
|
||||||
|
case 2: // change the day temp
|
||||||
|
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
|
||||||
|
break;
|
||||||
|
case 3: // change the holiday temp
|
||||||
|
EMS_TxTelegram.offset = 3; //holiday on RC35
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
case 0: // automatic selection, if no type is defined, we use the standard code
|
||||||
if (EMS_Thermostat.day_mode == 0) {
|
if (EMS_Thermostat.day_mode == 0) {
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night;
|
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_night;
|
||||||
} else if (EMS_Thermostat.day_mode == 1) {
|
} else if (EMS_Thermostat.day_mode == 1) {
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
|
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_temp_day;
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC35StatusMessage;
|
if (hc == 1) {
|
||||||
|
// heating circuit 1
|
||||||
|
EMS_TxTelegram.type = EMS_TYPE_RC35Set_HC1;
|
||||||
|
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC35StatusMessage_HC1;
|
||||||
|
} else {
|
||||||
|
// heating circuit 2
|
||||||
|
EMS_TxTelegram.type = EMS_TYPE_RC35Set_HC2;
|
||||||
|
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_RC35StatusMessage_HC2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
EMS_TxTelegram.length = EMS_MIN_TELEGRAM_LENGTH;
|
EMS_TxTelegram.length = EMS_MIN_TELEGRAM_LENGTH;
|
||||||
@@ -1868,7 +1887,7 @@ void ems_setThermostatTemp(float temperature) {
|
|||||||
EMS_TxTelegram.comparisonOffset = EMS_TxTelegram.offset;
|
EMS_TxTelegram.comparisonOffset = EMS_TxTelegram.offset;
|
||||||
EMS_TxTelegram.comparisonValue = EMS_TxTelegram.dataValue;
|
EMS_TxTelegram.comparisonValue = EMS_TxTelegram.dataValue;
|
||||||
|
|
||||||
EMS_TxTelegram.forceRefresh = false; // send to MQTT is done automatically in EMS_TYPE_RC30StatusMessage
|
EMS_TxTelegram.forceRefresh = false; // send to MQTT is done automatically in EMS_TYPE_RC*StatusMessage
|
||||||
EMS_TxQueue.push(EMS_TxTelegram);
|
EMS_TxQueue.push(EMS_TxTelegram);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1888,6 +1907,7 @@ void ems_setThermostatMode(uint8_t mode) {
|
|||||||
|
|
||||||
uint8_t model_id = EMS_Thermostat.model_id;
|
uint8_t model_id = EMS_Thermostat.model_id;
|
||||||
uint8_t type = EMS_Thermostat.type_id;
|
uint8_t type = EMS_Thermostat.type_id;
|
||||||
|
uint8_t hc = EMS_Thermostat.hc;
|
||||||
|
|
||||||
myDebug("Setting thermostat mode to %d", mode);
|
myDebug("Setting thermostat mode to %d", mode);
|
||||||
|
|
||||||
@@ -1908,7 +1928,7 @@ void ems_setThermostatMode(uint8_t mode) {
|
|||||||
EMS_TxTelegram.type = EMS_TYPE_RC30Set;
|
EMS_TxTelegram.type = EMS_TYPE_RC30Set;
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_RC30Set_mode;
|
EMS_TxTelegram.offset = EMS_OFFSET_RC30Set_mode;
|
||||||
} else if ((model_id == EMS_MODEL_RC35) || (model_id == EMS_MODEL_ES73)) {
|
} else if ((model_id == EMS_MODEL_RC35) || (model_id == EMS_MODEL_ES73)) {
|
||||||
EMS_TxTelegram.type = EMS_TYPE_RC35Set;
|
EMS_TxTelegram.type = (hc == 2) ? EMS_TYPE_RC35Set_HC2 : EMS_TYPE_RC35Set_HC1;
|
||||||
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_mode;
|
EMS_TxTelegram.offset = EMS_OFFSET_RC35Set_mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -241,6 +241,7 @@ typedef struct {
|
|||||||
uint8_t product_id;
|
uint8_t product_id;
|
||||||
bool read_supported;
|
bool read_supported;
|
||||||
bool write_supported;
|
bool write_supported;
|
||||||
|
uint8_t hc; // heating circuit 1 or 2
|
||||||
char version[10];
|
char version[10];
|
||||||
int16_t setpoint_roomTemp; // current set temp
|
int16_t setpoint_roomTemp; // current set temp
|
||||||
int16_t curr_roomTemp; // current room temp
|
int16_t curr_roomTemp; // current room temp
|
||||||
@@ -252,6 +253,11 @@ typedef struct {
|
|||||||
uint8_t day;
|
uint8_t day;
|
||||||
uint8_t month;
|
uint8_t month;
|
||||||
uint8_t year;
|
uint8_t year;
|
||||||
|
uint8_t daytemp;
|
||||||
|
uint8_t nighttemp;
|
||||||
|
uint8_t holidaytemp;
|
||||||
|
uint8_t heatingtype;
|
||||||
|
uint8_t circuitcalctemp;
|
||||||
} _EMS_Thermostat;
|
} _EMS_Thermostat;
|
||||||
|
|
||||||
// call back function signature for processing telegram types
|
// call back function signature for processing telegram types
|
||||||
@@ -272,8 +278,9 @@ void ems_init();
|
|||||||
void ems_doReadCommand(uint8_t type, uint8_t dest, bool forceRefresh = false);
|
void ems_doReadCommand(uint8_t type, uint8_t dest, bool forceRefresh = false);
|
||||||
void ems_sendRawTelegram(char * telegram);
|
void ems_sendRawTelegram(char * telegram);
|
||||||
|
|
||||||
void ems_setThermostatTemp(float temp);
|
void ems_setThermostatTemp(float temperature, uint8_t temptype = 0);
|
||||||
void ems_setThermostatMode(uint8_t mode);
|
void ems_setThermostatMode(uint8_t mode);
|
||||||
|
void ems_setThermostatHC(uint8_t hc);
|
||||||
void ems_setWarmWaterTemp(uint8_t temperature);
|
void ems_setWarmWaterTemp(uint8_t temperature);
|
||||||
void ems_setWarmWaterActivated(bool activated);
|
void ems_setWarmWaterActivated(bool activated);
|
||||||
void ems_setWarmTapWaterActivated(bool activated);
|
void ems_setWarmTapWaterActivated(bool activated);
|
||||||
|
|||||||
@@ -74,14 +74,19 @@
|
|||||||
#define EMS_OFFSET_RC30StatusMessage_curr 2 // current temp
|
#define EMS_OFFSET_RC30StatusMessage_curr 2 // current temp
|
||||||
|
|
||||||
// RC35 specific
|
// RC35 specific
|
||||||
#define EMS_TYPE_RC35StatusMessage 0x3E // is an automatic thermostat broadcast giving us temps
|
#define EMS_TYPE_RC35StatusMessage_HC1 0x3E // is an automatic thermostat broadcast giving us temps on HC1
|
||||||
#define EMS_TYPE_RC35Set 0x3D // for setting values like temp and mode (Working mode HC1)
|
#define EMS_TYPE_RC35StatusMessage_HC2 0x48 // is an automatic thermostat broadcast giving us temps on HC2
|
||||||
|
#define EMS_TYPE_RC35Set_HC1 0x3D // for setting values like temp and mode (Working mode HC1)
|
||||||
|
#define EMS_TYPE_RC35Set_HC2 0x47 // for setting values like temp and mode (Working mode HC2)
|
||||||
#define EMS_OFFSET_RC35StatusMessage_setpoint 2 // desired temp
|
#define EMS_OFFSET_RC35StatusMessage_setpoint 2 // desired temp
|
||||||
#define EMS_OFFSET_RC35StatusMessage_curr 3 // current temp
|
#define EMS_OFFSET_RC35StatusMessage_curr 3 // current temp
|
||||||
#define EMS_OFFSET_RC35Set_mode 7 // position of thermostat mode
|
#define EMS_OFFSET_RC35Set_mode 7 // position of thermostat mode
|
||||||
#define EMS_OFFSET_RC35Set_temp_day 2 // position of thermostat setpoint temperature for day time
|
#define EMS_OFFSET_RC35Set_temp_day 2 // position of thermostat setpoint temperature for day time
|
||||||
#define EMS_OFFSET_RC35Set_temp_night 1 // position of thermostat setpoint temperature for night time
|
#define EMS_OFFSET_RC35Set_temp_night 1 // position of thermostat setpoint temperature for night time
|
||||||
#define EMS_OFFSET_RC35Get_mode_day 1 // position of thermostat day mode
|
#define EMS_OFFSET_RC35Get_mode_day 1 // position of thermostat day mode
|
||||||
|
#define EMS_OFFSET_RC35Set_temp_holiday 3 // temp during holiday 0x47
|
||||||
|
#define EMS_OFFSET_RC35Set_heatingtype 0 // floor heating = 3 0x47
|
||||||
|
#define EMS_OFFSET_RC35Set_circuitcalctemp 14 // calculated circuit temperature 0x48
|
||||||
|
|
||||||
// Easy specific
|
// Easy specific
|
||||||
#define EMS_TYPE_EasyStatusMessage 0x0A // reading values on an Easy Thermostat
|
#define EMS_TYPE_EasyStatusMessage 0x0A // reading values on an Easy Thermostat
|
||||||
|
|||||||
@@ -26,9 +26,19 @@
|
|||||||
#define TOPIC_THERMOSTAT_DATA "thermostat_data" // for sending thermostat values to MQTT
|
#define TOPIC_THERMOSTAT_DATA "thermostat_data" // for sending thermostat values to MQTT
|
||||||
#define TOPIC_THERMOSTAT_CMD_TEMP "thermostat_cmd_temp" // for received thermostat temp changes via MQTT
|
#define TOPIC_THERMOSTAT_CMD_TEMP "thermostat_cmd_temp" // for received thermostat temp changes via MQTT
|
||||||
#define TOPIC_THERMOSTAT_CMD_MODE "thermostat_cmd_mode" // for received thermostat mode changes via MQTT
|
#define TOPIC_THERMOSTAT_CMD_MODE "thermostat_cmd_mode" // for received thermostat mode changes via MQTT
|
||||||
|
#define TOPIC_THERMOSTAT_CMD_HC "thermostat_cmd_hc" // for received thermostat hc number changes via MQTT
|
||||||
|
#define TOPIC_THERMOSTAT_CMD_DAYTEMP "thermostat_daytemp" // RC35 specific
|
||||||
|
#define TOPIC_THERMOSTAT_CMD_NIGHTTEMP "thermostat_nighttemp" // RC35 specific
|
||||||
|
#define TOPIC_THERMOSTAT_CMD_HOLIDAYTEMP "thermostat_holidayttemp" // RC35 specific
|
||||||
#define THERMOSTAT_CURRTEMP "thermostat_currtemp" // current temperature
|
#define THERMOSTAT_CURRTEMP "thermostat_currtemp" // current temperature
|
||||||
#define THERMOSTAT_SELTEMP "thermostat_seltemp" // selected temperature
|
#define THERMOSTAT_SELTEMP "thermostat_seltemp" // selected temperature
|
||||||
|
#define THERMOSTAT_HC "thermostat_hc" // which heating circuit number
|
||||||
#define THERMOSTAT_MODE "thermostat_mode" // mode
|
#define THERMOSTAT_MODE "thermostat_mode" // mode
|
||||||
|
#define THERMOSTAT_DAYTEMP "thermostat_daytemp" // RC35 specific
|
||||||
|
#define THERMOSTAT_NIGHTTEMP "thermostat_nighttemp" // RC35 specific
|
||||||
|
#define THERMOSTAT_HOLIDAYTEMP "thermostat_holidayttemp" // RC35 specific
|
||||||
|
#define THERMOSTAT_HEATINGTYPE "themrostat_heatingtype" // RC35 specific (3=floorheating)
|
||||||
|
#define THERMOSTAT_CIRCUITCALCTEMP "thermostat_circuitcalctemp" // RC35 specific
|
||||||
|
|
||||||
// MQTT for boiler
|
// MQTT for boiler
|
||||||
#define TOPIC_BOILER_DATA "boiler_data" // for sending boiler values to MQTT
|
#define TOPIC_BOILER_DATA "boiler_data" // for sending boiler values to MQTT
|
||||||
|
|||||||
@@ -6,5 +6,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#define APP_NAME "EMS-ESP"
|
#define APP_NAME "EMS-ESP"
|
||||||
#define APP_VERSION "1.7.0b2"
|
#define APP_VERSION "1.7.0b3"
|
||||||
#define APP_HOSTNAME "ems-esp"
|
#define APP_HOSTNAME "ems-esp"
|
||||||
|
|||||||
Reference in New Issue
Block a user