This commit is contained in:
proddy
2019-02-04 21:44:13 +01:00
parent f2556aa203
commit a0303f0704
8 changed files with 109 additions and 53 deletions

View File

@@ -82,7 +82,6 @@ command_t PROGMEM project_cmds[] = {
{"set dallas_gpio <pin>", "set the pin for the external Dallas temperature sensor (D5=14)"},
{"set thermostat_type <hex type ID>", "set the thermostat type id (e.g. 10 for 0x10)"},
{"set boiler_type <hex type ID>", "set the boiler type id (e.g. 8 for 0x08)"},
{"info", "show the values"},
{"log <n | b | t | r | v>", "set logging mode to none, basic, thermostat only, raw or verbose"},
{"publish", "publish values to MQTT"},
@@ -845,6 +844,7 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
if (type == MQTT_CONNECT_EVENT) {
myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_TEMP);
myESP.mqttSubscribe(TOPIC_THERMOSTAT_CMD_MODE);
myESP.mqttSubscribe(TOPIC_BOILER_WWACTIVATED);
myESP.mqttSubscribe(TOPIC_SHOWER_TIMER);
myESP.mqttSubscribe(TOPIC_SHOWER_ALERT);
myESP.mqttSubscribe(TOPIC_SHOWER_COLDSHOT);
@@ -888,6 +888,16 @@ void MQTTCallback(unsigned int type, const char * topic, const char * message) {
}
}
// wwActivated
if (strcmp(topic, TOPIC_BOILER_WWACTIVATED) == 0) {
if (message[0] == '1') {
ems_setWarmWaterActivated(true);
} else if (message[0] == '0') {
ems_setWarmWaterActivated(false);
}
publishValues(true); // publish back immediately
}
// shower timer
if (strcmp(topic, TOPIC_SHOWER_TIMER) == 0) {
if (message[0] == '1') {

View File

@@ -768,9 +768,10 @@ void _processType(uint8_t * telegram, uint8_t length) {
EMS_Sys_Status.emsTxStatus = EMS_TX_STATUS_IDLE;
// at this point we can assume Txstatus is EMS_TX_STATUS_WAIT
// for READ, WRITE or VALIDATE the dest is always us, so check this
// if not just process and quit
// for READ, WRITE or VALIDATE the dest (telegram[1]) is always us, so check for this
// if not we probably didn't get any response so remove the last Tx from the queue and process the telegram
if ((telegram[1] & 0x7F) != EMS_ID_ME) {
_removeTxQueue();
_ems_processTelegram(telegram, length);
return;
}
@@ -1443,11 +1444,7 @@ char * ems_getBoilerDescription(char * buffer) {
* Find the versions of our connected devices
*/
void ems_scanDevices() {
myDebug("Scanning EMS bus for devices...");
// start refresh when scanning and forget anything devices we may have already set
EMS_Thermostat.type_id = EMS_ID_NONE; // forget thermostat
EMS_Thermostat.model_id = EMS_MODEL_NONE;
myDebug("Scanning EMS bus for devices.");
std::list<uint8_t> Device_Ids; // new list

View File

@@ -23,17 +23,18 @@
#define MQTT_QOS 1
// MQTT for thermostat
#define TOPIC_THERMOSTAT_DATA "thermostat_data" // for sending thermostat values
#define TOPIC_THERMOSTAT_CMD_TEMP "thermostat_cmd_temp" // for received thermostat temp changes
#define TOPIC_THERMOSTAT_CMD_MODE "thermostat_cmd_mode" // for received thermostat mode changes
#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_MODE "thermostat_cmd_mode" // for received thermostat mode changes via MQTT
#define THERMOSTAT_CURRTEMP "thermostat_currtemp" // current temperature
#define THERMOSTAT_SELTEMP "thermostat_seltemp" // selected temperature
#define THERMOSTAT_MODE "thermostat_mode" // mode
// MQTT for boiler
#define TOPIC_BOILER_DATA "boiler_data" // for sending boiler values
#define TOPIC_BOILER_DATA "boiler_data" // for sending boiler values to MQTT
#define TOPIC_BOILER_TAPWATER_ACTIVE "tapwater_active" // if hot tap water is running
#define TOPIC_BOILER_HEATING_ACTIVE "heating_active" // if heating is on
#define TOPIC_BOILER_WWACTIVATED "wwactivated" // for receiving MQTT message to change water on/off
// shower time
#define TOPIC_SHOWERTIME "showertime" // for sending shower time results

View File

@@ -6,5 +6,5 @@
#pragma once
#define APP_NAME "EMS-ESP"
#define APP_VERSION "1.5.1"
#define APP_VERSION "1.5.2"
#define APP_HOSTNAME "ems-esp"