mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
Merge branch 'dev' of https://github.com/emsesp/EMS-ESP32 into dev
This commit is contained in:
@@ -68,7 +68,7 @@ std::string EMSdevice::uom_to_string(uint8_t uom) {
|
||||
}
|
||||
}
|
||||
|
||||
std::string EMSdevice::brand_to_string() const {
|
||||
const std::string EMSdevice::brand_to_string() {
|
||||
switch (brand_) {
|
||||
case EMSdevice::Brand::BOSCH:
|
||||
return "Bosch";
|
||||
@@ -89,7 +89,7 @@ std::string EMSdevice::brand_to_string() const {
|
||||
}
|
||||
}
|
||||
|
||||
// returns the name of the MQTT topic to use for a specific device, without the base
|
||||
// returns the short name of the device, used in MQTT and console commands, all lowercase
|
||||
const char * EMSdevice::device_type_2_device_name(const uint8_t device_type) {
|
||||
switch (device_type) {
|
||||
case DeviceType::SYSTEM:
|
||||
@@ -127,7 +127,41 @@ const char * EMSdevice::device_type_2_device_name(const uint8_t device_type) {
|
||||
}
|
||||
}
|
||||
|
||||
// returns device_type from a string
|
||||
// returns the translated name of a specific EMS device
|
||||
// excludes dallassensor, analogsensor and system
|
||||
const char * EMSdevice::device_type_2_device_name_translated() {
|
||||
switch (device_type_) {
|
||||
case DeviceType::BOILER:
|
||||
return Helpers::translated_word(FL_(boiler_device));
|
||||
case DeviceType::THERMOSTAT:
|
||||
return Helpers::translated_word(FL_(thermostat_device));
|
||||
case DeviceType::HEATPUMP:
|
||||
return Helpers::translated_word(FL_(heatpump_device));
|
||||
case DeviceType::SOLAR:
|
||||
return Helpers::translated_word(FL_(solar_device));
|
||||
case DeviceType::CONNECT:
|
||||
return Helpers::translated_word(FL_(connect_device));
|
||||
case DeviceType::MIXER:
|
||||
return Helpers::translated_word(FL_(mixer_device));
|
||||
case DeviceType::CONTROLLER:
|
||||
return Helpers::translated_word(FL_(controller_device));
|
||||
case DeviceType::SWITCH:
|
||||
return Helpers::translated_word(FL_(switch_device));
|
||||
case DeviceType::GATEWAY:
|
||||
return Helpers::translated_word(FL_(gateway_device));
|
||||
case DeviceType::ALERT:
|
||||
return Helpers::translated_word(FL_(alert_device));
|
||||
case DeviceType::PUMP:
|
||||
return Helpers::translated_word(FL_(pump_device));
|
||||
case DeviceType::HEATSOURCE:
|
||||
return Helpers::translated_word(FL_(heatsource_device));
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return Helpers::translated_word(FL_(unknown));
|
||||
}
|
||||
|
||||
// returns device_type from a non-translated EN string
|
||||
uint8_t EMSdevice::device_name_2_device_type(const char * topic) {
|
||||
if (!topic) {
|
||||
return DeviceType::UNKNOWN;
|
||||
@@ -183,11 +217,9 @@ uint8_t EMSdevice::device_name_2_device_type(const char * topic) {
|
||||
return DeviceType::UNKNOWN;
|
||||
}
|
||||
|
||||
// return name of the device type, capitalized
|
||||
std::string EMSdevice::device_type_name() const {
|
||||
std::string s = device_type_2_device_name(device_type_);
|
||||
s[0] = toupper(s[0]);
|
||||
return s;
|
||||
// return name of the device type, not translated
|
||||
const char * EMSdevice::device_type_name() {
|
||||
return device_type_2_device_name(device_type_);
|
||||
}
|
||||
|
||||
// 0=unknown, 1=bosch, 2=junkers, 3=buderus, 4=nefit, 5=sieger, 11=worcester
|
||||
@@ -213,7 +245,7 @@ uint8_t EMSdevice::decode_brand(uint8_t value) {
|
||||
}
|
||||
|
||||
// returns string of a human friendly description of the EMS device
|
||||
std::string EMSdevice::to_string() const {
|
||||
const std::string EMSdevice::to_string() {
|
||||
// for devices that haven't been lookup yet, don't show all details
|
||||
if (product_id_ == 0) {
|
||||
return std::string(name_) + " (DeviceID:" + Helpers::hextoa(device_id_) + ")";
|
||||
@@ -228,12 +260,13 @@ std::string EMSdevice::to_string() const {
|
||||
}
|
||||
|
||||
// returns out brand + device name
|
||||
std::string EMSdevice::to_string_short() const {
|
||||
// translated
|
||||
const std::string EMSdevice::to_string_short() {
|
||||
if (brand_ == Brand::NO_BRAND) {
|
||||
return device_type_name() + ": " + name_;
|
||||
return std::string(device_type_2_device_name_translated()) + ": " + name_;
|
||||
}
|
||||
|
||||
return device_type_name() + ": " + brand_to_string() + " " + name_;
|
||||
return std::string(device_type_2_device_name_translated()) + ": " + brand_to_string() + " " + name_;
|
||||
}
|
||||
|
||||
// for each telegram that has the fetch value set (true) do a read request
|
||||
|
||||
@@ -31,7 +31,7 @@ class EMSdevice {
|
||||
public:
|
||||
virtual ~EMSdevice() = default; // destructor of base class must always be virtual because it's a polymorphic class
|
||||
|
||||
static constexpr uint8_t EMS_DEVICES_MAX_TELEGRAMS = 20;
|
||||
using process_function_p = std::function<void(std::shared_ptr<const Telegram>)>;
|
||||
|
||||
// device_type defines which derived class to use, e.g. BOILER, THERMOSTAT etc..
|
||||
EMSdevice(uint8_t device_type, uint8_t device_id, uint8_t product_id, const char * version, const char * name, uint8_t flags, uint8_t brand)
|
||||
@@ -44,13 +44,16 @@ class EMSdevice {
|
||||
strlcpy(version_, version, sizeof(version_));
|
||||
}
|
||||
|
||||
std::string device_type_name() const;
|
||||
|
||||
// static functions, used outside the class like in console.cpp, command.cpp, emsesp.cpp, mqtt.cpp
|
||||
static const char * device_type_2_device_name(const uint8_t device_type);
|
||||
static uint8_t device_name_2_device_type(const char * topic);
|
||||
static std::string uom_to_string(uint8_t uom);
|
||||
static std::string tag_to_string(uint8_t tag, const bool translate = true);
|
||||
static std::string tag_to_mqtt(uint8_t tag);
|
||||
static uint8_t decode_brand(uint8_t value);
|
||||
|
||||
const char * device_type_name(); // returns short non-translated device type name
|
||||
const char * device_type_2_device_name_translated(); // returns translated device type name
|
||||
|
||||
bool has_tag(const uint8_t tag) const;
|
||||
bool has_cmd(const char * cmd, const int8_t id) const;
|
||||
@@ -113,7 +116,6 @@ class EMSdevice {
|
||||
return name_;
|
||||
}
|
||||
|
||||
// unique id of a device
|
||||
inline uint8_t unique_id() const {
|
||||
return unique_id_;
|
||||
}
|
||||
@@ -174,11 +176,9 @@ class EMSdevice {
|
||||
}
|
||||
}
|
||||
|
||||
std::string brand_to_string() const;
|
||||
static uint8_t decode_brand(uint8_t value);
|
||||
|
||||
std::string to_string() const;
|
||||
std::string to_string_short() const;
|
||||
const std::string brand_to_string();
|
||||
const std::string to_string();
|
||||
const std::string to_string_short();
|
||||
|
||||
enum Handlers : uint8_t { ALL, RECEIVED, FETCHED, PENDING, IGNORED };
|
||||
|
||||
@@ -192,8 +192,6 @@ class EMSdevice {
|
||||
void setCustomEntity(const std::string & entity_id);
|
||||
void getCustomEntities(std::vector<std::string> & entity_ids);
|
||||
|
||||
using process_function_p = std::function<void(std::shared_ptr<const Telegram>)>;
|
||||
|
||||
void register_telegram_type(const uint16_t telegram_type_id, const char * telegram_type_name, bool fetch, const process_function_p cb);
|
||||
bool handle_telegram(std::shared_ptr<const Telegram> telegram);
|
||||
|
||||
@@ -201,10 +199,6 @@ class EMSdevice {
|
||||
bool get_value_info(JsonObject & root, const char * cmd, const int8_t id);
|
||||
void get_dv_info(JsonObject & json);
|
||||
|
||||
#if defined(EMSESP_STANDALONE_DUMP)
|
||||
void dump_value_info();
|
||||
#endif
|
||||
|
||||
enum OUTPUT_TARGET : uint8_t { API_VERBOSE, API_SHORTNAMES, MQTT, CONSOLE };
|
||||
bool generate_values(JsonObject & output, const uint8_t tag_filter, const bool nested, const uint8_t output_target);
|
||||
void generate_values_web(JsonObject & output);
|
||||
@@ -350,6 +344,8 @@ class EMSdevice {
|
||||
UNKNOWN
|
||||
};
|
||||
|
||||
static constexpr uint8_t EMS_DEVICES_MAX_TELEGRAMS = 20;
|
||||
|
||||
// static device IDs
|
||||
static constexpr uint8_t EMS_DEVICE_ID_BOILER = 0x08; // fixed device_id for Master Boiler/UBA
|
||||
static constexpr uint8_t EMS_DEVICE_ID_HS1 = 0x70; // fixed device_id for 1st. Cascade Boiler/UBA
|
||||
@@ -369,7 +365,7 @@ class EMSdevice {
|
||||
static constexpr uint8_t EMS_DEVICE_ID_MODEM = 0x48;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_RFSENSOR = 0x40; // RF sensor only sending, no reply
|
||||
static constexpr uint8_t EMS_DEVICE_ID_RFBASE = 0x50;
|
||||
static constexpr uint8_t EMS_DEVICE_ID_ROOMTHERMOSTAT = 0x17; //TADO using this with no version reply
|
||||
static constexpr uint8_t EMS_DEVICE_ID_ROOMTHERMOSTAT = 0x17; // TADO using this with no version reply
|
||||
|
||||
// generic type IDs
|
||||
static constexpr uint16_t EMS_TYPE_VERSION = 0x02; // type ID for Version information. Generic across all EMS devices.
|
||||
@@ -419,6 +415,10 @@ class EMSdevice {
|
||||
uint8_t count_entities();
|
||||
bool has_entities() const;
|
||||
|
||||
#if defined(EMSESP_STANDALONE_DUMP)
|
||||
void dump_value_info();
|
||||
#endif
|
||||
|
||||
private:
|
||||
uint8_t unique_id_;
|
||||
uint8_t device_type_ = DeviceType::SYSTEM;
|
||||
|
||||
@@ -355,8 +355,8 @@ void EMSESP::show_device_values(uuid::console::Shell & shell) {
|
||||
for (const auto & device_class : EMSFactory::device_handlers()) {
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_class.first)) {
|
||||
// print header
|
||||
shell.printfln("%s: %s (%d)", emsdevice->device_type_name().c_str(), emsdevice->to_string().c_str(), emsdevice->count_entities());
|
||||
// print header, with device type translated
|
||||
shell.printfln("%s: %s (%d)", emsdevice->device_type_2_device_name_translated(), emsdevice->to_string().c_str(), emsdevice->count_entities());
|
||||
|
||||
DynamicJsonDocument doc(EMSESP_JSON_SIZE_XXLARGE_DYN); // use max size
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
@@ -829,7 +829,7 @@ void EMSESP::process_version(std::shared_ptr<const Telegram> telegram) {
|
||||
|
||||
// find the device object that matches the deviceID and see if it has a matching telegram type handler
|
||||
// but only process if the telegram is sent to us or it's a broadcast (dest=0x00=all)
|
||||
// We also check for common telgram types, like the Version(0x02)
|
||||
// We also check for common telegram types, like the Version(0x02)
|
||||
// returns false if there are none found
|
||||
bool EMSESP::process_telegram(std::shared_ptr<const Telegram> telegram) {
|
||||
// if watching or reading...
|
||||
@@ -950,12 +950,13 @@ void EMSESP::show_devices(uuid::console::Shell & shell) {
|
||||
}
|
||||
}
|
||||
|
||||
// for all device objects from emsdevice.h (UNKNOWN, SYSTEM, BOILER, THERMOSTAT, MIXER, SOLAR, HEATPUMP, GATEWAY, SWITCH, CONTROLLER, CONNECT)
|
||||
// for all device objects from emsdevice.h
|
||||
// so we keep a consistent order
|
||||
// don't translate the device type name
|
||||
for (const auto & device_class : EMSFactory::device_handlers()) {
|
||||
for (const auto & emsdevice : emsdevices) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_class.first)) {
|
||||
shell.printf("%s: %s", emsdevice->device_type_name().c_str(), emsdevice->to_string().c_str());
|
||||
shell.printf("%s: %s", emsdevice->device_type_name(), emsdevice->to_string().c_str());
|
||||
shell.println();
|
||||
emsdevice->show_telegram_handlers(shell);
|
||||
|
||||
|
||||
@@ -718,7 +718,8 @@ uint8_t Helpers::count_items(const char * const ** list) {
|
||||
}
|
||||
|
||||
// returns char pointer to translated description or fullname
|
||||
const char * Helpers::translated_word(const char * const * strings) {
|
||||
// if force_en is true always take the EN non-translated word
|
||||
const char * Helpers::translated_word(const char * const * strings, const bool force_en) {
|
||||
uint8_t language_index = EMSESP::system_.language_index();
|
||||
uint8_t index = 0;
|
||||
|
||||
@@ -727,7 +728,7 @@ const char * Helpers::translated_word(const char * const * strings) {
|
||||
}
|
||||
|
||||
// see how many translations we have for this entity. if there is no translation for this, revert to EN
|
||||
if (Helpers::count_items(strings) >= language_index + 1 && strlen(strings[language_index])) {
|
||||
if (force_en || (Helpers::count_items(strings) >= language_index + 1 && strlen(strings[language_index]))) {
|
||||
index = language_index;
|
||||
}
|
||||
return strings[index];
|
||||
|
||||
@@ -77,7 +77,7 @@ class Helpers {
|
||||
static uint8_t count_items(const char * const ** list);
|
||||
static uint8_t count_items(const char * const * list);
|
||||
|
||||
static const char * translated_word(const char * const * strings);
|
||||
static const char * translated_word(const char * const * strings, const bool force_en = false);
|
||||
|
||||
#ifdef EMSESP_STANDALONE
|
||||
static char * ultostr(char * ptr, uint32_t value, const uint8_t base);
|
||||
|
||||
@@ -89,7 +89,7 @@ MAKE_PSTR_WORD(customizations)
|
||||
MAKE_PSTR_WORD(value)
|
||||
MAKE_PSTR_WORD(entities)
|
||||
|
||||
// devices
|
||||
// device types - lowercase, used in MQTT
|
||||
MAKE_PSTR_WORD(boiler)
|
||||
MAKE_PSTR_WORD(thermostat)
|
||||
MAKE_PSTR_WORD(switch)
|
||||
|
||||
@@ -32,6 +32,21 @@
|
||||
// translations are in order en, de, nl, sv, pl, no, fr, ....
|
||||
// if there is no translation, it will default to en
|
||||
|
||||
// device types, as display in Web and Console
|
||||
// TODO need completed translations
|
||||
MAKE_PSTR_LIST(boiler_device, "Boiler", "Kessel", "Boiler")
|
||||
MAKE_PSTR_LIST(thermostat_device, "Thermostat", "Thermostat", "Thermostaat")
|
||||
MAKE_PSTR_LIST(heatpump_device, "Heat Pump", "Wärmepumpe", "Warmtepomp")
|
||||
MAKE_PSTR_LIST(solar_device, "Solar Module", "Solarmodul", "Solar Module")
|
||||
MAKE_PSTR_LIST(connect_device, "Connect Module", "Verbindungsmodul", "Connect Module")
|
||||
MAKE_PSTR_LIST(mixer_device, "Mixer Module", "Mischermodul", "Mixer Module")
|
||||
MAKE_PSTR_LIST(controller_device, "Controller Module", "Kontrollmodul", "Controller Module")
|
||||
MAKE_PSTR_LIST(switch_device, "Switch Module","Schaltmodul","Switch Module")
|
||||
MAKE_PSTR_LIST(gateway_device, "Gateway Module","Gateway Modul","Gateway Module")
|
||||
MAKE_PSTR_LIST(alert_device, "Alert Module","Alarmmodul","Alert Module")
|
||||
MAKE_PSTR_LIST(pump_device, "Pump Module","Pumpenmodul","Pump Module")
|
||||
MAKE_PSTR_LIST(heatsource_device, "Heatsource","Heizquelle","Heatsource")
|
||||
|
||||
// commands
|
||||
MAKE_PSTR_LIST(info_cmd, "lists all values", "Liste aller Werte")
|
||||
MAKE_PSTR_LIST(commands_cmd, "lists all commands", "Liste aller Kommandos")
|
||||
@@ -134,7 +149,7 @@ MAKE_PSTR_LIST(vacuum, "vacuum", "Vakuum", "vacuum", "Vakuum", "próżnia", "vak
|
||||
MAKE_PSTR_LIST(co2_optimized, "co2 optimized", "CO2 optimiert", "CO2 geoptimaliseerd", "CO2-optimerad", "optymalizacja CO2", "co2 optimalisert", "optimisé en CO2")
|
||||
MAKE_PSTR_LIST(cost_optimized, "cost optimized", "kostenoptimiert", "kosten geoptimaliseerd", "kostnadsoptimerad", "optymalizacja kosztów", "kostnadsoptimalisert", "optimisé en coût")
|
||||
MAKE_PSTR_LIST(outside_temp_switched, "outside temp switched", "Außentemp. gesteuert", "Buitentemp. gestuurd", "Utomhustemp korrigerad", "temperatura zewn. przeł.", "utetemp optimalisert", "contrôle par temp. ext.")
|
||||
MAKE_PSTR_LIST(co2_cost_mix, "co2 cost mix", "Kostenmix", "Kostenmix", "Kostnadsmix", "mieszany koszt CO2", "", "coût mixte CO2")
|
||||
MAKE_PSTR_LIST(co2_cost_mix, "co2 cost mix", "Kostenmix", "Kostenmix", "Kostnadsmix", "mieszany koszt CO2", "", "coût mixte CO2") // TODO translate
|
||||
MAKE_PSTR_LIST(analog, "analog", "analog", "analoog", "analog", "analogowy", "analog", "analogique")
|
||||
MAKE_PSTR_LIST(normal, "normal", "normal", "normaal", "normal", "normalny", "normal", "normal")
|
||||
MAKE_PSTR_LIST(blocking, "blocking", "Blockierung", "Blokkering", "Blockering", "blokowanie", "blokkering", "bloquant")
|
||||
@@ -448,7 +463,6 @@ MAKE_PSTR_LIST(wwSelTempLow, "wwseltemplow", "selected lower temperature", "unte
|
||||
MAKE_PSTR_LIST(wwSelTempOff, "wwseltempoff", "selected temperature for off", "Solltemperatur bei AUS", "Streeftemperatuur bij UIT", "Vald tempereatur för AV", "temperatura gdy grzanie wyłączone", "valgt tempereatur for av", "température sélectionnée pour arrêt")
|
||||
MAKE_PSTR_LIST(wwSelTempSingle, "wwseltempsingle", "single charge temperature", "Solltemperatur Einmalladung", "Streeftemperatuur enkele lading", "Temperatur Engångsladdning", "temperatura dodatkowej ciepłej wody", "temp engangsoppvarming", "température charge unique")
|
||||
MAKE_PSTR_LIST(wwCylMiddleTemp, "wwcylmiddletemp", "cylinder middle temperature (TS3)", "Speichertemperatur Mitte", "Buffer temperatuur midden", "Cylinder Temperatur Mitten (TS3)", "temperatura środka cylindra (TS3)", "vanntank midten temperatur (TS3)", "température moyenne ballon (TS3)")
|
||||
|
||||
MAKE_PSTR_LIST(wwSetTemp, "wwsettemp", "set temperature", "Solltemperatur", "Streeftemperatuut", "Börtempertur", "temperatura zadana", "innstilt temperatur", "régler température")
|
||||
MAKE_PSTR_LIST(wwType, "wwtype", "type", "Typ", "type", "Typ", "typ", "type", "type")
|
||||
MAKE_PSTR_LIST(wwComfort, "wwcomfort", "comfort", "Komfort", "Comfort", "Komfort", "komfort", "komfort", "confort")
|
||||
@@ -483,12 +497,11 @@ MAKE_PSTR_LIST(wwHystOn, "wwhyston", "hysteresis on temperature", "Einschalttemp
|
||||
MAKE_PSTR_LIST(wwHystOff, "wwhystoff", "hysteresis off temperature", "Ausschalttemperaturdifferenz", "Uitschakeltemperatuurverschil", "Hysteres AV-temperatur", "histereza wyłączania", "utkoblingstemperaturforskjell", "hystérésis température extinction")
|
||||
MAKE_PSTR_LIST(wwProgMode, "wwprogmode", "program", "Programmmodus", "Programma", "Program", "program", "program", "programme")
|
||||
MAKE_PSTR_LIST(wwCircProg, "wwcircprog", "circulation program", "Zirkulationsprogramm", "Circulatieprogramma", "Cirkulationsprogram", "program cyrkulacji c.w.u.", "sirkulationsprogram", "programme circulation")
|
||||
MAKE_PSTR_LIST(wwMaxTemp, "wwmaxtemp", "maximum temperature", "Maximale Temperatur", "Maximale temperatuur", "Maximal Temperatur", "temperatura maksymalna", "", "température max")
|
||||
MAKE_PSTR_LIST(wwMaxTemp, "wwmaxtemp", "maximum temperature", "Maximale Temperatur", "Maximale temperatuur", "Maximal Temperatur", "temperatura maksymalna", "", "température max") // TODO translate
|
||||
MAKE_PSTR_LIST(wwOneTimeKey, "wwonetimekey", "one time key function", "Einmalladungstaste", "Knop voor eenmalig laden buffer", "Engångsfunktion", "przycisk jednorazowego ogrzania", "engangsknapp varme", "fonction touche unique")
|
||||
MAKE_PSTR_LIST(wwSolarTemp, "wwsolartemp", "solar boiler temperature", "Solarboiler Temperatur", "Zonneboiler temperatuur", "Solpanel Temp", "temperatura zasobnika solarnego", "", "température chaudière solaire") // TODO translate
|
||||
|
||||
// mqtt values / commands
|
||||
|
||||
MAKE_PSTR_LIST(switchtime, "switchtime", "program switchtime", "Programm Schaltzeit", "Programma schakeltijd", "Program Bytestid", "program czasowy", "programbyttetid", "heure commutation programme")
|
||||
MAKE_PSTR_LIST(switchtime1, "switchtime1", "own1 program switchtime", "Programm 1 Schaltzeit", "Schakeltijd programma 1", "Program 1 Bytestid", "program przełączania 1", "byttetidprogram 1", "heure de commutation programme 1")
|
||||
MAKE_PSTR_LIST(switchtime2, "switchtime2", "own2 program switchtime", "Programm 2 Schaltzeit", "Schakeltijd programma 2", "Program 2 Bytestid", "program przełączania 2", "byttetid program 2", "heure de changement programme 2")
|
||||
@@ -525,7 +538,6 @@ MAKE_PSTR_LIST(wwSetTempLow, "wwsettemplow", "set low temperature", "untere Soll
|
||||
MAKE_PSTR_LIST(wwWhenModeOff, "wwwhenmodeoff", "when thermostat mode off", "bei Thermostatmodus AUS", "Als Thermostaat op UIT", "när Termostatläge är AV", "gdy wyłączono na termostacie", "når modus er av", "lorsque mode thermostat off")
|
||||
MAKE_PSTR_LIST(wwExtra1, "wwextra1", "circuit 1 extra", "Kreis 1 Extra", "Circuit 1 extra", "Krets 1 Extra", "obieg dodatkowy 1", "ekstra krets 1", "circuit 1 extra")
|
||||
MAKE_PSTR_LIST(wwExtra2, "wwextra2", "circuit 2 extra", "Kreis 2 Extra", "Circuit 2 extra", "Kets 2 Extra", "obieg dodatkowy 2", "ekstra krets 2", "circuit 2 extra")
|
||||
|
||||
MAKE_PSTR_LIST(wwCharge, "wwcharge", "charge", "Laden", "Laden", "Ladda", "grzanie", "lade", "charge")
|
||||
MAKE_PSTR_LIST(wwChargeDuration, "wwchargeduration", "charge duration", "Ladedauer", "Laadtijd", "Laddtid", "czas grzania dodatkowej ciepłej wody", "ladetid", "durée charge")
|
||||
MAKE_PSTR_LIST(wwDisinfect, "wwdisinfect", "disinfection", "Desinfektion", "Desinfectie", "Desinfektion", "dezynfekcja termiczna", "desinfeksjon", "désinfection")
|
||||
@@ -549,7 +561,7 @@ MAKE_PSTR_LIST(heattemp, "heattemp", "heat temperature", "Heizen Temperatur", "T
|
||||
MAKE_PSTR_LIST(nighttemp, "nighttemp", "night temperature", "Nachttemperatur", "Nachttemperatuur", "Nattemperatur", "temperatura w nocy", "nattemperatur", "température de nuit")
|
||||
MAKE_PSTR_LIST(nighttemp2, "nighttemp", "night temperature T1", "Nachttemperatur T1", "Nachttemperatuur T1", "Nattemperatur T1", "temperatura w nocy T1", "nattemperatur T1", "température nuit T1")
|
||||
MAKE_PSTR_LIST(ecotemp, "ecotemp", "eco temperature", "eco Temperatur", "Temperatuur eco", "Eko-temperatur", "temperatura w trybie eko", "øko temperatur", "température éco")
|
||||
MAKE_PSTR_LIST(manualtemp, "manualtemp", "manual temperature", "manuelle Temperatur", "temperatuur handmatig", "Temperatur Manuell", "temperatura ustawiona ręcznie", "manuell temperatur", "température manuelle")
|
||||
MAKE_PSTR_LIST(manualtemp, "manualtemp", "manual temperature", "manuelle Temperatur", "Temperatuur handmatig", "Temperatur Manuell", "temperatura ustawiona ręcznie", "manuell temperatur", "température manuelle")
|
||||
MAKE_PSTR_LIST(tempautotemp, "tempautotemp", "temporary set temperature automode", "temporäre Solltemperatur", "Streeftemperatuur automodus tijdelijk", "Temporär Aktivering av Auto-läge", "zadana temperatura w pomieszczenia w trybie \"auto\" (tymczasowa)", "temporær valgt temp i automodus", "température temporaire mode automatique")
|
||||
MAKE_PSTR_LIST(remoteseltemp, "remoteseltemp", "temporary set temperature from remote", "temporäre Solltemperatur Remote", "Temperatuur van afstandsbedieding", "Temperatur från fjärruppkoppling", "zadana zdalnie temperatura a pomieszczeniu (tymczasowa)", "temporær valgt temp fra fjernbetjening", "température temporaire depuis télécommande")
|
||||
MAKE_PSTR_LIST(comforttemp, "comforttemp", "comfort temperature", "Komforttemperatur", "Comforttemperatuur", "Komforttemperatur", "temperatura w trybie komfort", "komforttemperatur", "température confort")
|
||||
@@ -579,13 +591,11 @@ MAKE_PSTR_LIST(holidaymode, "holidaymode", "holiday mode", "Urlaubsbetrieb", "Va
|
||||
MAKE_PSTR_LIST(flowtempoffset, "flowtempoffset", "flow temperature offset for mixer", "Vorlauftemperaturanhebung", "Mixer aanvoertemperatuur offset", "Temperaturkorrigering Flödestemp. Blandningsventil", "korekta temperatury przepływu dla miksera", "temperaturkorrigering av blandingsventil", "décalage température de bascule pour mélangeur")
|
||||
MAKE_PSTR_LIST(reducemode, "reducemode", "reduce mode", "Absenkmodus", "Gereduceerde modus", "Reducerat Läge", "tryb zredukowany/obniżony", "", "mode réduction") // TODO translate
|
||||
MAKE_PSTR_LIST(noreducetemp, "noreducetemp", "no reduce below temperature", "Durchheizen unter", "Reduceermodus onderbreken onder", "Inaktivera reducering under", "bez redukcji poniżej temperatury", "inaktiver redusert nedre temp", "pas de réduction en dessous température")
|
||||
|
||||
MAKE_PSTR_LIST(reducetemp, "reducetemp", "off/reduce switch temperature", "Absenkmodus unter", "Onderste afschakeltemperatuur", "Avslag/Reducera under", "tryb zredukowany poniżej temperatury", "nedre avstengningstemperatur", "arrêt/réduction température bascule")
|
||||
MAKE_PSTR_LIST(vacreducetemp, "vacreducetemp", "vacations off/reduce switch temperature", "Urlaub Absenkmodus unter", "Vakantiemodus onderste afschakeltemperatuur", "Helg Avslag/Reducering under", "tryb urlopowy poniżej temperatury", "feriemodus nedre utkoblingstemperatur", "vacances – arrêt/réduction température bascule")
|
||||
MAKE_PSTR_LIST(vacreducemode, "vacreducemode", "vacations reduce mode", "Urlaub Absenkmodus", "Vakantie afschakelmodus", "Helg reduceringsläge", "redukcja w trakcie urlopu", "ferieavstengningsmodus", "mode réduction vacances")
|
||||
MAKE_PSTR_LIST(nofrostmode, "nofrostmode", "nofrost mode", "Frostschutz Modus", "Vorstbeveiligingsmodus", "Frostskyddsläge", "temperatura wiodąca dla ochrony przed zamarzaniem", "frostbeskyttelsesmodus", "mode protection gel")
|
||||
MAKE_PSTR_LIST(remotetemp, "remotetemp", "room temperature from remote", "Raumtemperatur Remote", "Ruimtetemperatuur van afstandsbediening", "Rumstemperatur från fjärr", "temperatura w pomieszczeniu (z termostatu)", "romstemperatur fra fjernbetjening", "température pièce depuis télécommande")
|
||||
|
||||
MAKE_PSTR_LIST(wwHolidays, "wwholidays", "holiday dates", "Feiertage", "Feestdagen", "Helgdagar", "dni świąteczne", "feriedager varmtvann", "dates vacances")
|
||||
MAKE_PSTR_LIST(wwVacations, "wwvacations", "vacation dates", "Urlaubstage", "Vakantiedagen", "Semesterdatum Varmvatten", "dni urlopowe", "ferie dato varmtvann", "dates vacances")
|
||||
MAKE_PSTR_LIST(holidays, "holidays", "holiday dates", "Feiertage", "Feestdagen", "Helgdatum", "święta", "helligdager", "dates vacances")
|
||||
@@ -631,8 +641,6 @@ MAKE_PSTR_LIST(solarPumpTurnoffDiff, "turnoffdiff", "pump turn off difference",
|
||||
MAKE_PSTR_LIST(pump2MinMod, "pump2minmod", "minimum pump 2 modulation", "minimale Modulation Pumpe 2", "Minimale modulatie pomp 2", "Min Modulering Pump 2", "minimalna modulacja pompy 2", "minimum pumpmodulering 2", "modulation minimale pompe 2")
|
||||
MAKE_PSTR_LIST(solarPump2TurnonDiff, "turnondiff2", "pump 2 turn on difference", "Einschalthysterese Pumpe 2", "Inschakelhysterese pomp 2", "Aktiveringshysteres Pump 2", "histereza załączenia pompy 2", "slå på hysteresepumpe 2", "différence activation pompe 2")
|
||||
MAKE_PSTR_LIST(solarPump2TurnoffDiff, "turnoffdiff2", "pump 2 turn off difference", "Ausschalthysterese Pumpe 2", "Uitschakelhysterese pomp 2", "Avslagshysteres Pump 2", "histereza wyłączenia pompy 2", "slå av hysteresepumpe 2", "différence arrêt pompe 2")
|
||||
|
||||
|
||||
MAKE_PSTR_LIST(collectorTemp, "collectortemp", "collector temperature (TS1)", "Kollektortemperatur (TS1)", "Collectortemperatuur (TS1)", "Kollektor Temperatur (TS1)", "temperatura kolektora (TS1)", "kollektor temperatur (TS1)", "température collecteur (TS1)")
|
||||
MAKE_PSTR_LIST(collector2Temp, "collector2temp", "collector 2 temperature (TS7)", "Kollector 2 Temperatur (TS7)", "Collector 2 temperatuur (TS7)", "Kollektor 2 Temperatur (TS7)", "temperatura kolektora 2 (TS7)", "kollektor 2 temperatur (TS7)", "température collecteur 2 (TS7)")
|
||||
MAKE_PSTR_LIST(cylBottomTemp, "cylbottomtemp", "cylinder bottom temperature (TS2)", "Speicher Bodentemperatur (TS2)", "Bodemtemperatuur zonneboiler (TS2)", "Cylindertemperatur Botten (TS2)", "temperatura na spodzie zasobnika (TS2)", "beredertemp i bunn (TS2)", "température fond de cylindre (TS2)")
|
||||
|
||||
@@ -1351,7 +1351,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
if (emsdevice && (emsdevice->device_type() == device_class.first)) {
|
||||
JsonObject obj = devices.createNestedObject();
|
||||
obj["type"] = emsdevice->device_type_name();
|
||||
obj["type"] = emsdevice->device_type_name(); // non translated name
|
||||
obj["name"] = emsdevice->name();
|
||||
obj["device id"] = Helpers::hextoa(emsdevice->device_id());
|
||||
obj["product id"] = emsdevice->product_id();
|
||||
|
||||
@@ -153,8 +153,6 @@ bool Test::run_test(const char * command, int8_t id) {
|
||||
// HC1 on 0x20
|
||||
uart_telegram({0xA0, 00, 0xFF, 00, 01, 0xD7, 00, 00, 00, 0x80, 00, 00, 00, 00, 03, 0xC5});
|
||||
|
||||
// TODO
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -639,7 +637,7 @@ void Test::run_test(uuid::console::Shell & shell, const std::string & cmd, const
|
||||
// toggle mode
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
Serial.print("Custom: ");
|
||||
Serial.print(emsdevice->device_type_name().c_str());
|
||||
Serial.print(emsdevice->device_type_name());
|
||||
Serial.print(" uniqueid=");
|
||||
Serial.println(emsdevice->unique_id());
|
||||
|
||||
|
||||
@@ -87,6 +87,8 @@ void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t
|
||||
uart_driver_install(EMSUART_NUM, 129, 0, (EMS_MAXBUFFERSIZE + 1) * 2, &uart_queue, 0); // buffer must be > fifo
|
||||
uart_set_rx_full_threshold(EMSUART_NUM, 1);
|
||||
uart_set_rx_timeout(EMSUART_NUM, 0); // disable
|
||||
|
||||
// note setting the static max buffer to 1024 causes OTA to fail
|
||||
xTaskCreate(uart_event_task, "uart_event_task", 2048, NULL, configMAX_PRIORITIES - 1, NULL);
|
||||
}
|
||||
tx_mode_ = tx_mode;
|
||||
@@ -99,6 +101,7 @@ void EMSuart::start(const uint8_t tx_mode, const uint8_t rx_gpio, const uint8_t
|
||||
void EMSuart::stop() {
|
||||
if (tx_mode_ != 0xFF) { // only call after driver initialisation
|
||||
uart_disable_intr_mask(EMSUART_NUM, UART_BRK_DET_INT_ENA | UART_RXFIFO_FULL_INT_ENA);
|
||||
// TODO should we xTaskSuspend() the event task here?
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -187,9 +187,10 @@ void WebCustomizationService::devices(AsyncWebServerRequest * request) {
|
||||
for (const auto & emsdevice : EMSESP::emsdevices) {
|
||||
if (emsdevice->has_entities()) {
|
||||
JsonObject obj = devices.createNestedObject();
|
||||
obj["i"] = emsdevice->unique_id(); // its unique id
|
||||
obj["s"] = emsdevice->device_type_name() + " (" + emsdevice->name() + ")"; // shortname
|
||||
obj["t"] = Helpers::toLower(emsdevice->device_type_name());
|
||||
obj["i"] = emsdevice->unique_id(); // its unique id
|
||||
obj["s"] = std::string(emsdevice->device_type_2_device_name_translated()) + " (" + emsdevice->name() + ")"; // shortname, is device type translated
|
||||
obj["tn"] = emsdevice->device_type_name(); // non-translated, lower-case
|
||||
obj["t"] = emsdevice->device_type(); // internal device type ID
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -81,7 +81,8 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
|
||||
if (emsdevice && (emsdevice->device_type() != EMSdevice::DeviceType::CONTROLLER || emsdevice->count_entities() > 0)) {
|
||||
JsonObject obj = devices.createNestedObject();
|
||||
obj["id"] = Helpers::smallitoa(buffer, emsdevice->unique_id()); // a unique id as a string
|
||||
obj["t"] = emsdevice->device_type_name(); // type
|
||||
obj["tn"] = emsdevice->device_type_2_device_name_translated(); // translated device type name
|
||||
obj["t"] = emsdevice->device_type(); // device type number
|
||||
obj["b"] = emsdevice->brand_to_string(); // brand
|
||||
obj["n"] = emsdevice->name(); // name
|
||||
obj["d"] = emsdevice->device_id(); // deviceid
|
||||
|
||||
@@ -243,7 +243,7 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
|
||||
EMSESP::system_.locale(settings.locale);
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (!old_local.equals(settings.locale)) {
|
||||
add_flags(ChangeFlags::MQTT);
|
||||
add_flags(ChangeFlags::RESTART); // force restart
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user