mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-10 09:49:54 +03:00
Merge branch 'dev' into dev2
This commit is contained in:
@@ -1149,8 +1149,8 @@ void Boiler::process_UBAFactory(std::shared_ptr<const Telegram> telegram) {
|
||||
void Boiler::process_UBAMonitorFast(std::shared_ptr<const Telegram> telegram) {
|
||||
has_update(telegram, selFlowTemp_, 0);
|
||||
has_update(telegram, curFlowTemp_, 1);
|
||||
has_update(telegram, selBurnPow_, 3); // burn power max setting
|
||||
has_update(telegram, curBurnPow_, 4);
|
||||
// has_update(telegram, selBurnPow_, 3); // burn power max setting
|
||||
// has_update(telegram, curBurnPow_, 4);
|
||||
has_update(telegram, boilerState_, 5); // bits 0-heat, 1-dhw, 2-service, 3-flame, 4-preheat, 5-lock-Err, 6-block-err, 7-maint
|
||||
has_bitupdate(telegram, burnGas_, 7, 0);
|
||||
has_bitupdate(telegram, burnGas2_, 7, 1);
|
||||
@@ -1184,10 +1184,20 @@ void Boiler::process_UBAMonitorFast(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
has_update(telegram, serviceCodeNumber_, 20);
|
||||
|
||||
if (telegram->offset <= 4 && telegram->offset + telegram->message_length > 7) {
|
||||
if (burnGas_ || burnGas2_) {
|
||||
if (telegram->offset <= 3 && telegram->offset + telegram->message_length > 7) {
|
||||
// some boiler only switch burnGas and have no other burner values, https://github.com/emsesp/EMS-ESP32/discussions/1483
|
||||
uint8_t selBurnPow = selBurnPow_;
|
||||
uint8_t curBurnPow = curBurnPow_;
|
||||
telegram->read_value(selBurnPow, 3);
|
||||
telegram->read_value(curBurnPow, 4);
|
||||
if (burnGas_ && selBurnPow == 0 && curBurnPow == 0) {
|
||||
boilerState_ |= 0x08; // set flame signal
|
||||
curBurnPow = 100;
|
||||
selBurnPow = 100;
|
||||
}
|
||||
has_update(selBurnPow_, selBurnPow);
|
||||
has_update(curBurnPow_, curBurnPow);
|
||||
|
||||
check_active(); // do a quick check to see if the hot water or heating is active
|
||||
}
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ Heatpump::Heatpump(uint8_t device_type, uint8_t device_id, uint8_t product_id, c
|
||||
register_device_value(DeviceValueTAG::TAG_DEVICE_DATA,
|
||||
&hybridDHW_,
|
||||
DeviceValueType::ENUM,
|
||||
FL_(enum_comfort2),
|
||||
FL_(enum_comfort1),
|
||||
FL_(hybridDHW),
|
||||
DeviceValueUOM::NONE,
|
||||
MAKE_CF_CB(set_hybridDHW));
|
||||
@@ -332,7 +332,7 @@ bool Heatpump::set_lowNoiseStop(const char * value, const int8_t id) {
|
||||
}
|
||||
bool Heatpump::set_hybridDHW(const char * value, const int8_t id) {
|
||||
uint8_t v;
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_comfort2))) {
|
||||
if (!Helpers::value2enum(value, v, FL_(enum_comfort1))) {
|
||||
return false;
|
||||
}
|
||||
write_command(0x998, 1, v, 0x998);
|
||||
|
||||
@@ -718,6 +718,15 @@ void Thermostat::process_RemoteHumidity(std::shared_ptr<const Telegram> telegram
|
||||
// has_update(telegram, dewtemperature_, 0); // this is int8
|
||||
has_update(telegram, humidity_, 1);
|
||||
has_update(telegram, dewtemperature_, 2); // this is int16
|
||||
// some thermostats use short telegram with int8 dewpoint, https://github.com/emsesp/EMS-ESP32/issues/1491
|
||||
if (telegram->offset == 0 && telegram->message_length < 4) {
|
||||
int8_t dew = dewtemperature_ / 10;
|
||||
telegram->read_value(dew, 0);
|
||||
if (dew != EMS_VALUE_INT_NOTSET && dewtemperature_ != dew * 10) {
|
||||
dewtemperature_ = dew * 10;
|
||||
has_update(dewtemperature_);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 0x273 - for reading temperaturcorrection from the RC100H remote thermostat (0x38, 0x39, ..)
|
||||
|
||||
@@ -279,8 +279,8 @@ MAKE_ENUM(enum_charge, FL_(chargepump), FL_(3wayvalve))
|
||||
MAKE_ENUM(enum_freq, FL_(off), FL_(1x3min), FL_(2x3min), FL_(3x3min), FL_(4x3min), FL_(5x3min), FL_(6x3min), FL_(continuous))
|
||||
MAKE_ENUM(enum_off_time_date_manual, FL_(off), FL_(time), FL_(date), FL_(manual))
|
||||
MAKE_ENUM(enum_comfort, FL_(hot), FL_(eco), FL_(intelligent))
|
||||
MAKE_ENUM(enum_comfort1, FL_(high_comfort), FL_(eco))
|
||||
MAKE_ENUM(enum_comfort2, FL_(eco), FL_(high_comfort))
|
||||
// MAKE_ENUM(enum_comfort1, FL_(high_comfort), FL_(eco))
|
||||
MAKE_ENUM(enum_comfort1, FL_(eco), FL_(high_comfort))
|
||||
MAKE_ENUM(enum_flow, FL_(off), FL_(flow), FL_(bufferedflow), FL_(buffer), FL_(layeredbuffer))
|
||||
MAKE_ENUM(enum_reset, FL_(dash), FL_(maintenance), FL_(error))
|
||||
MAKE_ENUM(enum_maxHeat, FL_(0kW), FL_(2kW), FL_(3kW), FL_(4kW), FL_(6kW), FL_(9kW))
|
||||
|
||||
@@ -218,7 +218,7 @@ void Mqtt::incoming(const char * topic, const char * payload) {
|
||||
// received an MQTT message that we subscribed too
|
||||
// topic is the full path
|
||||
// payload is json or a single string and converted to a json with key 'value'
|
||||
void Mqtt::on_message(const char * topic, const uint8_t * payload, size_t len) const {
|
||||
void Mqtt::on_message(const char * topic, const uint8_t * payload, size_t len) {
|
||||
// the payload is not terminated
|
||||
// convert payload to a null-terminated char string
|
||||
// see https://www.emelis.net/espMqttClient/#code-samples
|
||||
@@ -397,11 +397,6 @@ void Mqtt::start() {
|
||||
}
|
||||
|
||||
EMSESP::esp8266React.setWill(will_topic); // with qos 1, retain true
|
||||
|
||||
EMSESP::esp8266React.onMessage(
|
||||
[this](const espMqttClientTypes::MessageProperties & properties, const char * topic, const uint8_t * payload, size_t len, size_t index, size_t total) {
|
||||
on_message(topic, payload, len); // receiving mqtt
|
||||
});
|
||||
}
|
||||
|
||||
void Mqtt::set_publish_time_boiler(uint16_t publish_time) {
|
||||
|
||||
@@ -61,6 +61,7 @@ class Mqtt {
|
||||
|
||||
static void on_connect();
|
||||
static void on_disconnect(espMqttClientTypes::DisconnectReason reason);
|
||||
static void on_message(const char * topic, const uint8_t * payload, size_t len);
|
||||
static void subscribe(const uint8_t device_type, const std::string & topic, mqtt_sub_function_p cb);
|
||||
static void subscribe(const std::string & topic);
|
||||
static void resubscribe();
|
||||
@@ -232,7 +233,6 @@ class Mqtt {
|
||||
static void queue_unsubscribe_message(const std::string & topic);
|
||||
|
||||
void on_publish(uint16_t packetId) const;
|
||||
void on_message(const char * topic, const uint8_t * payload, size_t len) const;
|
||||
|
||||
// function handlers for MQTT subscriptions
|
||||
struct MQTTSubFunction {
|
||||
|
||||
Reference in New Issue
Block a user