mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-03-14 05:36:34 +03:00
Merge branch 'dev' into core3
This commit is contained in:
@@ -8,10 +8,11 @@ For more details go to [emsesp.org](https://emsesp.org/).
|
|||||||
|
|
||||||
- comfortpoint for BC400 [#2935](https://github.com/emsesp/EMS-ESP32/issues/2935)
|
- comfortpoint for BC400 [#2935](https://github.com/emsesp/EMS-ESP32/issues/2935)
|
||||||
- customize device brand [#2784](https://github.com/emsesp/EMS-ESP32/issues/2784)
|
- customize device brand [#2784](https://github.com/emsesp/EMS-ESP32/issues/2784)
|
||||||
|
- set model for ems-esp devices temperature, analog, etc. [#2958](https://github.com/emsesp/EMS-ESP32/discussions/2958)
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
- SRC climate creation [#2936](https://github.com/emsesp/EMS-ESP32/issues/2936)
|
- SRC climate creation [#2936](https://github.com/emsesp/EMS-ESP32/issues/2936) and [#2960](https://github.com/emsesp/EMS-ESP32/issues/2960)
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
|
|
||||||
|
|||||||
@@ -2135,7 +2135,7 @@ void EMSdevice::mqtt_ha_entity_config_create() {
|
|||||||
|
|
||||||
if (needs_update) {
|
if (needs_update) {
|
||||||
const char * const ** mode_options = nullptr;
|
const char * const ** mode_options = nullptr;
|
||||||
for (auto & d : devicevalues_) {
|
for (const auto & d : devicevalues_) {
|
||||||
// make sure mode in same circuit is DeviceValueType::ENUM
|
// make sure mode in same circuit is DeviceValueType::ENUM
|
||||||
if ((d.tag == dv.tag) && (d.type == DeviceValueType::ENUM) && !strcmp(d.short_name, FL_(mode)[0]) && (d.options_size > 0)) {
|
if ((d.tag == dv.tag) && (d.type == DeviceValueType::ENUM) && !strcmp(d.short_name, FL_(mode)[0]) && (d.options_size > 0)) {
|
||||||
// get options
|
// get options
|
||||||
@@ -2167,19 +2167,25 @@ void EMSdevice::mqtt_ha_entity_config_create() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// SRC thermostats mapped to connect/src1/... always contains mode, seltemp, currtemp
|
// SRC thermostats mapped to connect/src1/... always contains mode, seltemp, currtemp
|
||||||
if (dv.tag >= DeviceValueTAG::TAG_SRC1 && dv.tag <= DeviceValueTAG::TAG_SRC16 && !strcmp(dv.short_name, FL_(mode)[0])) {
|
if (dv.tag >= DeviceValueTAG::TAG_SRC1 && dv.tag <= DeviceValueTAG::TAG_SRC16 && !strcmp(dv.short_name, FL_(seltemp)[0])) {
|
||||||
// add icon if we have one
|
// add modes and icon if we have one
|
||||||
const char * icon = nullptr;
|
const char * icon = nullptr;
|
||||||
for (auto & d : devicevalues_) {
|
const char * const ** mode_options = nullptr;
|
||||||
if (d.tag == dv.tag && !strcmp(d.short_name, FL_(icon)[0]) && (dv.type == DeviceValueType::ENUM)) {
|
for (const auto & d : devicevalues_) {
|
||||||
|
if ((d.tag != dv.tag) || (d.type != DeviceValueType::ENUM)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!strcmp(d.short_name, FL_(mode)[0]) && (d.options_size > 0)) {
|
||||||
|
mode_options = d.options;
|
||||||
|
}
|
||||||
|
if (!strcmp(d.short_name, FL_(icon)[0])) {
|
||||||
uint8_t val = *(uint8_t *)(d.value_p);
|
uint8_t val = *(uint8_t *)(d.value_p);
|
||||||
if (val != 0 && val < d.options_size) {
|
if (val != 0 && val < d.options_size) {
|
||||||
icon = d.options[val][0];
|
icon = d.options[val][0];
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Mqtt::publish_ha_climate_config(dv, true, dv.options, false, icon);
|
Mqtt::publish_ha_climate_config(dv, true, mode_options, false, icon);
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1545,9 +1545,7 @@ void Mqtt::add_ha_dev_section(JsonObject doc, const char * name, const bool crea
|
|||||||
|
|
||||||
// add mf (manufacturer/brand), mdl (model), sw (software version) and via_device
|
// add mf (manufacturer/brand), mdl (model), sw (software version) and via_device
|
||||||
dev_json["mf"] = brand != nullptr ? brand : "EMS-ESP";
|
dev_json["mf"] = brand != nullptr ? brand : "EMS-ESP";
|
||||||
if (model != nullptr) {
|
dev_json["mdl"] = model != nullptr ? model : "EMS-ESP";
|
||||||
dev_json["mdl"] = model;
|
|
||||||
}
|
|
||||||
dev_json["sw"] = version != nullptr ? version : "v" + std::string(EMSESP_APP_VERSION);
|
dev_json["sw"] = version != nullptr ? version : "v" + std::string(EMSESP_APP_VERSION);
|
||||||
dev_json["via_device"] = Mqtt::basename();
|
dev_json["via_device"] = Mqtt::basename();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,9 +129,13 @@ void Connect::process_roomThermostat(std::shared_ptr<const Telegram> telegram) {
|
|||||||
}
|
}
|
||||||
has_update(telegram, rc->temp_, 0);
|
has_update(telegram, rc->temp_, 0);
|
||||||
has_update(telegram, rc->humidity_, 2); // could show -3 if not set
|
has_update(telegram, rc->humidity_, 2); // could show -3 if not set
|
||||||
|
// make sure we have read mode and icon, needed for ha climate
|
||||||
|
if (!Mqtt::ha_enabled() || (Helpers::hasValue(rc->mode_) && Helpers::hasValue(rc->icon_))) {
|
||||||
has_update(telegram, rc->seltemp_, 3);
|
has_update(telegram, rc->seltemp_, 3);
|
||||||
|
}
|
||||||
|
|
||||||
// calculate dew temperature
|
// calculate dew temperature
|
||||||
|
if (rc->humidity_ >= 0 && rc->humidity_ <= 100) {
|
||||||
const float k2 = 17.62;
|
const float k2 = 17.62;
|
||||||
const float k3 = 243.12;
|
const float k3 = 243.12;
|
||||||
const float t = (float)rc->temp_ / 10;
|
const float t = (float)rc->temp_ / 10;
|
||||||
@@ -139,6 +143,7 @@ void Connect::process_roomThermostat(std::shared_ptr<const Telegram> telegram) {
|
|||||||
int16_t dt = (10 * k3 * (((k2 * t) / (k3 + t)) + log(h)) / (((k2 * k3) / (k3 + t)) - log(h)));
|
int16_t dt = (10 * k3 * (((k2 * t) / (k3 + t)) + log(h)) / (((k2 * k3) / (k3 + t)) - log(h)));
|
||||||
has_update(rc->dewtemp_, dt);
|
has_update(rc->dewtemp_, dt);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// gateway(0x48) W gateway(0x50), ?(0x0B42), data: 01 // icon in offset 0
|
// gateway(0x48) W gateway(0x50), ?(0x0B42), data: 01 // icon in offset 0
|
||||||
// gateway(0x48) W gateway(0x50), ?(0x0B42), data: 00 4B 00 FC 00 63 00 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (offset 1)
|
// gateway(0x48) W gateway(0x50), ?(0x0B42), data: 00 4B 00 FC 00 63 00 68 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 (offset 1)
|
||||||
@@ -221,8 +226,9 @@ bool Connect::set_seltemp(const char * value, const int8_t id) {
|
|||||||
}
|
}
|
||||||
float v;
|
float v;
|
||||||
if (Helpers::value2float(value, v)) {
|
if (Helpers::value2float(value, v)) {
|
||||||
// write_command(0xBB5 + rc->room(), rc->mode_ == 2 ? 1 : 3, v == -1 ? 0xFF : uint8_t(v * 2));
|
// depends on mode, auto (2 for enum_mode2, 0 for enum_mode8) set in offset 1
|
||||||
write_command(0xBB5 + rc->room(), rc->mode_ == 0 ? 1 : 3, v == -1 ? 0xFF : uint8_t(v * 2));
|
write_command(0xBB5 + rc->room(), rc->mode_ == 2 ? 1 : 3, v == -1 ? 0xFF : uint8_t(v * 2));
|
||||||
|
// write_command(0xBB5 + rc->room(), rc->mode_ == 0 ? 1 : 3, v == -1 ? 0xFF : uint8_t(v * 2));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
#define EMSESP_APP_VERSION "3.8.2-dev.5"
|
#define EMSESP_APP_VERSION "3.8.2-dev.6"
|
||||||
|
|||||||
Reference in New Issue
Block a user