From 0f4ea8d5aff2c8c4f8ea816e3cfa76af54b6f346 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 5 May 2019 14:46:47 +0200 Subject: [PATCH] FR10 Junkers --- CHANGELOG.md | 16 ++++++++-------- src/ems-esp.cpp | 18 ++++++++++++++---- src/ems.cpp | 34 ++++++++++++++++++++++++++++++---- src/ems_devices.h | 8 +++++++- src/test_data.h | 3 ++- src/version.h | 2 +- 6 files changed, 62 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 79b97e079..5852ad6c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,26 +5,26 @@ 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-05 +## [1.7.0] 2019-05-05 ### Added -- Buderus Logamax plus boiler added -- EMS+ support (thanks too @gl3nni3 for making the first implementation) +- EMS+ support (thanks too @gl3nni3 for doing the first research) - 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) +- added a test harness to try out response to various telegrams - `tx_delay` setting for circuits where we needed to slow down Tx transmission - new boiler: Nefit proline hrc 24 cw4 thermostat -- new thermostats: Buderus RC300 and RC310 thermostats [(issue 37)](https://github.com/proddy/EMS-ESP/issues/37) -- added a test harness to try out response to various telegrams -- new devices: Buderus Web Gateway KM200, Solar Module SM100 +- new boiler: Buderus Logamax plus +- new thermostat: Buderus RC300 and RC310 thermostats [(issue 37)](https://github.com/proddy/EMS-ESP/issues/37) +- new thermostat: Junkers FR10 [(issue 98)](https://github.com/proddy/EMS-ESP/issues/98) +- new devices: Buderus Web Gateway KM200, Buderus Solar Module SM100 ### Changed - `types` renamed to `devices` to also show all detected devices -- EMS Plus logic optimized -- `silent_mode` to `listen_mode` +- renamed `silent_mode` to `listen_mode` - increased Tx queue to 100 ## [1.6.0] 2019-03-24 diff --git a/src/ems-esp.cpp b/src/ems-esp.cpp index 8d44c4f4a..88da92486 100644 --- a/src/ems-esp.cpp +++ b/src/ems-esp.cpp @@ -460,10 +460,13 @@ void showInfo() { myDebug("%sThermostat stats:%s", COLOR_BOLD_ON, COLOR_BOLD_OFF); myDebug(" Thermostat: %s", ems_getThermostatDescription(buffer_type)); if ((ems_getThermostatModel() == EMS_MODEL_EASY) || (ems_getThermostatModel() == EMS_MODEL_BOSCHEASY)) { - // for easy temps are * 100 - // also we don't have the time or mode - _renderShortValue("Set room temperature", "C", EMS_Thermostat.setpoint_roomTemp, 10); - _renderShortValue("Current room temperature", "C", EMS_Thermostat.curr_roomTemp, 10); + // for easy temps are * 100, also we don't have the time or mode + _renderShortValue("Set room temperature", "C", EMS_Thermostat.setpoint_roomTemp, 10); // *100 + _renderShortValue("Current room temperature", "C", EMS_Thermostat.curr_roomTemp, 10); // *100 + } else if (ems_getThermostatModel() == EMS_MODEL_FR10) { + // Junkers are *10 + _renderIntValue("Set room temperature", "C", EMS_Thermostat.setpoint_roomTemp, 10); // *10 + _renderIntValue("Current room temperature", "C", EMS_Thermostat.curr_roomTemp, 10); // *10 } else { // because we store in 2 bytes short, when converting to a single byte we'll loose the negative value if its unset if (EMS_Thermostat.setpoint_roomTemp <= 0) { @@ -673,12 +676,19 @@ void publishValues(bool force) { rootThermostat[THERMOSTAT_HC] = _int_to_char(s, EMSESP_Status.heating_circuit); + // different logic depending on thermostat types if ((ems_getThermostatModel() == EMS_MODEL_EASY) || (ems_getThermostatModel() == EMS_MODEL_BOSCHEASY)) { if (abs(EMS_Thermostat.setpoint_roomTemp) < EMS_VALUE_SHORT_NOTSET) rootThermostat[THERMOSTAT_SELTEMP] = (double)EMS_Thermostat.setpoint_roomTemp / 10; if (abs(EMS_Thermostat.curr_roomTemp) < EMS_VALUE_SHORT_NOTSET) rootThermostat[THERMOSTAT_CURRTEMP] = (double)EMS_Thermostat.curr_roomTemp / 10; + } else if (ems_getThermostatModel() == EMS_MODEL_FR10) { + if (abs(EMS_Thermostat.setpoint_roomTemp) < EMS_VALUE_SHORT_NOTSET) + rootThermostat[THERMOSTAT_SELTEMP] = (double)EMS_Thermostat.setpoint_roomTemp / 10; + if (abs(EMS_Thermostat.curr_roomTemp) < EMS_VALUE_SHORT_NOTSET) + rootThermostat[THERMOSTAT_CURRTEMP] = (double)EMS_Thermostat.curr_roomTemp / 10; + } else { if (EMS_Thermostat.setpoint_roomTemp != EMS_VALUE_INT_NOTSET) rootThermostat[THERMOSTAT_SELTEMP] = (double)EMS_Thermostat.setpoint_roomTemp / 2; diff --git a/src/ems.cpp b/src/ems.cpp index 560ae4ca2..f3bc14e7b 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -81,13 +81,16 @@ void _process_RC30StatusMessage(_EMS_RxTelegram * EMS_RxTelegram); void _process_RC35Set(_EMS_RxTelegram * EMS_RxTelegram); void _process_RC35StatusMessage(_EMS_RxTelegram * EMS_RxTelegram); -// Easy +// Easy type devices like C100 void _process_EasyStatusMessage(_EMS_RxTelegram * EMS_RxTelegram); // RC1010, RC300, RC310 void _process_RCPLUSStatusMessage(_EMS_RxTelegram * EMS_RxTelegram); void _process_RCPLUSSetMessage(_EMS_RxTelegram * EMS_RxTelegram); +// Junkers FR10 +void _process_FR10StatusMessage(_EMS_RxTelegram * EMS_RxTelegram); + /* * Recognized EMS types and the functions they call to process the telegrams * Format: MODEL ID, TYPE ID, Description, function, emsplus @@ -156,7 +159,11 @@ const _EMS_Type EMS_Types[] = { // Nefit 1010, RC300, RC310 (EMS Plus) {EMS_MODEL_ALL, EMS_TYPE_RCPLUSStatusMessage, "RCPLUSStatusMessage", _process_RCPLUSStatusMessage}, - {EMS_MODEL_ALL, EMS_TYPE_RCPLUSSet, "RCPLUSSetMessage", _process_RCPLUSSetMessage} + {EMS_MODEL_ALL, EMS_TYPE_RCPLUSSet, "RCPLUSSetMessage", _process_RCPLUSSetMessage}, + + // Junkers FR10 + {EMS_MODEL_ALL, EMS_TYPE_FR10StatusMessage, "FR10StatusMessage", _process_FR10StatusMessage} + }; @@ -1252,6 +1259,17 @@ void _process_RCPLUSStatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { } } +/* + * FR10 Junkers - type x6F01 + */ +void _process_FR10StatusMessage(_EMS_RxTelegram * EMS_RxTelegram) { + if (EMS_RxTelegram->data_length == 6) { + // e.g. 90 00 FF 00 00 6F 03 01 00 BE 00 BF + EMS_Thermostat.curr_roomTemp = _toByte(EMS_OFFSET_FR10StatusMessage_curr); // value is * 10 + EMS_Thermostat.setpoint_roomTemp = _toByte(EMS_OFFSET_FR10StatusMessage_setpoint); // value is * 10, which is different from other EMS+ devices + } +} + /* * to complete.... */ @@ -1742,7 +1760,11 @@ char * ems_getThermostatDescription(char * buffer) { } strlcat(buffer, " (ProductID:", size); - strlcat(buffer, itoa(EMS_Thermostat.product_id, tmp, 10), size); + if (EMS_Thermostat.product_id == EMS_ID_NONE) { + strlcat(buffer, "?", size); + } else { + strlcat(buffer, itoa(EMS_Thermostat.product_id, tmp, 10), size); + } strlcat(buffer, " Version:", size); strlcat(buffer, EMS_Thermostat.version, size); strlcat(buffer, ")", size); @@ -1779,7 +1801,11 @@ char * ems_getBoilerDescription(char * buffer) { } strlcat(buffer, " (ProductID:", size); - strlcat(buffer, itoa(EMS_Boiler.product_id, tmp, 10), size); + if (EMS_Boiler.product_id == EMS_ID_NONE) { + strlcat(buffer, "?", size); + } else { + strlcat(buffer, itoa(EMS_Boiler.product_id, tmp, 10), size); + } strlcat(buffer, " Version:", size); strlcat(buffer, EMS_Boiler.version, size); strlcat(buffer, ")", size); diff --git a/src/ems_devices.h b/src/ems_devices.h index a0042cfde..1db4ccd65 100644 --- a/src/ems_devices.h +++ b/src/ems_devices.h @@ -100,10 +100,16 @@ // RC1010, RC310 and RC300 specific (EMS Plus) #define EMS_TYPE_RCPLUSStatusMessage 0x01A5 // is an automatic thermostat broadcast giving us temps -#define EMS_TYPE_RCPLUSSet 0x03 // setpoint temp message - this is incorrect! +#define EMS_TYPE_RCPLUSSet 0x03 // setpoint temp message #define EMS_OFFSET_RCPLUSStatusMessage_setpoint 3 // setpoint temp #define EMS_OFFSET_RCPLUSStatusMessage_curr 0 // current temp +// Junkers FR10 (EMS Plus) +#define EMS_TYPE_FR10StatusMessage 0x6F // is an automatic thermostat broadcast giving us temps +#define EMS_OFFSET_FR10StatusMessage_setpoint 3 // setpoint temp +#define EMS_OFFSET_FR10StatusMessage_curr 5 // current temp + + // Known EMS types typedef enum { EMS_MODEL_NONE, diff --git a/src/test_data.h b/src/test_data.h index 62e191d28..40b2b365c 100644 --- a/src/test_data.h +++ b/src/test_data.h @@ -45,7 +45,8 @@ static const char * TEST_DATA[] = { "30 00 FF 00 02 62 00 E4", // test 40 - SM100 "10 48 F7 00 FF 01 A5 DF FF F7 7F 1F", // test 41 - gateway "30 00 FF 09 02 64 1E", // test 42 - SM100 - "08 00 18 00 05 03 30 00 00 00 00 04 40 80 00 02 17 80 00 00 00 FF 30 48 00 CB 00 00 00" // test 43 - sys pressure + "08 00 18 00 05 03 30 00 00 00 00 04 40 80 00 02 17 80 00 00 00 FF 30 48 00 CB 00 00 00", // test 43 - sys pressure + "90 00 FF 00 00 6F 03 01 00 BE 00 BF" // test 44 - FR10 }; diff --git a/src/version.h b/src/version.h index 47741b5b4..4e17d7c84 100644 --- a/src/version.h +++ b/src/version.h @@ -6,5 +6,5 @@ #pragma once #define APP_NAME "EMS-ESP" -#define APP_VERSION "1.7.0b14" +#define APP_VERSION "1.7.0b15" #define APP_HOSTNAME "ems-esp"