mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
Merge branch 'dev' of https://github.com/proddy/EMS-ESP into dev
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
### Added
|
### Added
|
||||||
- function keys in editor: cursor, del, home, end. F1=help, F2=show, and other shortcuts
|
- function keys in editor: cursor, del, home, end. F1=help, F2=show, and other shortcuts
|
||||||
- SM100 pump working time and energy units
|
- SM100 pump working time and energy units
|
||||||
- heating curve parameters for RC300
|
- heating curve parameters for RC300 (fixed)
|
||||||
- `wwonetime` for RC300 thermostat
|
- `wwonetime` for RC300 thermostat
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -773,6 +773,16 @@ std::shared_ptr<Thermostat::HeatingCircuit> Thermostat::heating_circuit(std::sha
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// not found, search heating_curve message types
|
||||||
|
if (hc_num == 0) {
|
||||||
|
for (uint8_t i = 0; i < curve_typeids.size(); i++) {
|
||||||
|
if (curve_typeids[i] == telegram->type_id) {
|
||||||
|
hc_num = i + 1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// not found, search timer message types
|
// not found, search timer message types
|
||||||
if (hc_num == 0) {
|
if (hc_num == 0) {
|
||||||
for (uint8_t i = 0; i < timer_typeids.size(); i++) {
|
for (uint8_t i = 0; i < timer_typeids.size(); i++) {
|
||||||
|
|||||||
@@ -471,7 +471,7 @@ std::string EMSESP::pretty_telegram(std::shared_ptr<const Telegram> telegram) {
|
|||||||
type_name = read_flash_string(F("?"));
|
type_name = read_flash_string(F("?"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (telegram->dest & 0x80) {
|
if (telegram->operation == Telegram::Operation::RX_READ) {
|
||||||
direction = read_flash_string(F("<-"));
|
direction = read_flash_string(F("<-"));
|
||||||
} else {
|
} else {
|
||||||
direction = read_flash_string(F("->"));
|
direction = read_flash_string(F("->"));
|
||||||
|
|||||||
@@ -727,7 +727,7 @@ void Mqtt::register_mqtt_ha_binary_sensor(const __FlashStringHelper * name, cons
|
|||||||
snprintf_P(topic, sizeof(topic), PSTR("homeassistant/binary_sensor/ems-esp/%s/config"), entity);
|
snprintf_P(topic, sizeof(topic), PSTR("homeassistant/binary_sensor/ems-esp/%s/config"), entity);
|
||||||
|
|
||||||
// queue MQTT publish
|
// queue MQTT publish
|
||||||
publish(topic, doc.as<JsonObject>());
|
publish_retain(topic, doc.as<JsonObject>(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// HA config for a normal 'sensor' type
|
// HA config for a normal 'sensor' type
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
using uuid::console::Shell;
|
using uuid::console::Shell;
|
||||||
|
|
||||||
#define EMSESP_MAX_JSON_SIZE_HA_CONFIG 256 // for small HA config payloads
|
#define EMSESP_MAX_JSON_SIZE_HA_CONFIG 384 // for small HA config payloads
|
||||||
#define EMSESP_MAX_JSON_SIZE_SMALL 384 // for smaller json docs when using StaticJsonDocument
|
#define EMSESP_MAX_JSON_SIZE_SMALL 384 // for smaller json docs when using StaticJsonDocument
|
||||||
#define EMSESP_MAX_JSON_SIZE_MEDIUM 768 // for medium json docs from ems devices, when using StaticJsonDocument
|
#define EMSESP_MAX_JSON_SIZE_MEDIUM 768 // for medium json docs from ems devices, when using StaticJsonDocument
|
||||||
#define EMSESP_MAX_JSON_SIZE_LARGE 1024 // for large json docs from ems devices, like boiler or thermostat data. Using StaticJsonDocument
|
#define EMSESP_MAX_JSON_SIZE_LARGE 1024 // for large json docs from ems devices, like boiler or thermostat data. Using StaticJsonDocument
|
||||||
|
|||||||
@@ -162,6 +162,7 @@ void RxService::add(uint8_t * data, uint8_t length) {
|
|||||||
uint8_t src = data[0] & 0x7F; // strip MSB (HT3 adds it)
|
uint8_t src = data[0] & 0x7F; // strip MSB (HT3 adds it)
|
||||||
uint8_t dest = data[1] & 0x7F; // strip MSB, don't care if its read or write for processing
|
uint8_t dest = data[1] & 0x7F; // strip MSB, don't care if its read or write for processing
|
||||||
uint8_t offset = data[3]; // offset is always 4th byte
|
uint8_t offset = data[3]; // offset is always 4th byte
|
||||||
|
uint8_t operation = (data[1] & 0x80) ? Telegram::Operation::RX_READ : Telegram::Operation::RX;
|
||||||
|
|
||||||
uint16_t type_id;
|
uint16_t type_id;
|
||||||
uint8_t * message_data; // where the message block starts
|
uint8_t * message_data; // where the message block starts
|
||||||
@@ -212,7 +213,7 @@ void RxService::add(uint8_t * data, uint8_t length) {
|
|||||||
src = EMSESP::check_master_device(src, type_id, true);
|
src = EMSESP::check_master_device(src, type_id, true);
|
||||||
|
|
||||||
// create the telegram
|
// create the telegram
|
||||||
auto telegram = std::make_shared<Telegram>(Telegram::Operation::RX, src, dest, type_id, offset, message_data, message_length);
|
auto telegram = std::make_shared<Telegram>(operation, src, dest, type_id, offset, message_data, message_length);
|
||||||
|
|
||||||
// check if queue is full, if so remove top item to make space
|
// check if queue is full, if so remove top item to make space
|
||||||
if (rx_telegrams_.size() >= MAX_RX_TELEGRAMS) {
|
if (rx_telegrams_.size() >= MAX_RX_TELEGRAMS) {
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ class Telegram {
|
|||||||
enum Operation : uint8_t {
|
enum Operation : uint8_t {
|
||||||
NONE = 0,
|
NONE = 0,
|
||||||
RX,
|
RX,
|
||||||
|
RX_READ,
|
||||||
TX_RAW,
|
TX_RAW,
|
||||||
TX_READ,
|
TX_READ,
|
||||||
TX_WRITE,
|
TX_WRITE,
|
||||||
|
|||||||
Reference in New Issue
Block a user