mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
Translate Device Name #872
This commit is contained in:
@@ -142,7 +142,7 @@ const DashboardData: FC = () => {
|
||||
common_theme,
|
||||
{
|
||||
Table: `
|
||||
--data-table-library_grid-template-columns: 40px 100px repeat(1, minmax(0, 1fr)) 100px 40px;
|
||||
--data-table-library_grid-template-columns: 40px 160px repeat(1, minmax(0, 1fr)) 100px 40px;
|
||||
`,
|
||||
BaseRow: `
|
||||
.td {
|
||||
@@ -704,9 +704,9 @@ const DashboardData: FC = () => {
|
||||
{tableList.map((device: Device, index: number) => (
|
||||
<Row key={device.id} item={device}>
|
||||
<Cell stiff>
|
||||
<DeviceIcon type={device.t} />
|
||||
<DeviceIcon type_id={device.t} />
|
||||
</Cell>
|
||||
<Cell stiff>{device.t}</Cell>
|
||||
<Cell stiff>{device.tn}</Cell>
|
||||
<Cell>{device.n}</Cell>
|
||||
<Cell stiff>{device.e}</Cell>
|
||||
<Cell stiff>
|
||||
@@ -719,7 +719,7 @@ const DashboardData: FC = () => {
|
||||
{(coreData.active_sensors > 0 || coreData.analog_enabled) && (
|
||||
<Row key="sensor" item={{ id: 'sensor' }}>
|
||||
<Cell>
|
||||
<DeviceIcon type="Sensor" />
|
||||
<DeviceIcon type_id={1} />
|
||||
</Cell>
|
||||
<Cell>Sensors</Cell>
|
||||
<Cell>{LL.ATTACHED_SENSORS()}</Cell>
|
||||
|
||||
@@ -13,32 +13,35 @@ import { AiOutlineAlert } from 'react-icons/ai';
|
||||
import { AiOutlineChrome } from 'react-icons/ai';
|
||||
|
||||
interface DeviceIconProps {
|
||||
type: string;
|
||||
type_id: number;
|
||||
}
|
||||
|
||||
const DeviceIcon: FC<DeviceIconProps> = ({ type }) => {
|
||||
switch (type) {
|
||||
case 'Boiler':
|
||||
return <CgSmartHomeBoiler />;
|
||||
case 'Sensor':
|
||||
// matches emsdevice.h DeviceType
|
||||
const DeviceIcon: FC<DeviceIconProps> = ({ type_id }) => {
|
||||
switch (type_id) {
|
||||
case 1:
|
||||
case 2:
|
||||
return <MdOutlineSensors />;
|
||||
case 'Solar':
|
||||
return <FaSolarPanel />;
|
||||
case 'Thermostat':
|
||||
case 3:
|
||||
return <CgSmartHomeBoiler />;
|
||||
case 4:
|
||||
return <MdThermostatAuto />;
|
||||
case 'Mixer':
|
||||
case 5:
|
||||
return <AiOutlineControl />;
|
||||
case 'Heatpump':
|
||||
case 6:
|
||||
return <FaSolarPanel />;
|
||||
case 7:
|
||||
return <GiHeatHaze />;
|
||||
case 'Switch':
|
||||
return <TiFlowSwitch />;
|
||||
case 'Connect':
|
||||
return <VscVmConnect />;
|
||||
case 'Gateway':
|
||||
case 8:
|
||||
return <AiOutlineGateway />;
|
||||
case 'Alert':
|
||||
case 9:
|
||||
return <TiFlowSwitch />;
|
||||
case 10:
|
||||
case 11:
|
||||
return <VscVmConnect />;
|
||||
case 12:
|
||||
return <AiOutlineAlert />;
|
||||
case 'Pump':
|
||||
case 13:
|
||||
return <AiOutlineChrome />;
|
||||
default:
|
||||
return null;
|
||||
|
||||
@@ -180,7 +180,7 @@ const SettingsCustomization: FC = () => {
|
||||
return (
|
||||
<>
|
||||
{de.n && (de.n[0] === '!' ? LL.COMMAND() + ': ' + de.n.slice(1) : de.cn && de.cn !== '' ? de.cn : de.n) + ' '}(
|
||||
<Link target="_blank" href={APIURL + devices?.devices[selectedDevice].t + '/' + de.id}>
|
||||
<Link target="_blank" href={APIURL + devices?.devices[selectedDevice].tn + '/' + de.id}>
|
||||
{de.id}
|
||||
</Link>
|
||||
)
|
||||
|
||||
@@ -59,7 +59,8 @@ export interface Status {
|
||||
}
|
||||
export interface Device {
|
||||
id: string; // id index
|
||||
t: string; // type
|
||||
tn: string; // device type translated name
|
||||
t: number; // device type id
|
||||
b: string; // brand
|
||||
n: string; // name
|
||||
d: number; // deviceid
|
||||
@@ -110,7 +111,8 @@ export interface DeviceShort {
|
||||
d?: number; // deviceid
|
||||
p?: number; // productid
|
||||
s: string; // shortname
|
||||
t?: string; // device type name
|
||||
t?: number; // device type id
|
||||
tn?: string; // device type internal name
|
||||
}
|
||||
|
||||
export interface Devices {
|
||||
|
||||
@@ -355,17 +355,20 @@ const emsesp_devices = {
|
||||
{
|
||||
i: 1,
|
||||
s: 'Thermostat (RC20/Moduline 300)',
|
||||
t: 'thermostat',
|
||||
t: 4,
|
||||
tn: 'thermostat',
|
||||
},
|
||||
{
|
||||
i: 2,
|
||||
s: 'Boiler (Nefit GBx72/Trendline/Cerapur/Greenstar Si/27i)',
|
||||
t: 'boiler',
|
||||
t: 3,
|
||||
tn: 'boiler',
|
||||
},
|
||||
{
|
||||
i: 4,
|
||||
s: 'Thermostat (RC100/Moduline 1000/1010)',
|
||||
t: 'thermostat',
|
||||
t: 4,
|
||||
tn: 'thermostat',
|
||||
},
|
||||
],
|
||||
}
|
||||
@@ -376,7 +379,8 @@ const emsesp_coredata = {
|
||||
devices: [
|
||||
{
|
||||
id: '2',
|
||||
t: 'Boiler',
|
||||
t: 3,
|
||||
tn: 'Boiler',
|
||||
b: 'Nefit',
|
||||
n: 'GBx72/Trendline/Cerapur/Greenstar Si/27i',
|
||||
d: 8,
|
||||
@@ -386,7 +390,8 @@ const emsesp_coredata = {
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
t: 'Thermostat',
|
||||
t: 4,
|
||||
tn: 'Thermostat',
|
||||
b: '',
|
||||
n: 'RC20/Moduline 300',
|
||||
d: 23,
|
||||
@@ -396,7 +401,8 @@ const emsesp_coredata = {
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
t: 'Thermostat',
|
||||
t: 4,
|
||||
tn: 'Thermostat',
|
||||
b: 'Buderus',
|
||||
n: 'RC100/Moduline 1000/1010',
|
||||
d: 16,
|
||||
|
||||
@@ -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:
|
||||
@@ -125,7 +125,39 @@ 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));
|
||||
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;
|
||||
@@ -178,11 +210,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
|
||||
@@ -208,7 +238,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_) + ")";
|
||||
@@ -223,12 +253,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);
|
||||
@@ -349,6 +343,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_BOILER_1 = 0x70; // fixed device_id for 1st. Cascade Boiler/UBA
|
||||
@@ -368,7 +364,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;
|
||||
|
||||
@@ -354,9 +354,10 @@ void EMSESP::show_device_values(uuid::console::Shell & shell) {
|
||||
// do this in the order of factory classes to keep a consistent order when displaying
|
||||
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());
|
||||
auto device_type = emsdevice->device_type();
|
||||
if (emsdevice && (device_type == device_class.first)) {
|
||||
// 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>();
|
||||
@@ -822,7 +823,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...
|
||||
@@ -943,12 +944,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,20 @@
|
||||
// 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", "Solar Module", "Solar Module")
|
||||
MAKE_PSTR_LIST(connect_device, "Connect Module", "Connect Module", "Connect Module")
|
||||
MAKE_PSTR_LIST(mixer_device, "Mixer Module", "Mixer Module", "Mixer Module")
|
||||
MAKE_PSTR_LIST(controller_device, "Controller Module", "Controller Module", "Controller Module")
|
||||
MAKE_PSTR_LIST(switch_device, "Switch Module","Switch Module","Switch Module")
|
||||
MAKE_PSTR_LIST(gateway_device, "Gateway Module","Gateway Module","Gateway Module")
|
||||
MAKE_PSTR_LIST(alert_device, "Alert Module","Alert Module","Alert Module")
|
||||
MAKE_PSTR_LIST(pump_device, "Pump Module","Pump Module","Pump Module")
|
||||
|
||||
// commands
|
||||
MAKE_PSTR_LIST(info_cmd, "lists all values", "Liste aller Werte")
|
||||
MAKE_PSTR_LIST(commands_cmd, "lists all commands", "Liste aller Kommandos")
|
||||
@@ -171,13 +185,13 @@ MAKE_PSTR_LIST(valve, "valve", "Ventil", "Klep", "Ventil", "zawór", "ventil", "
|
||||
MAKE_PSTR_LIST(none, "none", "keine", "geen", "ingen", "brak", "ingen", "aucun")
|
||||
MAKE_PSTR_LIST(hot_water, "hot water", "Warmwasser", "warm water", "varmvatten", "c.w.u.", "varmtvann", "eau chaude")
|
||||
MAKE_PSTR_LIST(pool, "pool", "Pool", "zwembad", "pool", "basen", "basseng", "piscine")
|
||||
MAKE_PSTR_LIST(outside_temp_alt, "outside temperature alt.", "Außentemp. alternativ", "", "", "temp. zewn. alternat.", "", "température extérieure alternative")
|
||||
MAKE_PSTR_LIST(outside_temp_par, "outside temperature parallel", "Außentemp. parallel", "", "", "temp. zewn. równoległa", "", "température extérieure parallèle")
|
||||
MAKE_PSTR_LIST(hp_prefered, "heatpump prefered", "Wärmepumpe bevorzugt", "", "", "preferowana pompa ciepła", "", "pompe à chaleur préférée")
|
||||
MAKE_PSTR_LIST(boiler_only, "boiler only", "nur Kessel", "", "", "tylko kocioł", "", "chaudière uniquement")
|
||||
MAKE_PSTR_LIST(reduced_output, "reduced output", "Reduzierte Leistung", "", "", "zmniejszona wydajność", "", "sortie réduite")
|
||||
MAKE_PSTR_LIST(switchoff, "switch off hp", "WP ausschalten", "", "", "wyłącz pompę ciepła", "", "éteindre la PAC")
|
||||
MAKE_PSTR_LIST(perm, "perm. reduced", "perm. reduziert", "", "", "stale zmniejszona wydajność", "", "réduction permanente")
|
||||
MAKE_PSTR_LIST(outside_temp_alt, "outside temperature alt.", "Außentemp. alternativ", "", "", "temp. zewn. alternat.", "", "température extérieure alternative") // TODO translate
|
||||
MAKE_PSTR_LIST(outside_temp_par, "outside temperature parallel", "Außentemp. parallel", "", "", "temp. zewn. równoległa", "", "température extérieure parallèle") // TODO translate
|
||||
MAKE_PSTR_LIST(hp_prefered, "heatpump prefered", "Wärmepumpe bevorzugt", "", "", "preferowana pompa ciepła", "", "pompe à chaleur préférée") // TODO translate
|
||||
MAKE_PSTR_LIST(boiler_only, "boiler only", "nur Kessel", "", "", "tylko kocioł", "", "chaudière uniquement") // TODO translate
|
||||
MAKE_PSTR_LIST(reduced_output, "reduced output", "Reduzierte Leistung", "", "", "zmniejszona wydajność", "", "sortie réduite") // TODO translate
|
||||
MAKE_PSTR_LIST(switchoff, "switch off hp", "WP ausschalten", "", "", "wyłącz pompę ciepła", "", "éteindre la PAC") // TODO translate
|
||||
MAKE_PSTR_LIST(perm, "perm. reduced", "perm. reduziert", "", "", "stale zmniejszona wydajność", "", "réduction permanente") // TODO translate
|
||||
|
||||
// thermostat
|
||||
MAKE_PSTR_LIST(seltemp, "selTemp", "Solltemperatur", "Doeltemperatuur", "Börtemperatur", "temperatura zadana", "innstilt temperatur", "consigne température")
|
||||
@@ -442,7 +456,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")
|
||||
@@ -482,7 +495,6 @@ MAKE_PSTR_LIST(wwOneTimeKey, "wwonetimekey", "one time key function", "Einmallad
|
||||
MAKE_PSTR_LIST(wwSolarTemp, "wwsolartemp", "solar boiler temperature", "Solarboiler Temperatur", "Zonneboiler temperatuur", "Solpanel Temp", "temperatura zasobnika solarnego", "", "température chaudière solaire")
|
||||
|
||||
// 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")
|
||||
@@ -516,7 +528,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")
|
||||
@@ -540,7 +551,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")
|
||||
@@ -570,13 +581,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")
|
||||
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")
|
||||
@@ -622,8 +631,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)")
|
||||
|
||||
@@ -1350,7 +1350,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();
|
||||
|
||||
@@ -188,8 +188,9 @@ void WebCustomizationService::devices(AsyncWebServerRequest * request) {
|
||||
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["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
|
||||
|
||||
@@ -240,10 +240,12 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
|
||||
|
||||
String old_local = settings.locale;
|
||||
settings.locale = root["locale"] | EMSESP_DEFAULT_LOCALE;
|
||||
check_flag(prev, settings.low_clock, ChangeFlags::RESTART);
|
||||
EMSESP::system_.locale(settings.locale);
|
||||
#ifndef EMSESP_STANDALONE
|
||||
if (!old_local.equals(settings.locale)) {
|
||||
add_flags(ChangeFlags::MQTT);
|
||||
add_flags(ChangeFlags::RESTART); // force restart
|
||||
// add_flags(ChangeFlags::MQTT);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user