started adding emsplus

This commit is contained in:
Glenn Arens
2019-03-07 14:46:48 +01:00
parent 8f985246a9
commit fbe7a716c9
5 changed files with 20 additions and 54 deletions

1
.gitignore vendored
View File

@@ -3,6 +3,7 @@
.gcc-flags.json .gcc-flags.json
.vscode .vscode
.env .env
platformio.ini
lib/readme.txt lib/readme.txt
.travis.yml .travis.yml
*.py *.py

View File

@@ -29,7 +29,7 @@ MyESP::MyESP() {
_helpProjectCmds_count = 0; _helpProjectCmds_count = 0;
_command = (char *)malloc(TELNET_MAX_COMMAND_LENGTH); // reserve buffer for Serial/Telnet commands _command = (char *)malloc(TELNET_MAX_COMMAND_LENGTH); // reserve buffer for Serial/Telnet commands
_use_serial = false; _use_serial = true;
_mqtt_host = NULL; _mqtt_host = NULL;
_mqtt_password = NULL; _mqtt_password = NULL;
_mqtt_username = NULL; _mqtt_username = NULL;

View File

@@ -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

View File

@@ -57,7 +57,8 @@ void _process_RC35StatusMessage(uint8_t type, uint8_t * data, uint8_t length);
// Easy // Easy
void _process_EasyStatusMessage(uint8_t type, uint8_t * data, uint8_t length); 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 * Recognized EMS types and the functions they call to process the telegrams
* Format: MODEL ID, TYPE ID, Description, function * Format: MODEL ID, TYPE ID, Description, function
@@ -114,6 +115,8 @@ const _EMS_Type EMS_Types[] = {
// Easy // Easy
{EMS_MODEL_EASY, EMS_TYPE_EasyStatusMessage, "EasyStatusMessage", _process_EasyStatusMessage}, {EMS_MODEL_EASY, EMS_TYPE_EasyStatusMessage, "EasyStatusMessage", _process_EasyStatusMessage},
{EMS_MODEL_BOSCHEASY, 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)); strlcpy(EMS_Thermostat.version, "not set", sizeof(EMS_Thermostat.version));
// default logging is none // default logging is none
ems_setLogging(EMS_SYS_LOGGING_DEFAULT); ems_setLogging(EMS_SYS_LOGGING_THERMOSTAT);
} }
// Getters and Setters for parameters // 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 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) * type 0xB0 - for reading the mode from the RC10 thermostat (0x17)
* received only after requested * received only after requested

View File

@@ -83,7 +83,10 @@
#define EMS_TYPE_EasyStatusMessage 0x0A // reading values on an Easy Thermostat #define EMS_TYPE_EasyStatusMessage 0x0A // reading values on an Easy Thermostat
#define EMS_TYPE_EasyStatusMessage_setpoint 10 // setpoint temp #define EMS_TYPE_EasyStatusMessage_setpoint 10 // setpoint temp
#define EMS_TYPE_EasyStatusMessage_curr 8 // current 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 // Known EMS types
typedef enum { typedef enum {
EMS_MODEL_NONE, EMS_MODEL_NONE,
@@ -102,7 +105,9 @@ typedef enum {
EMS_MODEL_EASY, EMS_MODEL_EASY,
EMS_MODEL_BOSCHEASY, EMS_MODEL_BOSCHEASY,
EMS_MODEL_RC310, EMS_MODEL_RC310,
EMS_MODEL_CW100 EMS_MODEL_CW100,
//Ems plus
EMSP_MODEL_RC10
} _EMS_MODEL_ID; } _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_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_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_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},
}; };