From fbe7a716c9eed4dff1046131b3c6d79d6643c1d2 Mon Sep 17 00:00:00 2001 From: Glenn Arens Date: Thu, 7 Mar 2019 14:46:48 +0100 Subject: [PATCH] started adding emsplus --- .gitignore | 1 + lib/myESP/MyESP.cpp | 2 +- platformio.ini | 47 --------------------------------------------- src/ems.cpp | 13 ++++++++++--- src/ems_devices.h | 11 ++++++++--- 5 files changed, 20 insertions(+), 54 deletions(-) delete mode 100644 platformio.ini diff --git a/.gitignore b/.gitignore index e1f0bccca..e93465a46 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ .gcc-flags.json .vscode .env +platformio.ini lib/readme.txt .travis.yml *.py diff --git a/lib/myESP/MyESP.cpp b/lib/myESP/MyESP.cpp index 93398633b..c9236fa21 100644 --- a/lib/myESP/MyESP.cpp +++ b/lib/myESP/MyESP.cpp @@ -29,7 +29,7 @@ MyESP::MyESP() { _helpProjectCmds_count = 0; _command = (char *)malloc(TELNET_MAX_COMMAND_LENGTH); // reserve buffer for Serial/Telnet commands - _use_serial = false; + _use_serial = true; _mqtt_host = NULL; _mqtt_password = NULL; _mqtt_username = NULL; diff --git a/platformio.ini b/platformio.ini deleted file mode 100644 index 4c4d23cf5..000000000 --- a/platformio.ini +++ /dev/null @@ -1,47 +0,0 @@ -[platformio] -; change this for your ESP8266 device -; env_default = nodemcuv2 -env_default = d1_mini - -[common] -platform = espressif8266 -flash_mode = dout -build_flags = -g -w -;build_flags = -g -w -DBUILD_TIME=$UNIX_TIME - -wifi_settings = -; hard code if you prefer. Recommendation is to set from within the app when in Serial or AP mode -;wifi_settings = '-DWIFI_SSID="XXXX"' '-DWIFI_PASSWORD="XXXX"' - -lib_deps = - CRC32 - CircularBuffer - JustWifi - AsyncMqttClient - ArduinoJson - OneWire - -[env:nodemcuv2] -board = nodemcuv2 -platform = ${common.platform} -framework = arduino -lib_deps = ${common.lib_deps} -build_flags = ${common.build_flags} ${common.wifi_settings} -board_build.flash_mode = ${common.flash_mode} -upload_speed = 921600 -monitor_speed = 115200 -upload_port = ems-esp.local -;upload_port = 10.10.10.6 - -[env:d1_mini] -board = d1_mini -platform = ${common.platform} -framework = arduino -lib_deps = ${common.lib_deps} -build_flags = ${common.build_flags} ${common.wifi_settings} -board_build.flash_mode = ${common.flash_mode} -upload_speed = 921600 -monitor_speed = 115200 -upload_port = COM3 -;upload_port = 10.10.10.6 - diff --git a/src/ems.cpp b/src/ems.cpp index 8f144e1da..adb4b86b0 100644 --- a/src/ems.cpp +++ b/src/ems.cpp @@ -57,7 +57,8 @@ void _process_RC35StatusMessage(uint8_t type, uint8_t * data, uint8_t length); // Easy void _process_EasyStatusMessage(uint8_t type, uint8_t * data, uint8_t length); - +//EMS Plus +void _process_EmsPlusStatusMessage(uint8_t type, uint8_t * data, uint8_t length); /* * Recognized EMS types and the functions they call to process the telegrams * Format: MODEL ID, TYPE ID, Description, function @@ -114,6 +115,8 @@ const _EMS_Type EMS_Types[] = { // Easy {EMS_MODEL_EASY, EMS_TYPE_EasyStatusMessage, "EasyStatusMessage", _process_EasyStatusMessage}, {EMS_MODEL_BOSCHEASY, EMS_TYPE_EasyStatusMessage, "EasyStatusMessage", _process_EasyStatusMessage}, + //Ems plus + {EMSP_MODEL_RC10, EMS_TYPE_EmsPlusStatusMessage, "EasyStatusMessage", _process_EmsPlusStatusMessage} }; @@ -241,7 +244,7 @@ void ems_init() { strlcpy(EMS_Thermostat.version, "not set", sizeof(EMS_Thermostat.version)); // default logging is none - ems_setLogging(EMS_SYS_LOGGING_DEFAULT); + ems_setLogging(EMS_SYS_LOGGING_THERMOSTAT); } // Getters and Setters for parameters @@ -1036,7 +1039,11 @@ void _process_EasyStatusMessage(uint8_t type, uint8_t * data, uint8_t length) { EMS_Sys_Status.emsRefreshed = true; // triggers a send the values back via MQTT } - +void _process_EmsPlusStatusMessage(uint8_t type, uint8_t * data, uint8_t length) { + myDebug("The type is ", type); + myDebug("The data is ", data); + myDebug("The length is ", length); +} /** * type 0xB0 - for reading the mode from the RC10 thermostat (0x17) * received only after requested diff --git a/src/ems_devices.h b/src/ems_devices.h index 56da1a980..36872851a 100644 --- a/src/ems_devices.h +++ b/src/ems_devices.h @@ -83,7 +83,10 @@ #define EMS_TYPE_EasyStatusMessage 0x0A // reading values on an Easy Thermostat #define EMS_TYPE_EasyStatusMessage_setpoint 10 // setpoint temp #define EMS_TYPE_EasyStatusMessage_curr 8 // current temp - +// Ems plus +#define EMS_TYPE_EmsPlusStatusMessage 0x00 // reading values on an Easy Thermostat +#define EMS_TYPE_EmsPlusStatusMessage_setpoint 0 // setpoint temp +#define EMS_TYPE_EmsPlusStatusMessage_curr 0 // current temp // Known EMS types typedef enum { EMS_MODEL_NONE, @@ -102,7 +105,9 @@ typedef enum { EMS_MODEL_EASY, EMS_MODEL_BOSCHEASY, EMS_MODEL_RC310, - EMS_MODEL_CW100 + EMS_MODEL_CW100, + //Ems plus + EMSP_MODEL_RC10 } _EMS_MODEL_ID; @@ -140,6 +145,6 @@ const _Thermostat_Type Thermostat_Types[] = { {EMS_MODEL_BOSCHEASY, 206, 0x02, "Bosch Easy", EMS_THERMOSTAT_READ_YES, EMS_THERMOSTAT_WRITE_NO}, {EMS_MODEL_RC310, 158, 0x10, "RC310", EMS_THERMOSTAT_READ_NO, EMS_THERMOSTAT_WRITE_NO}, {EMS_MODEL_CW100, 255, 0x18, "Bosch CW100", EMS_THERMOSTAT_READ_NO, EMS_THERMOSTAT_WRITE_NO}, - {EMS_MODEL_RC10, 165, 0x02, "RC10/Nefit Moduline 1010)", EMS_THERMOSTAT_READ_YES, EMS_THERMOSTAT_WRITE_YES}, + {EMSP_MODEL_RC10, 165, 0x02, "RC10/Nefit Moduline 1010)", EMS_THERMOSTAT_READ_YES, EMS_THERMOSTAT_WRITE_YES}, };