This commit is contained in:
proddy
2019-01-03 19:42:58 +01:00
parent ec3d10cb3d
commit b999dd3395
7 changed files with 20 additions and 15 deletions

View File

@@ -100,7 +100,7 @@ command_t PROGMEM project_cmds[] = {
{"h", "list supported EMS telegram type IDs"},
{"M", "publish to MQTT"},
{"Q", "print Tx Queue"},
{"U [n]", "do a deep scan of all thermostat messages types, start at n"},
{"U [n]", "do a deep scan of all thermostat message types, starting at n"},
{"P", "toggle EMS Poll response on/off"},
{"X", "toggle EMS Tx transmission on/off"},
{"S", "toggle Shower timer on/off"},
@@ -410,12 +410,10 @@ void showInfo() {
// a json object is created for the boiler and one for the thermostat
// CRC check is done to see if there are changes in the values since the last send to avoid too much wifi traffic
void publishValues(bool force) {
char s[20] = {0}; // for formatting strings
// Boiler values as one JSON object
char s[20] = {0}; // for formatting strings
StaticJsonBuffer<512> jsonBuffer;
char data[512];
JsonObject & rootBoiler = jsonBuffer.createObject();
char data[MQTT_MAX_SIZE] = {0};
JsonObject & rootBoiler = jsonBuffer.createObject();
size_t rlen;
CRC32 crc;
uint32_t fchecksum;
@@ -481,6 +479,7 @@ void publishValues(bool force) {
rootThermostat[THERMOSTAT_CURRTEMP] = _float_to_char(s, EMS_Thermostat.curr_roomTemp);
rootThermostat[THERMOSTAT_SELTEMP] = _float_to_char(s, EMS_Thermostat.setpoint_roomTemp);
// RC20 has different mode settings
if (ems_getThermostatModel() == EMS_MODEL_RC20) {
if (EMS_Thermostat.mode == 0) {
rootThermostat[THERMOSTAT_MODE] = "low";
@@ -499,7 +498,8 @@ void publishValues(bool force) {
}
}
rlen = rootThermostat.measureLength();
data[0] = '\0'; // reset data for next package
rlen = rootThermostat.measureLength();
rootThermostat.printTo(data, rlen + 1); // form the json string
// calculate new CRC
@@ -619,7 +619,7 @@ void myDebugCallback() {
systemCheckTimer.detach();
regularUpdatesTimer.detach();
scanThermostat_count = (uint8_t)strtol(&cmd[2], 0, 16);
myDebug("Doing a deep scan on all message types to the thermometer start at 0x%02. Reboot ESP when finished.", scanThermostat_count);
myDebug("Starting a deep message scan on thermometer");
scanThermostat.attach(SCANTHERMOSTAT_TIME, do_scanThermostat);
break;
default:

View File

@@ -993,9 +993,7 @@ void _process_RC30StatusMessage(uint8_t * data, uint8_t length) {
*/
void _process_RC35StatusMessage(uint8_t * data, uint8_t length) {
EMS_Thermostat.setpoint_roomTemp = ((float)data[EMS_TYPE_RC35StatusMessage_setpoint]) / (float)2;
// There is no current room temperature sensor in this telegram
EMS_Thermostat.curr_roomTemp = EMS_VALUE_FLOAT_NOTSET;
EMS_Thermostat.curr_roomTemp = _toFloat(EMS_TYPE_RC35StatusMessage_curr, data);
EMS_Sys_Status.emsRefreshed = true; // triggers a send the values back to Home Assistant via MQTT
}
@@ -1097,7 +1095,6 @@ void _process_Version(uint8_t * data, uint8_t length) {
// if we don't have a thermostat set, use this one
if (!ems_getThermostatEnabled()) {
myDebug("Setting the Thermostat to this one.");
// set its capabilities
EMS_Thermostat.model_id = Model_Types[i].model_id;
EMS_Thermostat.type_id = Model_Types[i].type_id;
@@ -1118,7 +1115,6 @@ void _process_Version(uint8_t * data, uint8_t length) {
}
if (!ems_getBoilerEnabled()) {
myDebug("Setting the Boiler to this one.");
EMS_Boiler.type_id = Model_Types[i].type_id;
EMS_Boiler.model_id = Model_Types[i].model_id;
strlcpy(EMS_Boiler.version, version, sizeof(EMS_Boiler.version));

View File

@@ -76,6 +76,7 @@
// RC35 specific
#define EMS_TYPE_RC35StatusMessage 0x3E // is an automatic thermostat broadcast giving us temps
#define EMS_TYPE_RC35StatusMessage_setpoint 2 // desired temp
#define EMS_TYPE_RC35StatusMessage_curr 3 // current temp
#define EMS_TYPE_RC35Set 0x3D // for setting values like temp and mode (Working mode HC1)
#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

View File

@@ -1,5 +1,5 @@
#pragma once
#define APP_NAME "EMS-ESP-Boiler"
#define APP_VERSION "1.2.3"
#define APP_VERSION "1.2.4"
#define APP_HOSTNAME "boiler"