mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
emsplus for Tx
This commit is contained in:
@@ -26,9 +26,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- RC35 setting temperature also forces the current select temp to change, irrespective of the mode
|
||||
|
||||
### Changed
|
||||
- improved MQTT publishing to stop flooding. `publish_time` must be at least 1 (second)
|
||||
- External sensors (like dallas) are sent as a nested MQTT topic including their unqiue identifier
|
||||
- `mqttlog` console command renamed to `mqttqueue`
|
||||
- improved MQTT publishing to stop network flooding. `publish_time` of -1 is no publish, 0 is automatic otherwise its a time interval
|
||||
- External sensors (like Dallas DS18*) are sent as a nested MQTT topic including their unqiue identifier
|
||||
- `mqttlog` console command renamed to `mqttqueue` to only show the current publish queue
|
||||
|
||||
### Removed
|
||||
- `autodetect scan`
|
||||
|
||||
@@ -607,7 +607,8 @@ void _ems_sendTelegram() {
|
||||
}
|
||||
|
||||
// complete the rest of the header depending on EMS or EMS+
|
||||
if (EMS_TxTelegram.type > 0xFF) {
|
||||
// or if we explicitly set EMS+ like with Junkers
|
||||
if ((EMS_TxTelegram.type > 0xFF) || (EMS_TxTelegram.emsplus)) {
|
||||
// EMS 2.0 / EMS+
|
||||
EMS_TxTelegram.data[2] = 0xFF; // fixed value indicating an extended message
|
||||
EMS_TxTelegram.data[3] = EMS_TxTelegram.offset;
|
||||
@@ -699,6 +700,7 @@ void _createValidate() {
|
||||
new_EMS_TxTelegram.comparisonValue = EMS_TxTelegram.comparisonValue;
|
||||
new_EMS_TxTelegram.comparisonPostRead = EMS_TxTelegram.comparisonPostRead;
|
||||
new_EMS_TxTelegram.comparisonOffset = EMS_TxTelegram.comparisonOffset;
|
||||
new_EMS_TxTelegram.emsplus = EMS_TxTelegram.emsplus;
|
||||
|
||||
// this is what is different
|
||||
new_EMS_TxTelegram.offset = EMS_TxTelegram.comparisonOffset; // location of byte to fetch
|
||||
@@ -2420,6 +2422,8 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, uint8_t temptype)
|
||||
}
|
||||
|
||||
else if (model == EMS_DEVICE_FLAG_JUNKERS) {
|
||||
// All Junkers use EMS+. I think.
|
||||
EMS_TxTelegram.emsplus = true;
|
||||
switch (temptype) {
|
||||
case 1: // change the no frost temp
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_no_frost_temp;
|
||||
@@ -2432,7 +2436,7 @@ void ems_setThermostatTemp(float temperature, uint8_t hc_num, uint8_t temptype)
|
||||
break;
|
||||
default:
|
||||
case 0: // automatic selection, if no type is defined, we use the standard code
|
||||
// not sure if this is correct for Junkers
|
||||
// TODO: not sure if this is correct for Junkers
|
||||
if (EMS_Thermostat.hc[hc_num - 1].mode_type == 0) {
|
||||
EMS_TxTelegram.offset = EMS_OFFSET_JunkersSetMessage_night_temp;
|
||||
} else if (EMS_Thermostat.hc[hc_num - 1].mode_type == 1) {
|
||||
|
||||
36
src/ems.h
36
src/ems.h
@@ -155,22 +155,6 @@ typedef struct {
|
||||
uint8_t emsMasterThermostat; // product ID for the default thermostat to use
|
||||
} _EMS_Sys_Status;
|
||||
|
||||
// The Tx send package
|
||||
typedef struct {
|
||||
_EMS_TX_TELEGRAM_ACTION action; // read, write, validate, init
|
||||
uint8_t dest;
|
||||
uint16_t type;
|
||||
uint8_t offset;
|
||||
uint8_t length; // full length of complete telegram, including CRC
|
||||
uint8_t dataValue; // value to validate against
|
||||
uint16_t type_validate; // type to call after a successful Write command
|
||||
uint8_t comparisonValue; // value to compare against during a validate command
|
||||
uint8_t comparisonOffset; // offset of where the byte is we want to compare too during validation
|
||||
uint16_t comparisonPostRead; // after a successful write, do a read from this type ID
|
||||
unsigned long timestamp; // when created
|
||||
uint8_t data[EMS_MAX_TELEGRAM_LENGTH];
|
||||
} _EMS_TxTelegram;
|
||||
|
||||
// The Rx receive package
|
||||
typedef struct {
|
||||
unsigned long timestamp; // timestamp from millis()
|
||||
@@ -186,6 +170,23 @@ typedef struct {
|
||||
uint8_t emsplus_type; // FF, F7 or F9
|
||||
} _EMS_RxTelegram;
|
||||
|
||||
// The Tx send package
|
||||
typedef struct {
|
||||
_EMS_TX_TELEGRAM_ACTION action; // read, write, validate, init
|
||||
uint8_t dest;
|
||||
uint16_t type;
|
||||
uint8_t offset;
|
||||
uint8_t length; // full length of complete telegram, including CRC
|
||||
bool emsplus; // true if ems+/ems 2.0
|
||||
uint8_t dataValue; // value to validate against
|
||||
uint16_t type_validate; // type to call after a successful Write command
|
||||
uint8_t comparisonValue; // value to compare against during a validate command
|
||||
uint8_t comparisonOffset; // offset of where the byte is we want to compare too during validation
|
||||
uint16_t comparisonPostRead; // after a successful write, do a read from this type ID
|
||||
unsigned long timestamp; // when created
|
||||
uint8_t data[EMS_MAX_TELEGRAM_LENGTH];
|
||||
} _EMS_TxTelegram;
|
||||
|
||||
// default empty Tx, must match struct
|
||||
const _EMS_TxTelegram EMS_TX_TELEGRAM_NEW = {
|
||||
EMS_TX_TELEGRAM_INIT, // action
|
||||
@@ -193,7 +194,8 @@ const _EMS_TxTelegram EMS_TX_TELEGRAM_NEW = {
|
||||
EMS_ID_NONE, // type
|
||||
0, // offset
|
||||
0, // length
|
||||
0, // data value
|
||||
false, // emsplus (no)
|
||||
0, // dataValue
|
||||
EMS_ID_NONE, // type_validate
|
||||
0, // comparisonValue
|
||||
0, // comparisonOffset
|
||||
|
||||
@@ -273,8 +273,8 @@ static const _EMS_Device EMS_Devices[] = {
|
||||
{157, EMS_DEVICE_TYPE_THERMOSTAT, "Buderus RC200/Bosch CW100/Junkers CW100", EMS_DEVICE_FLAG_NO_WRITE}, // 0x18, cannot write
|
||||
|
||||
// Buderus/Nefit specific
|
||||
{79, EMS_DEVICE_TYPE_THERMOSTAT, "RC10/Moduline 100", EMS_DEVICE_FLAG_RC10}, // 0x17
|
||||
{80, EMS_DEVICE_TYPE_THERMOSTAT, "Moduline 200", EMS_DEVICE_FLAG_RC10}, // 0x17
|
||||
{79, EMS_DEVICE_TYPE_THERMOSTAT, "RC10/Moduline 100", EMS_DEVICE_FLAG_RC10}, // 0x17
|
||||
{80, EMS_DEVICE_TYPE_THERMOSTAT, "Moduline 200", EMS_DEVICE_FLAG_RC10}, // 0x17
|
||||
{77, EMS_DEVICE_TYPE_THERMOSTAT, "RC20/Moduline 300", EMS_DEVICE_FLAG_RC20}, // 0x17
|
||||
{67, EMS_DEVICE_TYPE_THERMOSTAT, "RC30", EMS_DEVICE_FLAG_RC30N}, // 0x10 - based on RC35
|
||||
{78, EMS_DEVICE_TYPE_THERMOSTAT, "Moduline 400", EMS_DEVICE_FLAG_RC30}, // 0x10
|
||||
@@ -287,15 +287,15 @@ static const _EMS_Device EMS_Devices[] = {
|
||||
{76, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES73", EMS_DEVICE_FLAG_RC35}, // 0x10
|
||||
{113, EMS_DEVICE_TYPE_THERMOSTAT, "Sieger ES72", EMS_DEVICE_FLAG_RC20}, // 0x17
|
||||
|
||||
// Junkers
|
||||
{105, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW100", EMS_DEVICE_FLAG_JUNKERS}, // 0x10
|
||||
{106, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW200", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_NO_WRITE}, // 0x10, cannot write
|
||||
{107, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR100", EMS_DEVICE_FLAG_JUNKERS}, // 0x10
|
||||
{108, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR110", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_NO_WRITE}, // 0x10, cannot write
|
||||
{111, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR10", EMS_DEVICE_FLAG_JUNKERS}, // 0x10
|
||||
{147, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR50", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_NO_WRITE}, // 0x10, cannot write
|
||||
{191, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR120", EMS_DEVICE_FLAG_JUNKERS | EMS_DEVICE_FLAG_NO_WRITE}, // 0x10, cannot write
|
||||
{192, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW120", EMS_DEVICE_FLAG_JUNKERS} // 0x10
|
||||
// Junkers - all 0x10
|
||||
{105, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW100", EMS_DEVICE_FLAG_JUNKERS}, // 0x10
|
||||
{106, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW200", EMS_DEVICE_FLAG_JUNKERS}, // 0x10
|
||||
{107, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR100", EMS_DEVICE_FLAG_JUNKERS}, // 0x10
|
||||
{108, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR110", EMS_DEVICE_FLAG_JUNKERS}, // 0x10
|
||||
{111, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR10", EMS_DEVICE_FLAG_JUNKERS}, // 0x10
|
||||
{147, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR50", EMS_DEVICE_FLAG_JUNKERS}, // 0x10
|
||||
{191, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FR120", EMS_DEVICE_FLAG_JUNKERS}, // 0x10
|
||||
{192, EMS_DEVICE_TYPE_THERMOSTAT, "Junkers FW120", EMS_DEVICE_FLAG_JUNKERS} // 0x10
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define APP_VERSION "1.9.5b46"
|
||||
#define APP_VERSION "1.9.5b47"
|
||||
|
||||
Reference in New Issue
Block a user