Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
flowtemp
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Apr 7, 2019
1 parent 72b82a2 commit 5cf6d25
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 13 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.7.0 dev] 2019-03-
## [1.7.0 dev] 2019-04-07

### Added

- Buderus Logamax plus
- EMS+ support (thanks @GlennArens, @gl3nni3)
- 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)
- `boiler flowtemp` command to set the flow temperature [(issue 59)](https://github.com/proddy/EMS-ESP/issues/59)

## [1.6.0] 2019-03-24

Expand Down
1 change: 0 additions & 1 deletion lib/MyESP/MyESP.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ void custom_crash_callback(struct rst_info *, uint32_t, uint32_t);
#define ets_vsnprintf vsnprintf // added for ESP32
#define OTA_PORT 8266
#else
//#include <ESP8266mDNS.h>
#include <ESPAsyncTCP.h>
#define OTA_PORT 3232
#endif
Expand Down
12 changes: 8 additions & 4 deletions src/ems-esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ command_t PROGMEM project_cmds[] = {
{false, "boiler read <type ID>", "send read request to boiler"},
{false, "boiler wwtemp <degrees>", "set boiler warm water temperature"},
{false, "boiler tapwater <on | off>", "set boiler warm tap water on/off"},
{false, "boiler flowtemp <degrees>", "set boiler flow temperature"},
{false, "boiler comfort <hot | eco | intelligent>", "set boiler warm water comfort setting"}

};
Expand Down Expand Up @@ -1202,6 +1203,9 @@ void TelnetCommandCallback(uint8_t wc, const char * commandLine) {
ems_setWarmTapWaterActivated(false);
ok = true;
}
} else if (strcmp(second_cmd, "flowtemp") == 0) {
ems_setFlowTemp(_readIntNumber());
ok = true;
}
}

Expand Down Expand Up @@ -1286,24 +1290,24 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
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);
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);
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);
}
ems_setThermostatTemp(f, 3);
}

// wwActivated
if (strcmp(topic, TOPIC_BOILER_WWACTIVATED) == 0) {
Expand Down
47 changes: 41 additions & 6 deletions src/ems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1265,16 +1265,23 @@ void _process_SM10Monitor(uint8_t src, uint8_t * data, uint8_t length) {
* UBASetPoint 0x1A
*/
void _process_SetPoints(uint8_t src, uint8_t * data, uint8_t length) {
/*

if (EMS_Sys_Status.emsLogging == EMS_SYS_LOGGING_VERBOSE) {
if (length != 0) {
uint8_t setpoint = data[0];
uint8_t hk_power = data[1];
uint8_t ww_power = data[2];
myDebug(" SetPoint=%d, hk_power=%d, ww_power=%d", setpoint, hk_power, ww_power);
uint8_t setpoint = data[0]; // flow temp is * 2
uint8_t ww_power = data[2]; // power in %

char s[5];
char s2[5];
strlcpy(s, itoa(setpoint >> 1, s2, 10), 5);
strlcat(s, ".", sizeof(s));
strlcat(s, ((setpoint & 0x01) ? "5" : "0"), 5);

myDebug(" Boiler flow temp %s C, Warm Water power %d %", s, ww_power);

}
}
*/

}

/**
Expand Down Expand Up @@ -1972,6 +1979,34 @@ void ems_setWarmWaterTemp(uint8_t temperature) {
EMS_TxQueue.push(EMS_TxTelegram);
}

/**
* Set the boiler flow temp
*/
void ems_setFlowTemp(uint8_t temperature) {

myDebug("Setting boiler flow temperature to %d C", temperature);

_EMS_TxTelegram EMS_TxTelegram = EMS_TX_TELEGRAM_NEW; // create new Tx
EMS_TxTelegram.timestamp = millis(); // set timestamp
EMS_Sys_Status.txRetryCount = 0; // reset retry counter

EMS_TxTelegram.action = EMS_TX_TELEGRAM_WRITE;
EMS_TxTelegram.dest = EMS_Boiler.type_id;
EMS_TxTelegram.type = EMS_TYPE_UBASetPoints;
EMS_TxTelegram.offset = EMS_OFFSET_UBASetPoints_flowtemp;
EMS_TxTelegram.length = EMS_MIN_TELEGRAM_LENGTH;
EMS_TxTelegram.dataValue = temperature; // value to compare against. must be a single int

EMS_TxTelegram.type_validate = EMS_TYPE_UBASetPoints; // validate
EMS_TxTelegram.comparisonOffset = EMS_OFFSET_UBASetPoints_flowtemp;
EMS_TxTelegram.comparisonValue = temperature;
EMS_TxTelegram.comparisonPostRead = EMS_TYPE_UBASetPoints;
EMS_TxTelegram.forceRefresh = false;

EMS_TxQueue.push(EMS_TxTelegram);

}

/**
* Set the warm water mode to comfort to Eco/Comfort
* 1 = Hot, 2 = Eco, 3 = Intelligent
Expand Down
1 change: 1 addition & 0 deletions src/ems.h
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ void ems_setThermostatTemp(float temperature, uint8_t temptype = 0);
void ems_setThermostatMode(uint8_t mode);
void ems_setThermostatHC(uint8_t hc);
void ems_setWarmWaterTemp(uint8_t temperature);
void ems_setFlowTemp(uint8_t temperature);
void ems_setWarmWaterActivated(bool activated);
void ems_setWarmTapWaterActivated(bool activated);
void ems_setPoll(bool b);
Expand Down
2 changes: 2 additions & 0 deletions src/ems_devices.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@
#define EMS_VALUE_UBAParameterWW_wwComfort_Eco 0xD8 // the value for eco
#define EMS_VALUE_UBAParameterWW_wwComfort_Intelligent 0xEC // the value for intelligent

#define EMS_OFFSET_UBASetPoints_flowtemp 0 // flow temp

// Other
#define EMS_TYPE_SM10Monitor 0x97 // SM10Monitor

Expand Down
2 changes: 1 addition & 1 deletion src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
#pragma once

#define APP_NAME "EMS-ESP"
#define APP_VERSION "1.7.0b3"
#define APP_VERSION "1.7.0b4"
#define APP_HOSTNAME "ems-esp"

0 comments on commit 5cf6d25

Please sign in to comment.