Skip to content

Commit

Permalink
Merge pull request emsesp#2338 from MichaelDvP/dev
Browse files Browse the repository at this point in the history
small fixes and additions
  • Loading branch information
proddy authored Jan 9, 2025
2 parents b3be1d9 + df9d20a commit 8fa800e
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion interface/src/app/main/deviceValue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function formatValue(
}
return (
(value as string) +
(uom === undefined || uom === 0 ? '' : ' ' + DeviceValueUOM_s[uom])
(value === '' || uom === undefined || uom === 0 ? '' : ' ' + DeviceValueUOM_s[uom])
);
}

Expand Down
2 changes: 1 addition & 1 deletion interface/src/app/status/SystemLog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const SystemLog = () => {
immediate: true,
interceptByGlobalResponded: false
})
.onMessage((message: { id: number; data: string }) => {
.onMessage((message: { data: string }) => {
const rawData = message.data;
const logentry = JSON.parse(rawData) as LogEntry;
setLogEntries((log) => [...log, logentry]);
Expand Down
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ build_flags =
-D CONFIG_ASYNC_TCP_RUNNING_CORE=1 ; force async_tcp task to be on same core as Arduino app (default is any core)
-D CONFIG_ASYNC_TCP_STACK_SIZE=6144 ; stack usage measured: ESP32: ~2.3K, ESP32S3: ~3.5k - (default is 16K)
; ESPAsyncWebServer
-D WS_MAX_QUEUED_MESSAGES=64
-D WS_MAX_QUEUED_MESSAGES=0 ; log messages are already queued in ems-esp
-D CORE_DEBUG_LEVEL=0

unbuild_flags =
Expand Down
2 changes: 2 additions & 0 deletions src/core/locale_translations.h
Original file line number Diff line number Diff line change
Expand Up @@ -764,6 +764,8 @@ MAKE_TRANSLATION(vacations7, "vacations7", "vacation dates 7", "Urlaubstage 7",
MAKE_TRANSLATION(vacations8, "vacations8", "vacation dates 8", "Urlaubstage 8", "Vakantiedagen 8", "Semesterdatum 8", "urlop 8", "feriedager 8", "dates vacances 8", "izin günleri 8", "date vacanze 8", "termíny dovolenky 8", "data prázdnin 8")
MAKE_TRANSLATION(absent, "absent", "absent", "Abwesend", "", "Frånvarande", "", "", "", "", "", "chýnajúci", "") // TODO translate
MAKE_TRANSLATION(redthreshold, "redthreshold", "reduction threshold", "Absenkschwelle", "", "Tröskel för sänkning", "", "", "", "", "", "zníženie tresholdu", "") // TODO translate
MAKE_TRANSLATION(solarinfl, "solarinfl", "solar influence", "Solareinfluß", "", "", "", "", "", "", "", "", "") // TODO translate
MAKE_TRANSLATION(currsolarinfl, "currsolarinfl", "curent solar influence", "akt. Solareinfluß", "", "", "", "", "", "", "", "", "") // TODO translate

MAKE_TRANSLATION(hpmode, "hpmode", "HP Mode", "WP-Modus", "Modus warmtepomp", "Värmepumpsläge", "tryb pracy pompy ciepła", "", "", "yüksek güç modu", "Modalità Termopompa", "Režim TČ", "režim tepelného čerpadla") // TODO translate
MAKE_TRANSLATION(dewoffset, "dewoffset", "dew point offset", "Taupunktdifferenz", "Offset dauwpunt", "Daggpunktsförskjutning", "przesunięcie punktu rosy", "", "", "çiğ noktası göreli", "differenza del punto di rugiada", "posun rosného bodu", "offset rosného bodu") // TODO translate
Expand Down
16 changes: 16 additions & 0 deletions src/devices/thermostat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,6 +1112,7 @@ void Thermostat::process_RC300Monitor(std::shared_ptr<const Telegram> telegram)
}
has_update(telegram, hc->targetflowtemp, 4);
has_update(telegram, hc->curroominfl, 27);
has_update(telegram, hc->currSolarInfl, 29);
has_update(telegram, hc->coolingon, 32);

add_ha_climate(hc);
Expand Down Expand Up @@ -1179,6 +1180,7 @@ void Thermostat::process_RC300Summer(std::shared_ptr<const Telegram> telegram) {
has_update(telegram, hc->roominfluence, 0);
has_update(telegram, hc->roominfl_factor, 1); // is * 10
has_update(telegram, hc->offsettemp, 2);
has_update(telegram, hc->solarInfl, 3);
if (!is_received(summer2_typeids[hc->hc()])) {
has_update(telegram, hc->summertemp, 6);
has_update(telegram, hc->summersetmode, 7);
Expand Down Expand Up @@ -2779,6 +2781,18 @@ bool Thermostat::set_redthreshold(const char * value, const int8_t id) {
return false;
}

bool Thermostat::set_solarinfl(const char * value, const int8_t id) {
auto hc = heating_circuit(id);
if (hc == nullptr) {
return false;
}
float t;
if (Helpers::value2temperature(value, t)) {
write_command(summer_typeids[hc->hc()], 3, (int8_t)t, summer_typeids[hc->hc()]);
return true;
}
return false;
}

// set date&time as string dd.mm.yyyy-hh:mm:ss-dw-dst or "NTP" for setting to internet-time
// dw - day of week (0..6), dst- summertime (0/1)
Expand Down Expand Up @@ -4710,6 +4724,8 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
MAKE_CF_CB(set_redthreshold),
12,
22);
register_device_value(tag, &hc->solarInfl, DeviceValueType::UINT8, FL_(solarinfl), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_solarinfl), -5, -1);
register_device_value(tag, &hc->currSolarInfl, DeviceValueType::UINT8, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(currsolarinfl), DeviceValueUOM::DEGREES);
break;
case EMSdevice::EMS_DEVICE_FLAG_CRF:
register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode5), FL_(mode), DeviceValueUOM::NONE);
Expand Down
3 changes: 3 additions & 0 deletions src/devices/thermostat.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ class Thermostat : public EMSdevice {
uint8_t instantstart; // 1-10K
uint8_t boost;
uint8_t boosttime; // hours
int8_t currSolarInfl;
int8_t solarInfl;

uint8_t hc_num() const {
return hc_num_;
Expand Down Expand Up @@ -664,6 +666,7 @@ class Thermostat : public EMSdevice {
bool set_switchProgMode(const char * value, const int8_t id);
bool set_absent(const char * value, const int8_t id);
bool set_redthreshold(const char * value, const int8_t id);
bool set_solarinfl(const char * value, const int8_t id);
};

} // namespace emsesp
Expand Down

0 comments on commit 8fa800e

Please sign in to comment.