Skip to content

Commit

Permalink
Merge pull request emsesp#1499 from MichaelDvP/dev
Browse files Browse the repository at this point in the history
latest entities
  • Loading branch information
proddy authored Dec 13, 2023
2 parents ac288b7 + ee58437 commit 68cb945
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 9 deletions.
1 change: 1 addition & 0 deletions src/console.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ static void setup_commands(std::shared_ptr<Commands> & commands) {
return StateUpdateResult::CHANGED;
},
"local");
to_app(shell).uart_init();
});

//
Expand Down
25 changes: 20 additions & 5 deletions src/devices/boiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -1184,7 +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 > 5) {
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
}
}
Expand Down Expand Up @@ -1309,7 +1322,7 @@ void Boiler::process_UBAMonitorFastPlus(std::shared_ptr<const Telegram> telegram
uint8_t syspress = sysPress_;
telegram->read_value(syspress, 21); // 0 means no sensor
if (syspress == 0) {
sysPress_ = EMS_VALUE_UINT_NOTSET;
syspress = EMS_VALUE_UINT_NOTSET;
}
has_update(sysPress_, syspress);

Expand Down Expand Up @@ -1475,7 +1488,9 @@ void Boiler::process_UBAMonitorWWPlus(std::shared_ptr<const Telegram> telegram)
has_update(telegram, wwSetTemp_, 0);
has_update(telegram, wwCurTemp_, 1);
has_update(telegram, wwCurTemp2_, 3);
has_update(telegram, wwCurFlow_, 11);
if (!is_received(0x779)) { // HIUMonitor
has_update(telegram, wwCurFlow_, 11);
}

has_update(telegram, wwWorkM_, 14, 3); // force to 3 bytes
has_update(telegram, wwStarts_, 17, 3); // force to 3 bytes
Expand Down
4 changes: 2 additions & 2 deletions src/devices/heatpump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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);
Expand Down
9 changes: 9 additions & 0 deletions src/devices/thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,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, ..)
Expand Down
1 change: 1 addition & 0 deletions src/emsesp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ void EMSESP::uart_init() {
}

txservice_.start(); // sends out request to EMS bus for all devices
txservice_.tx_mode(tx_mode);

// force a fetch for all new values, unless Tx is set to off
if (tx_mode != 0) {
Expand Down
4 changes: 2 additions & 2 deletions src/locale_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -277,8 +277,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))
Expand Down

0 comments on commit 68cb945

Please sign in to comment.