diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index f67cbcf99..59a8636de 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -23,6 +23,7 @@ There are breaking changes in 3.6.0. Please read carefully before applying the u - Ventilation device [#1172](https://github.com/emsesp/EMS-ESP32/issues/1172) - Turn ETH off on wifi connect [#1167](https://github.com/emsesp/EMS-ESP32/issues/1167) - Support for multiple EMS-ESPs with HA [#1196](https://github.com/emsesp/EMS-ESP32/issues/1196) +- Italian translation [#1199](https://github.com/emsesp/EMS-ESP32/issues/1199) ## Fixed @@ -42,3 +43,4 @@ There are breaking changes in 3.6.0. Please read carefully before applying the u - Retry timeout for Mqtt-QOS1/2 10seconds - Optimize WebUI rendering when using Dialog Boxes [#1116](https://github.com/emsesp/EMS-ESP32/issues/1116) - Optimize Web libraries to reduce bundle size (3.6.x) [#1112](https://github.com/emsesp/EMS-ESP32/issues/1112) +- Use [espMqttClient](https://github.com/bertmelis/espMqttClient) with integrated queue [#1178](https://github.com/emsesp/EMS-ESP32/issues/1178) diff --git a/interface/src/SignIn.tsx b/interface/src/SignIn.tsx index 138427b55..5513da4ae 100644 --- a/interface/src/SignIn.tsx +++ b/interface/src/SignIn.tsx @@ -17,6 +17,7 @@ import { AuthenticationContext } from 'contexts/authentication'; import { ReactComponent as DEflag } from 'i18n/DE.svg'; import { ReactComponent as FRflag } from 'i18n/FR.svg'; import { ReactComponent as GBflag } from 'i18n/GB.svg'; +import { ReactComponent as ITflag } from 'i18n/IT.svg'; import { ReactComponent as NLflag } from 'i18n/NL.svg'; import { ReactComponent as NOflag } from 'i18n/NO.svg'; import { ReactComponent as PLflag } from 'i18n/PL.svg'; @@ -128,6 +129,10 @@ const SignIn: FC = () => {  FR + + {changed !== 0 && ( + + + + + )} @@ -208,6 +234,7 @@ const ManageUsersForm: FC = () => { return ( + {blocker ? : null} {content()} ); diff --git a/interface/src/i18n/IT.svg b/interface/src/i18n/IT.svg new file mode 100644 index 000000000..36677a0b9 --- /dev/null +++ b/interface/src/i18n/IT.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/interface/src/i18n/it/index.ts b/interface/src/i18n/it/index.ts new file mode 100644 index 000000000..8293e7c3a --- /dev/null +++ b/interface/src/i18n/it/index.ts @@ -0,0 +1,331 @@ +import type { Translation } from '../i18n-types'; +/* prettier-ignore */ +/* eslint-disable */ + +const it: Translation = { + LANGUAGE: 'Lingua', + RETRY: 'Riprovare', + LOADING: 'Caricamento', + IS_REQUIRED: '{0} é richiesto', + SIGN_IN: 'Connettersi', + SIGN_OUT: 'Disconnettersi', + USERNAME: 'Nome Utente', + PASSWORD: 'Password', + SU_PASSWORD: 'su Password', + DASHBOARD: 'Pannello di Controllo', + SETTINGS_OF: 'Impostazioni {0}', + HELP_OF: '{0} Aiuto', + LOGGED_IN: 'Registrato come {name}', + PLEASE_SIGNIN: 'Prego registrarsi per continuare', + UPLOAD_SUCCESSFUL: 'Caricamento finito', + DOWNLOAD_SUCCESSFUL: 'Scaricamento finito', + INVALID_LOGIN: 'Dettagli accesso invalidi', + NETWORK: 'Rete', + SECURITY: 'Sicurezza', + ONOFF_CAP: 'ON/OFF', + ONOFF: 'on/off', + TYPE: 'Tipo', + DESCRIPTION: 'Descrizione', + ENTITIES: 'Entità', + REFRESH: 'Ricaricare', + EXPORT: 'Esporta', + DEVICE_DETAILS: 'Dettagli dispositivo', + ID_OF: '{0} ID', + DEVICE: 'Dispositivo', + PRODUCT: 'Prodotto', + VERSION: 'Versione', + BRAND: 'Marca', + ENTITY_NAME: 'Nome Entità', + VALUE: '{{Valore|valore}}', + DEVICE_DATA: 'Device Data', + SENSOR_DATA: 'Sensor Data', + DEVICES: 'Dispositivi', + SENSORS: 'Sensori', + RUN_COMMAND: 'Esegui', + CHANGE_VALUE: 'Cambia Valore', + CANCEL: 'Annulla', + RESET: 'Reset', + APPLY_CHANGES: 'Apply Changes ({0})', + UPDATE: 'Update', + EXECUTE: 'Execute', + REMOVE: 'Elimina', + PROBLEM_UPDATING: 'Problema aggiornamento', + PROBLEM_LOADING: 'Problema caricamento', + ACCESS_DENIED: 'Access Denied', + ANALOG_SENSOR: 'Sensore Analogico', + ANALOG_SENSORS: 'Sensori Analogici', + SETTINGS: 'Settings', + UPDATED_OF: '{0} Aggiornati', + UPDATE_OF: 'Aggiorna {0}', + REMOVED_OF: '{0} Rimossi', + DELETION_OF: '{0} Cancellati', + OFFSET: 'Offset', + FACTOR: 'Fattore', + FREQ: 'Frequenza', + DUTY_CYCLE: 'Ciclo di lavoro', + UNIT: 'UoM', + STARTVALUE: 'Valore di partenza', + WARN_GPIO: 'Avvertimento: prestare attenzione quando si assegna un GPIO!', + EDIT: 'Modifica', + SENSOR: 'Sensore', + TEMP_SENSOR: 'Sensore Temperatura', + TEMP_SENSORS: 'Sensori Temperatura', + WRITE_CMD_SENT: 'Scrittura comando inviata', + WRITE_CMD_FAILED: 'Scittura comando fallita', + EMS_BUS_WARNING: 'EMS bus disconnesso. Se questo avvertimento persiste dopo alcuni secondi prego verificare impostazioni scheda', + EMS_BUS_SCANNING: 'Scansione dispositivi EMS ...', + CONNECTED: 'Connesso', + TX_ISSUES: 'Problema di Tx - prova una modalità differente', + DISCONNECTED: 'Disconnesso', + EMS_SCAN: 'Sei sicuro di voler iniziare una scansione completa del bus EMS ?', + EMS_BUS_STATUS: 'Stato Bus EMS', + ACTIVE_DEVICES: 'Dispositivi & sensori attivi', + EMS_DEVICE: 'Dispositivo EMS ', + SUCCESS: 'SUCCESSO', + FAIL: 'FALLITO', + QUALITY: 'QUALITÂ', + SCAN_DEVICES: 'Scansione per nuovi dispositivi', + EMS_BUS_STATUS_TITLE: 'Bus EMS & Stato Attività', + SCAN: 'Scansione', + STATUS_NAMES: [ + 'Telegrammi EMS Ricevuti (Rx)', + 'EMS Letti (Tx)', + 'EMS Scritti (Tx)', + 'Letture Sensori Temperatura', + 'Letture Sensori Analogici', + 'Pubblicazioni MQTT', + 'Chiamate API', + 'Messaggi Syslog' + ], + NUM_DEVICES: '{num} Dispositivi {{s}}', + NUM_TEMP_SENSORS: '{num} Sensori Temperatura {{s}}', + NUM_ANALOG_SENSORS: '{num} Sensori Analogici {{s}}', + NUM_DAYS: '{num} giorni {{s}}', + NUM_SECONDS: '{num} secondi {{s}}', + NUM_HOURS: '{num} ore {{s}}', + NUM_MINUTES: '{num} minuti {{s}}', + APPLICATION_SETTINGS: 'Impostazione Applicazione', + CUSTOMIZATIONS: 'Personalizzazione', + APPLICATION_RESTARTING: 'EMS-ESP sta riavviando', + INTERFACE_BOARD_PROFILE: 'Profilo scheda di interfaccia', + BOARD_PROFILE_TEXT: 'Selezionare un profilo di interfaccia pre-configurato dalla lista sottostante o scegliere un profilo personalizzato per configurare le impostazioni del tuo hardware', + BOARD_PROFILE: 'Profilo Scheda', + CUSTOM: 'Personalizzazione', + GPIO_OF: 'GPIO {0}', + BUTTON: 'Pulsante', + TEMPERATURE: 'Temperatura', + PHY_TYPE: 'Eth PHY Type', + DISABLED: 'disattivato', + TX_MODE: 'Modo Tx ', + HARDWARE: 'Hardware', + EMS_BUS: '{{BUS|EMS BUS}}', + GENERAL_OPTIONS: 'Opzioni Generali', + LANGUAGE_ENTITIES: 'Lingua (per entità dispositivi)', + HIDE_LED: 'Nascondi LED', + ENABLE_TELNET: 'Abilità la Console Telnet', + ENABLE_ANALOG: 'Abilita Sensori Analogici', + CONVERT_FAHRENHEIT: 'Converti valori temperatura in Fahrenheit', + BYPASS_TOKEN: 'Ignora autorizzazione del token di accesso sulle chiamate API', + READONLY: 'Abilita modalità sola-lettura (blocca tutti i comandi di scrittura EMS Tx in uscita)', + UNDERCLOCK_CPU: 'Abbassa velocità della CPU', + ENABLE_SHOWER_TIMER: 'Abilita timer doccia', + ENABLE_SHOWER_ALERT: 'Abilita avviso doccia', + TRIGGER_TIME: 'Tempo di avvio', + COLD_SHOT_DURATION: 'Durata colpo freddo', + FORMATTING_OPTIONS: 'Opzioni di formattazione', + BOOLEAN_FORMAT_DASHBOARD: 'Pannello di controllo in formato booleano', + BOOLEAN_FORMAT_API: 'Formato booleano API/MQTT', + ENUM_FORMAT: 'Enum Format API/MQTT', + INDEX: 'Indice', + ENABLE_PARASITE: 'Abilita potenza parassita', + LOGGING: 'Registrazione', + LOG_HEX: 'Registra telegrammi EMS in esadecimale', + ENABLE_SYSLOG: 'Abilita Syslog', + LOG_LEVEL: 'Livello registrazione', + MARK_INTERVAL: 'Segna Intervallo', + SECONDS: 'secondi', + MINUTES: 'minuti', + HOURS: 'ore', + RESTART: 'Riavvia', + RESTART_TEXT: 'EMS-ESP necessita di essere riavviato per applicare il cambio impostazioni del sistema', + RESTART_CONFIRM: 'Sei sicuro di voler riavviare EMS-ESP?', + COMMAND: 'Comando', + CUSTOMIZATIONS_RESTART: 'Tutte le personalizzazioni sono state rimosse. Riavvio ...', + CUSTOMIZATIONS_FULL: 'Le entità selezionate hanno superato il limite. Si prega di salvare in batch', + CUSTOMIZATIONS_SAVED: 'Personalizzazioni salvate', + CUSTOMIZATIONS_HELP_1: 'Seleziona un dispositivo e personalizza le opzioni delle entità o fai clic per rinominarlo', + CUSTOMIZATIONS_HELP_2: 'seleziona come preferito', + CUSTOMIZATIONS_HELP_3: 'disabilita azione scrittura', + CUSTOMIZATIONS_HELP_4: 'esculdi da MQTT e API', + CUSTOMIZATIONS_HELP_5: 'nascondi dal Pannello di controllo', + CUSTOMIZATIONS_HELP_6: 'rimuovi dalla memoria', + SELECT_DEVICE: 'Seleziona un dispositivo', + SET_ALL: 'imposta tutto', + OPTIONS: 'Opzioni', + NAME: 'Nome', + CUSTOMIZATIONS_RESET: 'Sei sicuro di voler rimuovere tutte le personalizzazioni incluse le impostazioni personalizzate dei sensori di temperatura e analogici?', + DEVICE_ENTITIES: 'Entità Dispositivo', + SUPPORT_INFORMATION: 'Informazioni di Supporto', + CLICK_HERE: 'Clicca qui', + HELP_INFORMATION_1: 'Visita il wiki online per ottenere istruzioni su come configurare EMS-ESP', + HELP_INFORMATION_2: 'Per la chat della community dal vivo unisciti al nostro server Discord', + HELP_INFORMATION_3: 'Per richiedere una funzionalità o segnalare un errore', + HELP_INFORMATION_4: 'ricordati di scaricare e allegare le informazioni del tuo sistema per una risposta più rapida quando segnali un problema', + HELP_INFORMATION_5: 'EMS-ESP è un progetto gratuito e open-source. Supporta il suo sviluppo futuro assegnandogli una stella su Github!', + SUPPORT_INFO: 'Info Supporto', + UPLOAD: 'Carica', + DOWNLOAD: 'Scarica', + ABORTED: 'Annullato', + FAILED: 'Fallito', + SUCCESSFUL: 'Riuscito', + SYSTEM: 'Sistema', + LOG_OF: 'Registro {0}', + STATUS_OF: 'Stato {0}', + UPLOAD_DOWNLOAD: 'Caricamento/Scaricamento', + VERSION_ON: 'Attualmente stai eseguendo la versione', + SYSTEM_APPLY_FIRMWARE: 'per applicare il nuovo firmware', + CLOSE: 'Chiudere', + USE: 'Usa', + FACTORY_RESET: 'Impostazioni di fabbrica', + SYSTEM_FACTORY_TEXT: 'Il dispositivo è stato ripristinato alle impostazioni di fabbrica e ora verrà riavviato', + SYSTEM_FACTORY_TEXT_DIALOG: 'Sei sicuro di voler ripristinare il dispositivo alle impostazioni di fabbrica??', + VERSION_CHECK: 'Verifica Versione', + THE_LATEST: 'Ultima', + OFFICIAL: 'ufficiale', + DEVELOPMENT: 'sviluppo', + RELEASE_IS: 'rilascio é', + RELEASE_NOTES: 'note rilascio', + EMS_ESP_VER: 'Versione EMS-ESP', + PLATFORM: 'Dispositivo (Piattaforma / SDK)', + UPTIME: 'Tempo di attività del sistema', + CPU_FREQ: 'Frequenza CPU ', + HEAP: 'Heap (Free / Max Alloc)', + PSRAM: 'PSRAM (Size / Free)', + FLASH: 'Flash Chip (Size / Speed)', + APPSIZE: 'Applicazione (Usata / Libera)', + FILESYSTEM: 'Memoria Sistema (Usata / Libera)', + BUFFER_SIZE: 'Max Buffer Size', + COMPACT: 'Compact', + ENABLE_OTA: 'Abilita aggiornamenti OTA', + DOWNLOAD_CUSTOMIZATION_TEXT: 'Scarica personalizzazioni entità', + DOWNLOAD_SCHEDULE_TEXT: 'Download Scheduler Events', + DOWNLOAD_SETTINGS_TEXT: 'Scarica le impostazioni dell applicazione. Fai attenzione quando condividi le tue impostazioni poiché questo file contiene password e altre informazioni di sistema riservate', + UPLOAD_TEXT: 'Carica un nuovo file firmware (.bin) , file delle impostazioni o delle personalizzazioni (.json) di seguito, per un opzione di convalida scaricare dapprima un file "*.MD5" ', + UPLOADING: 'Caricamento', + UPLOAD_DROP_TEXT: 'Trascina il file o clicca qui', + ERROR: 'Errore Inaspettato, prego tenta ancora', + TIME_SET: 'Imposta Ora', + MANAGE_USERS: 'Gestione Utenti', + IS_ADMIN: 'Amministratore', + USER_WARNING: 'Devi avere configurato almeno un utente amministratore', + ADD: 'Aggiungi', + ACCESS_TOKEN_FOR: 'Token di accesso per', + ACCESS_TOKEN_TEXT: 'Il token seguente viene utilizzato con le chiamate API REST che richiedono l autorizzazione. Può essere passato come token Bearer nell intestazione di autorizzazione o nel parametro di query URL access_token.', + GENERATING_TOKEN: 'Generazione token', + USER: 'Utente', + MODIFY: 'Modifica', + SU_TEXT: 'La password su (super utente) viene utilizzata per firmare i token di autenticazione e abilitare anche i privilegi di amministratore all interno della console.', + NOT_ENABLED: 'Non abilitato', + ERRORS_OF: 'Errori {0}', + DISCONNECT_REASON: 'Motivo disconnessione', + ENABLE_MQTT: 'Abilita MQTT', + BROKER: 'Broker', + CLIENT: 'Cliente', + BASE_TOPIC: 'Base', + OPTIONAL: 'Opzionale', + FORMATTING: 'Formattazione', + MQTT_FORMAT: 'Formato Topic/Payload ', + MQTT_NEST_1: 'Inserito in un singolo argomento', + MQTT_NEST_2: 'Come argomenti individuali', + MQTT_RESPONSE: 'Pubblica uscita del comando in un argomento di risposta', + MQTT_PUBLISH_TEXT_1: 'Pubblica argomenti a valore singolo sul cambiamento', + MQTT_PUBLISH_TEXT_2: 'Pubblica per comandare gli argomenti (ioBroker)', + MQTT_PUBLISH_TEXT_3: 'Abilita rilevamento MQTT (Home Assistant, Domoticz)', + MQTT_PUBLISH_TEXT_4: 'Prefisso per gli argomenti di scoperta', + MQTT_PUBLISH_TEXT_5: 'Discovery type', + MQTT_PUBLISH_INTERVALS: 'Pubblica intervalli', + MQTT_INT_BOILER: 'Caldaie e Pompe di Calore', + MQTT_INT_THERMOSTATS: 'Termostati', + MQTT_INT_SOLAR: 'Moduli solari', + MQTT_INT_MIXER: 'Moduli Mixer', + MQTT_INT_HEARTBEAT: 'Heartbeat', + MQTT_QUEUE: 'Coda MQTT', + DEFAULT: 'Predefinito', + MQTT_ENTITY_FORMAT: 'Formato ID entità', + MQTT_ENTITY_FORMAT_0: 'Singola istanza, nome lungo (v3.4)', + MQTT_ENTITY_FORMAT_1: 'Sinola istanza, nome breve', + MQTT_ENTITY_FORMAT_2: 'Istanze multiple, nome breve', + MQTT_CLEAN_SESSION: 'Imposta sessione pulita', + MQTT_RETAIN_FLAG: 'Imposta sempre il flag Retain', + INACTIVE: 'Inattivo', + ACTIVE: 'Attivo', + UNKNOWN: 'Sconosciuto', + SET_TIME: 'Imposta ora', + SET_TIME_TEXT: 'Immettere la data e l ora locale di seguito per impostare l ora', + LOCAL_TIME: 'Ora locale', + UTC_TIME: 'Ora UTC', + ENABLE_NTP: 'Abilita NTP', + NTP_SERVER: 'Server NTP', + TIME_ZONE: 'Fuso orario', + ACCESS_POINT: 'Access Point', + AP_PROVIDE: 'Abilita Access Point', + AP_PROVIDE_TEXT_1: 'sempre', + AP_PROVIDE_TEXT_2: 'quando WiFi é disconnessa', + AP_PROVIDE_TEXT_3: 'mai', + AP_PREFERRED_CHANNEL: 'Canale preferito', + AP_HIDE_SSID: 'Nascondi SSID', + AP_CLIENTS: 'Clienti AP', + AP_MAX_CLIENTS: 'Clienti Massimi', + AP_LOCAL_IP: 'IP Locale', + NETWORK_SCAN: 'Scansione reti WiFi', + IDLE: 'Inattivo', + LOST: 'Perso', + SCANNING: 'Scansione', + SCAN_AGAIN: 'Scansiona ancora', + NETWORK_SCANNER: 'Scansione Rete', + NETWORK_NO_WIFI: 'Nessuana rete WiFi trovata', + NETWORK_BLANK_SSID: 'lasciare vuoto per disattivare WiFi', + TX_POWER: 'Potenza Tx', + HOSTNAME: 'Nome ospite', + NETWORK_DISABLE_SLEEP: 'Disabilita la modalità sospensione Wi-Fi', + NETWORK_LOW_BAND: 'Usa una larghezza di banda WiFi inferiore', + NETWORK_USE_DNS: 'Abilita servizio mDNS', + NETWORK_ENABLE_CORS: 'Abilita CORS', + NETWORK_CORS_ORIGIN: 'origine CORS', + NETWORK_ENABLE_IPV6: 'Abilita supporto IPv6', + NETWORK_FIXED_IP: 'Usa indirizzo IP fisso', + NETWORK_GATEWAY: 'Gateway', + NETWORK_SUBNET: 'Maschera Sottorete', + NETWORK_DNS: 'Server DNS', + ADDRESS_OF: 'Indirizzo {0}', + ADMIN: 'Amministratore', + GUEST: 'Ospite', + NEW: 'Nuovo', + NEW_NAME_OF: 'Nuovo nome {0}', + ENTITY: 'entità', + MIN: 'min', + MAX: 'max', + BLOCK_NAVIGATE_1: 'You have unsaved changes', + BLOCK_NAVIGATE_2: 'If you navigate to a different page, your unsaved changes will be lost. Are you sure you want to leave this page?', + STAY: 'Stay', + LEAVE: 'Leave', + SCHEDULER: 'Scheduler', + SCHEDULER_HELP_1: 'Automate commands by adding scheduled events below. Set a unique Name to enable/disable activation via API/MQTT.', + SCHEDULER_HELP_2: 'Use 00:00 to trigger once on start-up', + SCHEDULE: 'Schedule', + TIME: 'Time', + TIMER: 'Timer', + SCHEDULE_UPDATED: 'Schedule updated', + SCHEDULE_TIMER_1: 'on startup', + SCHEDULE_TIMER_2: 'every minute', + SCHEDULE_TIMER_3: 'every hour', + CUSTOM_ENTITIES: 'Custom Entities', + ENTITIES_HELP_1: 'Fetch custom entities from the EMS bus', + ENTITIES_UPDATED: 'Entities Updated', + WRITEABLE: 'Writeable', + SHOWING: 'Showing', + SEARCH: 'Search' + +}; + +export default it; diff --git a/interface/src/project/DashboardDevicesDialog.tsx b/interface/src/project/DashboardDevicesDialog.tsx index f2c32a0bb..f1f43167a 100644 --- a/interface/src/project/DashboardDevicesDialog.tsx +++ b/interface/src/project/DashboardDevicesDialog.tsx @@ -98,12 +98,12 @@ const DashboarDevicesDialog = ({ } let helperText = '<'; - if (dv.u !== DeviceValueUOM.NONE) { + if (dv.s) { helperText += 'n'; - if (dv.m && dv.x) { + if (dv.m !== undefined && dv.x !== undefined) { + helperText += ' between ' + dv.m + ' and ' + dv.x; - } - if (dv.s) { + } else { helperText += ' , step ' + dv.s; } } else { @@ -149,7 +149,7 @@ const DashboarDevicesDialog = ({ ))} - ) : editItem.u !== DeviceValueUOM.NONE ? ( + ) : editItem.s || editItem.u !== DeviceValueUOM.NONE ? ( {setUom(editItem.u)} }} diff --git a/interface/src/project/SettingsApplication.tsx b/interface/src/project/SettingsApplication.tsx index 8dc037f06..3771efa73 100644 --- a/interface/src/project/SettingsApplication.tsx +++ b/interface/src/project/SettingsApplication.tsx @@ -381,6 +381,7 @@ const SettingsApplication: FC = () => { Deutsch (DE) Français (FR) + Italiano (IT) Nederlands (NL) Norsk (NO) Polski (PL) diff --git a/lib/async-mqtt-client/src/AsyncMqttClient.cpp b/lib/async-mqtt-client/src/AsyncMqttClient.cpp deleted file mode 100644 index 7c0f269e9..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient.cpp +++ /dev/null @@ -1,776 +0,0 @@ -#include "AsyncMqttClient.hpp" - -AsyncMqttClient::AsyncMqttClient() -: _client() -, _head(nullptr) -, _tail(nullptr) -, _sent(0) -, _state(DISCONNECTED) -, _disconnectReason(AsyncMqttClientDisconnectReason::TCP_DISCONNECTED) -, _lastClientActivity(0) -, _lastServerActivity(0) -, _lastPingRequestTime(0) -, _generatedClientId{0} -, _ip() -, _ipv6() -, _host(nullptr) -, _useIp(false) -, _useIpv6(false) -#if ASYNC_TCP_SSL_ENABLED -, _secure(false) -#endif -, _port(0) -, _keepAlive(15) -, _cleanSession(true) -, _clientId(nullptr) -, _username(nullptr) -, _password(nullptr) -, _willTopic(nullptr) -, _willPayload(nullptr) -, _willPayloadLength(0) -, _willQos(0) -, _willRetain(false) -#if ASYNC_TCP_SSL_ENABLED -, _secureServerFingerprints() -#endif -, _onConnectUserCallbacks() -, _onDisconnectUserCallbacks() -, _onSubscribeUserCallbacks() -, _onUnsubscribeUserCallbacks() -, _onMessageUserCallbacks() -, _onPublishUserCallbacks() -, _parsingInformation { .bufferState = AsyncMqttClientInternals::BufferState::NONE } -, _currentParsedPacket(nullptr) -, _remainingLengthBufferPosition(0) -, _remainingLengthBuffer{0} -, _pendingPubRels() { - _client.onConnect([](void* obj, AsyncClient* c) { (static_cast(obj))->_onConnect(); }, this); - _client.onDisconnect([](void* obj, AsyncClient* c) { (static_cast(obj))->_onDisconnect(); }, this); - // _client.onError([](void* obj, AsyncClient* c, int8_t error) { (static_cast(obj))->_onError(error); }, this); - // _client.onTimeout([](void* obj, AsyncClient* c, uint32_t time) { (static_cast(obj))->_onTimeout(); }, this); - _client.onAck([](void* obj, AsyncClient* c, size_t len, uint32_t time) { (static_cast(obj))->_onAck(len); }, this); - _client.onData([](void* obj, AsyncClient* c, void* data, size_t len) { (static_cast(obj))->_onData(static_cast(data), len); }, this); - _client.onPoll([](void* obj, AsyncClient* c) { (static_cast(obj))->_onPoll(); }, this); - _client.setNoDelay(true); // send small packets immediately (PINGREQ/DISCONN are only 2 bytes) -#ifdef ESP32 - sprintf(_generatedClientId, "esp32-%06llx", ESP.getEfuseMac()); - _xSemaphore = xSemaphoreCreateMutex(); -#elif defined(ESP8266) - sprintf(_generatedClientId, "esp8266-%06x", ESP.getChipId()); -#endif - _clientId = _generatedClientId; - - setMaxTopicLength(128); -} - -AsyncMqttClient::~AsyncMqttClient() { - delete _currentParsedPacket; - delete[] _parsingInformation.topicBuffer; - _clear(); - _pendingPubRels.clear(); - _pendingPubRels.shrink_to_fit(); - _clearQueue(false); // _clear() doesn't clear session data -#ifdef ESP32 - vSemaphoreDelete(_xSemaphore); -#endif -} - -AsyncMqttClient& AsyncMqttClient::setKeepAlive(uint16_t keepAlive) { - _keepAlive = keepAlive; - return *this; -} - -AsyncMqttClient& AsyncMqttClient::setClientId(const char* clientId) { - _clientId = clientId; - return *this; -} - -AsyncMqttClient& AsyncMqttClient::setCleanSession(bool cleanSession) { - _cleanSession = cleanSession; - return *this; -} - -AsyncMqttClient& AsyncMqttClient::setMaxTopicLength(uint16_t maxTopicLength) { - _parsingInformation.maxTopicLength = maxTopicLength; - delete[] _parsingInformation.topicBuffer; - _parsingInformation.topicBuffer = new char[maxTopicLength + 1]; - return *this; -} - -AsyncMqttClient& AsyncMqttClient::setCredentials(const char* username, const char* password) { - _username = username; - _password = password; - return *this; -} - -AsyncMqttClient& AsyncMqttClient::setWill(const char* topic, uint8_t qos, bool retain, const char* payload, size_t length) { - _willTopic = topic; - _willQos = qos; - _willRetain = retain; - _willPayload = payload; - _willPayloadLength = length; - return *this; -} - -AsyncMqttClient& AsyncMqttClient::setServer(IPAddress ip, uint16_t port) { - _useIp = true; - _useIpv6 = false; - _ip = ip; - _port = port; - return *this; -} - -AsyncMqttClient& AsyncMqttClient::setServer(IPv6Address ipv6, uint16_t port) { - _useIpv6 = true; - _useIp = false; - _ipv6 = ipv6; - _port = port; - return *this; -} - -AsyncMqttClient& AsyncMqttClient::setServer(const char* host, uint16_t port) { - _port = port; - _useIp = false; - _useIpv6 = false; - _host = host; - if (_ipv6.fromString(host)) { - _useIpv6 = true; - _useIp = false; - } else if (_ip.fromString(host)) { - _useIpv6 = false; - _useIp = true; - } - return *this; -} - -#if ASYNC_TCP_SSL_ENABLED -AsyncMqttClient& AsyncMqttClient::setSecure(bool secure) { - _secure = secure; - return *this; -} - -AsyncMqttClient& AsyncMqttClient::addServerFingerprint(const uint8_t* fingerprint) { - std::array newFingerprint; - memcpy(newFingerprint.data(), fingerprint, SHA1_SIZE); - _secureServerFingerprints.push_back(newFingerprint); - return *this; -} -#endif - -AsyncMqttClient& AsyncMqttClient::onConnect(AsyncMqttClientInternals::OnConnectUserCallback callback) { - _onConnectUserCallbacks.push_back(callback); - return *this; -} - -AsyncMqttClient& AsyncMqttClient::onDisconnect(AsyncMqttClientInternals::OnDisconnectUserCallback callback) { - _onDisconnectUserCallbacks.push_back(callback); - return *this; -} - -AsyncMqttClient& AsyncMqttClient::onSubscribe(AsyncMqttClientInternals::OnSubscribeUserCallback callback) { - _onSubscribeUserCallbacks.push_back(callback); - return *this; -} - -AsyncMqttClient& AsyncMqttClient::onUnsubscribe(AsyncMqttClientInternals::OnUnsubscribeUserCallback callback) { - _onUnsubscribeUserCallbacks.push_back(callback); - return *this; -} - -AsyncMqttClient& AsyncMqttClient::onMessage(AsyncMqttClientInternals::OnMessageUserCallback callback) { - _onMessageUserCallbacks.push_back(callback); - return *this; -} - -AsyncMqttClient& AsyncMqttClient::onPublish(AsyncMqttClientInternals::OnPublishUserCallback callback) { - _onPublishUserCallbacks.push_back(callback); - return *this; -} - -void AsyncMqttClient::_freeCurrentParsedPacket() { - delete _currentParsedPacket; - _currentParsedPacket = nullptr; -} - -void AsyncMqttClient::_clear() { - _lastPingRequestTime = 0; - _freeCurrentParsedPacket(); - _clearQueue(true); // keep session data for now - - _parsingInformation.bufferState = AsyncMqttClientInternals::BufferState::NONE; - - _client.setRxTimeout(0); -} - -/* TCP */ -void AsyncMqttClient::_onConnect() { - log_i("TCP conn, MQTT CONNECT"); -#if ASYNC_TCP_SSL_ENABLED - if (_secure && _secureServerFingerprints.size() > 0) { - SSL* clientSsl = _client.getSSL(); - - bool sslFoundFingerprint = false; - for (std::array fingerprint : _secureServerFingerprints) { - if (ssl_match_fingerprint(clientSsl, fingerprint.data()) == SSL_OK) { - sslFoundFingerprint = true; - break; - } - } - - if (!sslFoundFingerprint) { - _disconnectReason = AsyncMqttClientDisconnectReason::TLS_BAD_FINGERPRINT; - _client.close(true); - return; - } - } -#endif - AsyncMqttClientInternals::OutPacket* msg = - new AsyncMqttClientInternals::ConnectOutPacket(_cleanSession, - _username, - _password, - _willTopic, - _willRetain, - _willQos, - _willPayload, - _willPayloadLength, - _keepAlive, - _clientId); - _addFront(msg); - _handleQueue(); -} - -void AsyncMqttClient::_onDisconnect() { - log_i("TCP disconn"); - _state = DISCONNECTED; - - _clear(); - - for (auto callback : _onDisconnectUserCallbacks) callback(_disconnectReason); -} - -/* -void AsyncMqttClient::_onError(int8_t error) { - (void)error; - // _onDisconnect called anyway -} - -void AsyncMqttClient::_onTimeout() { - // disconnection will be handled by ping/pong management -} -*/ - -void AsyncMqttClient::_onAck(size_t len) { - log_i("ack %u", len); - _handleQueue(); -} - -void AsyncMqttClient::_onData(char* data, size_t len) { - log_i("data rcv (%u)", len); - size_t currentBytePosition = 0; - char currentByte; - _lastServerActivity = millis(); - do { - switch (_parsingInformation.bufferState) { - case AsyncMqttClientInternals::BufferState::NONE: - currentByte = data[currentBytePosition++]; - _parsingInformation.packetType = currentByte >> 4; - _parsingInformation.packetFlags = (currentByte << 4) >> 4; - _parsingInformation.bufferState = AsyncMqttClientInternals::BufferState::REMAINING_LENGTH; - switch (_parsingInformation.packetType) { - case AsyncMqttClientInternals::PacketType.CONNACK: - log_i("rcv CONNACK"); - _currentParsedPacket = new AsyncMqttClientInternals::ConnAckPacket(&_parsingInformation, std::bind(&AsyncMqttClient::_onConnAck, this, std::placeholders::_1, std::placeholders::_2)); - _client.setRxTimeout(0); - break; - case AsyncMqttClientInternals::PacketType.PINGRESP: - log_i("rcv PINGRESP"); - _currentParsedPacket = new AsyncMqttClientInternals::PingRespPacket(&_parsingInformation, std::bind(&AsyncMqttClient::_onPingResp, this)); - break; - case AsyncMqttClientInternals::PacketType.SUBACK: - log_i("rcv SUBACK"); - _currentParsedPacket = new AsyncMqttClientInternals::SubAckPacket(&_parsingInformation, std::bind(&AsyncMqttClient::_onSubAck, this, std::placeholders::_1, std::placeholders::_2)); - break; - case AsyncMqttClientInternals::PacketType.UNSUBACK: - log_i("rcv UNSUBACK"); - _currentParsedPacket = new AsyncMqttClientInternals::UnsubAckPacket(&_parsingInformation, std::bind(&AsyncMqttClient::_onUnsubAck, this, std::placeholders::_1)); - break; - case AsyncMqttClientInternals::PacketType.PUBLISH: - log_i("rcv PUBLISH"); - _currentParsedPacket = new AsyncMqttClientInternals::PublishPacket(&_parsingInformation, std::bind(&AsyncMqttClient::_onMessage, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3, std::placeholders::_4, std::placeholders::_5, std::placeholders::_6, std::placeholders::_7, std::placeholders::_8, std::placeholders::_9), std::bind(&AsyncMqttClient::_onPublish, this, std::placeholders::_1, std::placeholders::_2)); - break; - case AsyncMqttClientInternals::PacketType.PUBREL: - log_i("rcv PUBREL"); - _currentParsedPacket = new AsyncMqttClientInternals::PubRelPacket(&_parsingInformation, std::bind(&AsyncMqttClient::_onPubRel, this, std::placeholders::_1)); - break; - case AsyncMqttClientInternals::PacketType.PUBACK: - log_i("rcv PUBACK"); - _currentParsedPacket = new AsyncMqttClientInternals::PubAckPacket(&_parsingInformation, std::bind(&AsyncMqttClient::_onPubAck, this, std::placeholders::_1)); - break; - case AsyncMqttClientInternals::PacketType.PUBREC: - log_i("rcv PUBREC"); - _currentParsedPacket = new AsyncMqttClientInternals::PubRecPacket(&_parsingInformation, std::bind(&AsyncMqttClient::_onPubRec, this, std::placeholders::_1)); - break; - case AsyncMqttClientInternals::PacketType.PUBCOMP: - log_i("rcv PUBCOMP"); - _currentParsedPacket = new AsyncMqttClientInternals::PubCompPacket(&_parsingInformation, std::bind(&AsyncMqttClient::_onPubComp, this, std::placeholders::_1)); - break; - default: - log_i("rcv PROTOCOL VIOLATION"); - disconnect(true); - break; - } - break; - case AsyncMqttClientInternals::BufferState::REMAINING_LENGTH: - currentByte = data[currentBytePosition++]; - _remainingLengthBuffer[_remainingLengthBufferPosition++] = currentByte; - if (currentByte >> 7 == 0) { - _parsingInformation.remainingLength = AsyncMqttClientInternals::Helpers::decodeRemainingLength(_remainingLengthBuffer); - _remainingLengthBufferPosition = 0; - if (_parsingInformation.remainingLength > 0) { - _parsingInformation.bufferState = AsyncMqttClientInternals::BufferState::VARIABLE_HEADER; - } else { - // PINGRESP is a special case where it has no variable header, so the packet ends right here - _parsingInformation.bufferState = AsyncMqttClientInternals::BufferState::NONE; - _onPingResp(); - } - } - break; - case AsyncMqttClientInternals::BufferState::VARIABLE_HEADER: - _currentParsedPacket->parseVariableHeader(data, len, ¤tBytePosition); - break; - case AsyncMqttClientInternals::BufferState::PAYLOAD: - _currentParsedPacket->parsePayload(data, len, ¤tBytePosition); - break; - default: - currentBytePosition = len; - } - } while (currentBytePosition != len); -} - -void AsyncMqttClient::_onPoll() { - // if there is too much time the client has sent a ping request without a response, disconnect client to avoid half open connections - if (_lastPingRequestTime != 0 && (millis() - _lastPingRequestTime) >= (_keepAlive * 1000 * 2)) { - log_w("PING t/o, disconnecting"); - disconnect(true); - return; - } - // send ping to ensure the server will receive at least one message inside keepalive window - if (_state == CONNECTED && _lastPingRequestTime == 0 && (millis() - _lastClientActivity) >= (_keepAlive * 1000 * 0.7)) { - _sendPing(); - // send ping to verify if the server is still there (ensure this is not a half connection) - } else if (_state == CONNECTED && _lastPingRequestTime == 0 && (millis() - _lastServerActivity) >= (_keepAlive * 1000 * 0.7)) { - _sendPing(); - } - _handleQueue(); -} - -/* QUEUE */ - -void AsyncMqttClient::_insert(AsyncMqttClientInternals::OutPacket* packet) { - // We only use this for QoS2 PUBREL so there must be a PUBLISH packet present. - // The queue therefore cannot be empty and _head points to this PUBLISH packet. - SEMAPHORE_TAKE(); - log_i("new insert #%u", packet->packetType()); - packet->next = _head->next; - _head->next = packet; - if (_head == _tail) { // PUB packet is the only one in the queue - _tail = packet; - } - SEMAPHORE_GIVE(); - _handleQueue(); -} - -void AsyncMqttClient::_addFront(AsyncMqttClientInternals::OutPacket* packet) { - // This is only used for the CONNECT packet, to be able to establish a connection - // before anything else. The queue can be empty or has packets from the continued session. - // In both cases, _head should always point to the CONNECT packet afterwards. - SEMAPHORE_TAKE(); - log_i("new front #%u", packet->packetType()); - if (_head == nullptr) { - _tail = packet; - } else { - packet->next = _head; - } - _head = packet; - SEMAPHORE_GIVE(); - _handleQueue(); -} - -void AsyncMqttClient::_addBack(AsyncMqttClientInternals::OutPacket* packet) { - SEMAPHORE_TAKE(); - log_i("new back #%u", packet->packetType()); - if (!_tail) { - _head = packet; - } else { - _tail->next = packet; - } - _tail = packet; - _tail->next = nullptr; - SEMAPHORE_GIVE(); - _handleQueue(); -} - -void AsyncMqttClient::_handleQueue() { - SEMAPHORE_TAKE(); - // On ESP32, onDisconnect is called within the close()-call. So we need to make sure we don't lock - bool disconnect = false; - - while (_head && _client.space() > 10) { // safe but arbitrary value, send at least 10 bytes - // 1. try to send - if (_head->size() > _sent) { - // On SSL the TCP library returns the total amount of bytes, not just the unencrypted payload length. - // So we calculate the amount to be written ourselves. - size_t willSend = std::min(_head->size() - _sent, _client.space()); - size_t realSent = _client.add(reinterpret_cast(_head->data(_sent)), willSend, ASYNC_WRITE_FLAG_COPY); // flag is set by LWIP anyway, added for clarity - _sent += willSend; - (void)realSent; - _client.send(); - _lastClientActivity = millis(); - // _lastPingRequestTime = 0; // https://github.com/marvinroger/async-mqtt-client/issues/281#issuecomment-1112897839 - #if ASYNC_TCP_SSL_ENABLED - log_i("snd #%u: (tls: %u) %u/%u", _head->packetType(), realSent, _sent, _head->size()); - #else - log_i("snd #%u: %u/%u", _head->packetType(), _sent, _head->size()); - #endif - if (_head->packetType() == AsyncMqttClientInternals::PacketType.DISCONNECT) { - disconnect = true; - } - } - - // 2. stop processing when we have to wait for an MQTT acknowledgment - if (_head->size() == _sent) { - if (_head->released()) { - log_i("p #%d rel", _head->packetType()); - AsyncMqttClientInternals::OutPacket* tmp = _head; - _head = _head->next; - if (!_head) _tail = nullptr; - delete tmp; - _sent = 0; - } else { - break; // sending is complete however send next only after mqtt confirmation - } - } - } - - SEMAPHORE_GIVE(); - if (disconnect) { - log_i("snd DISCONN, disconnecting"); - _client.close(); - } -} - -void AsyncMqttClient::_clearQueue(bool keepSessionData) { - SEMAPHORE_TAKE(); - AsyncMqttClientInternals::OutPacket* packet = _head; - _head = nullptr; - _tail = nullptr; - - while (packet) { - /* MQTT spec 3.1.2.4 Clean Session: - * - QoS 1 and QoS 2 messages which have been sent to the Server, but have not been completely acknowledged. - * - QoS 2 messages which have been received from the Server, but have not been completely acknowledged. - * + (unsent PUB messages with QoS > 0) - * - * To be kept: - * - possibly first message (sent to server but not acked) - * - PUBREC messages (QoS 2 PUB received but not acked) - * - PUBCOMP messages (QoS 2 PUBREL received but not acked) - */ - if (keepSessionData) { - if (packet->qos() > 0 && packet->size() <= _sent) { // check for qos includes check for PUB-packet type - reinterpret_cast(packet)->setDup(); - AsyncMqttClientInternals::OutPacket* next = packet->next; - log_i("keep #%u", packet->packetType()); - SEMAPHORE_GIVE(); - _addBack(packet); - SEMAPHORE_TAKE(); - packet = next; - } else if (packet->qos() > 0 || - packet->packetType() == AsyncMqttClientInternals::PacketType.PUBREC || - packet->packetType() == AsyncMqttClientInternals::PacketType.PUBCOMP) { - AsyncMqttClientInternals::OutPacket* next = packet->next; - log_i("keep #%u", packet->packetType()); - SEMAPHORE_GIVE(); - _addBack(packet); - SEMAPHORE_TAKE(); - packet = next; - } else { - AsyncMqttClientInternals::OutPacket* next = packet->next; - delete packet; - packet = next; - } - /* Delete everything when not keeping session data - */ - } else { - AsyncMqttClientInternals::OutPacket* next = packet->next; - delete packet; - packet = next; - } - } - _sent = 0; - SEMAPHORE_GIVE(); -} - -/* MQTT */ -void AsyncMqttClient::_onPingResp() { - log_i("PINGRESP"); - _freeCurrentParsedPacket(); - _lastPingRequestTime = 0; -} - -void AsyncMqttClient::_onConnAck(bool sessionPresent, uint8_t connectReturnCode) { - log_i("CONNACK"); - _freeCurrentParsedPacket(); - - if (!sessionPresent) { - _pendingPubRels.clear(); - _pendingPubRels.shrink_to_fit(); - _clearQueue(false); // remove session data - } - - if (connectReturnCode == 0) { - _state = CONNECTED; - for (auto callback : _onConnectUserCallbacks) callback(sessionPresent); - } else { - // Callbacks are handled by the onDisconnect function which is called from the AsyncTcp lib - _disconnectReason = static_cast(connectReturnCode); - return; - } - _handleQueue(); // send any remaining data from continued session -} - -void AsyncMqttClient::_onSubAck(uint16_t packetId, char status) { - log_i("SUBACK"); - _freeCurrentParsedPacket(); - SEMAPHORE_TAKE(); - if (_head && _head->packetId() == packetId) { - _head->release(); - log_i("SUB released"); - } - SEMAPHORE_GIVE(); - - for (auto callback : _onSubscribeUserCallbacks) callback(packetId, status); - - _handleQueue(); // subscribe confirmed, ready to send next queued item -} - -void AsyncMqttClient::_onUnsubAck(uint16_t packetId) { - log_i("UNSUBACK"); - _freeCurrentParsedPacket(); - SEMAPHORE_TAKE(); - if (_head && _head->packetId() == packetId) { - _head->release(); - log_i("UNSUB released"); - } - SEMAPHORE_GIVE(); - - for (auto callback : _onUnsubscribeUserCallbacks) callback(packetId); - - _handleQueue(); // unsubscribe confirmed, ready to send next queued item -} - -void AsyncMqttClient::_onMessage(char* topic, char* payload, uint8_t qos, bool dup, bool retain, size_t len, size_t index, size_t total, uint16_t packetId) { - bool notifyPublish = true; - - if (qos == 2) { - for (AsyncMqttClientInternals::PendingPubRel pendingPubRel : _pendingPubRels) { - if (pendingPubRel.packetId == packetId) { - notifyPublish = false; - break; - } - } - } - - if (notifyPublish) { - AsyncMqttClientMessageProperties properties; - properties.qos = qos; - properties.dup = dup; - properties.retain = retain; - - for (auto callback : _onMessageUserCallbacks) callback(topic, payload, properties, len, index, total); - } -} - -void AsyncMqttClient::_onPublish(uint16_t packetId, uint8_t qos) { - AsyncMqttClientInternals::PendingAck pendingAck; - - if (qos == 1) { - pendingAck.packetType = AsyncMqttClientInternals::PacketType.PUBACK; - pendingAck.headerFlag = AsyncMqttClientInternals::HeaderFlag.PUBACK_RESERVED; - pendingAck.packetId = packetId; - AsyncMqttClientInternals::OutPacket* msg = new AsyncMqttClientInternals::PubAckOutPacket(pendingAck); - _addBack(msg); - } else if (qos == 2) { - pendingAck.packetType = AsyncMqttClientInternals::PacketType.PUBREC; - pendingAck.headerFlag = AsyncMqttClientInternals::HeaderFlag.PUBREC_RESERVED; - pendingAck.packetId = packetId; - AsyncMqttClientInternals::OutPacket* msg = new AsyncMqttClientInternals::PubAckOutPacket(pendingAck); - _addBack(msg); - - bool pubRelAwaiting = false; - for (AsyncMqttClientInternals::PendingPubRel pendingPubRel : _pendingPubRels) { - if (pendingPubRel.packetId == packetId) { - pubRelAwaiting = true; - break; - } - } - - if (!pubRelAwaiting) { - AsyncMqttClientInternals::PendingPubRel pendingPubRel; - pendingPubRel.packetId = packetId; - _pendingPubRels.push_back(pendingPubRel); - } - } - - _freeCurrentParsedPacket(); -} - -void AsyncMqttClient::_onPubRel(uint16_t packetId) { - _freeCurrentParsedPacket(); - - AsyncMqttClientInternals::PendingAck pendingAck; - pendingAck.packetType = AsyncMqttClientInternals::PacketType.PUBCOMP; - pendingAck.headerFlag = AsyncMqttClientInternals::HeaderFlag.PUBCOMP_RESERVED; - pendingAck.packetId = packetId; - if (_head && _head->packetId() == packetId) { - AsyncMqttClientInternals::OutPacket* msg = new AsyncMqttClientInternals::PubAckOutPacket(pendingAck); - _head->release(); - _insert(msg); - log_i("PUBREC released"); - } - - for (size_t i = 0; i < _pendingPubRels.size(); i++) { - if (_pendingPubRels[i].packetId == packetId) { - _pendingPubRels.erase(_pendingPubRels.begin() + i); - _pendingPubRels.shrink_to_fit(); - } - } -} - -void AsyncMqttClient::_onPubAck(uint16_t packetId) { - _freeCurrentParsedPacket(); - if (_head && _head->packetId() == packetId) { - _head->release(); - log_i("PUB released"); - } - - for (auto callback : _onPublishUserCallbacks) callback(packetId); -} - -void AsyncMqttClient::_onPubRec(uint16_t packetId) { - _freeCurrentParsedPacket(); - - // We will only be sending 1 QoS>0 PUB message at a time (to honor message - // ordering). So no need to store ACKS in a separate container as it will - // be stored in the outgoing queue until a PUBCOMP comes in. - AsyncMqttClientInternals::PendingAck pendingAck; - pendingAck.packetType = AsyncMqttClientInternals::PacketType.PUBREL; - pendingAck.headerFlag = AsyncMqttClientInternals::HeaderFlag.PUBREL_RESERVED; - pendingAck.packetId = packetId; - log_i("snd PUBREL"); - - AsyncMqttClientInternals::OutPacket* msg = new AsyncMqttClientInternals::PubAckOutPacket(pendingAck); - if (_head && _head->packetId() == packetId) { - _head->release(); - log_i("PUB released"); - } - _insert(msg); -} - -void AsyncMqttClient::_onPubComp(uint16_t packetId) { - _freeCurrentParsedPacket(); - - // _head points to the PUBREL package - if (_head && _head->packetId() == packetId) { - _head->release(); - log_i("PUBREL released"); - } - - for (auto callback : _onPublishUserCallbacks) callback(packetId); -} - -void AsyncMqttClient::_sendPing() { - log_i("PING"); - _lastPingRequestTime = millis(); - AsyncMqttClientInternals::OutPacket* msg = new AsyncMqttClientInternals::PingReqOutPacket; - _addBack(msg); -} - -bool AsyncMqttClient::connected() const { - return _state == CONNECTED; -} - -void AsyncMqttClient::connect() { - if (_state != DISCONNECTED) return; - log_i("CONNECTING"); - _state = CONNECTING; - _disconnectReason = AsyncMqttClientDisconnectReason::TCP_DISCONNECTED; // reset any previous - - _client.setRxTimeout(_keepAlive); - -#if ASYNC_TCP_SSL_ENABLED - if (_useIp) { - _client.connect(_ip, _port, _secure); - } else { - _client.connect(_host, _port, _secure); - } -#else - if (_useIp) { - _client.connect(_ip, _port); - } else if (_useIpv6) { - _client.connect(_ipv6, _port); - } else { - _client.connect(_host, _port); - } -#endif -} - -void AsyncMqttClient::disconnect(bool force) { - if (_state == DISCONNECTED) return; - log_i("DISCONNECT (f:%d)", force); - if (force) { - _state = DISCONNECTED; - _client.close(true); - } else if (_state != DISCONNECTING) { - _state = DISCONNECTING; - AsyncMqttClientInternals::OutPacket* msg = new AsyncMqttClientInternals::DisconnOutPacket; - _addBack(msg); - } -} - -uint16_t AsyncMqttClient::subscribe(const char* topic, uint8_t qos) { - if (_state != CONNECTED) return 0; - log_i("SUBSCRIBE"); - - AsyncMqttClientInternals::OutPacket* msg = new AsyncMqttClientInternals::SubscribeOutPacket(topic, qos); - _addBack(msg); - return msg->packetId(); -} - -uint16_t AsyncMqttClient::unsubscribe(const char* topic) { - if (_state != CONNECTED) return 0; - log_i("UNSUBSCRIBE"); - - AsyncMqttClientInternals::OutPacket* msg = new AsyncMqttClientInternals::UnsubscribeOutPacket(topic); - _addBack(msg); - return msg->packetId(); -} - -uint16_t AsyncMqttClient::publish(const char* topic, uint8_t qos, bool retain, const char* payload, size_t length, bool dup, uint16_t message_id) { - if (_state != CONNECTED || GET_FREE_MEMORY() < MQTT_MIN_FREE_MEMORY) return 0; - log_i("PUBLISH"); - - AsyncMqttClientInternals::OutPacket* msg = new AsyncMqttClientInternals::PublishOutPacket(topic, qos, retain, payload, length); - _addBack(msg); - return msg->packetId(); -} - -bool AsyncMqttClient::clearQueue() { - if (_state != DISCONNECTED) return false; - _clearQueue(false); - return true; -} - -const char* AsyncMqttClient::getClientId() const { - return _clientId; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient.h b/lib/async-mqtt-client/src/AsyncMqttClient.h deleted file mode 100644 index 23d30554d..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef SRC_ASYNCMQTTCLIENT_H_ -#define SRC_ASYNCMQTTCLIENT_H_ - -#include "AsyncMqttClient.hpp" - -#endif // SRC_ASYNCMQTTCLIENT_H_ diff --git a/lib/async-mqtt-client/src/AsyncMqttClient.hpp b/lib/async-mqtt-client/src/AsyncMqttClient.hpp deleted file mode 100644 index fc2462601..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient.hpp +++ /dev/null @@ -1,182 +0,0 @@ -#pragma once - -#include -#include - -#include "Arduino.h" - -#ifndef MQTT_MIN_FREE_MEMORY -#define MQTT_MIN_FREE_MEMORY 4096 -#endif - -#ifdef ESP32 -#include -#include -#elif defined(ESP8266) -#include -#else -#error Platform not supported -#endif - -#if ASYNC_TCP_SSL_ENABLED -#include -#define SHA1_SIZE 20 -#endif - -#include "AsyncMqttClient/Flags.hpp" -#include "AsyncMqttClient/ParsingInformation.hpp" -#include "AsyncMqttClient/MessageProperties.hpp" -#include "AsyncMqttClient/Helpers.hpp" -#include "AsyncMqttClient/Callbacks.hpp" -#include "AsyncMqttClient/DisconnectReasons.hpp" -#include "AsyncMqttClient/Storage.hpp" - -#include "AsyncMqttClient/Packets/Packet.hpp" -#include "AsyncMqttClient/Packets/ConnAckPacket.hpp" -#include "AsyncMqttClient/Packets/PingRespPacket.hpp" -#include "AsyncMqttClient/Packets/SubAckPacket.hpp" -#include "AsyncMqttClient/Packets/UnsubAckPacket.hpp" -#include "AsyncMqttClient/Packets/PublishPacket.hpp" -#include "AsyncMqttClient/Packets/PubRelPacket.hpp" -#include "AsyncMqttClient/Packets/PubAckPacket.hpp" -#include "AsyncMqttClient/Packets/PubRecPacket.hpp" -#include "AsyncMqttClient/Packets/PubCompPacket.hpp" - -#include "AsyncMqttClient/Packets/Out/Connect.hpp" -#include "AsyncMqttClient/Packets/Out/PingReq.hpp" -#include "AsyncMqttClient/Packets/Out/PubAck.hpp" -#include "AsyncMqttClient/Packets/Out/Disconn.hpp" -#include "AsyncMqttClient/Packets/Out/Subscribe.hpp" -#include "AsyncMqttClient/Packets/Out/Unsubscribe.hpp" -#include "AsyncMqttClient/Packets/Out/Publish.hpp" - -class AsyncMqttClient { - public: - AsyncMqttClient(); - ~AsyncMqttClient(); - - AsyncMqttClient& setKeepAlive(uint16_t keepAlive); - AsyncMqttClient& setClientId(const char* clientId); - AsyncMqttClient& setCleanSession(bool cleanSession); - AsyncMqttClient& setMaxTopicLength(uint16_t maxTopicLength); - AsyncMqttClient& setCredentials(const char* username, const char* password = nullptr); - AsyncMqttClient& setWill(const char* topic, uint8_t qos, bool retain, const char* payload = nullptr, size_t length = 0); - AsyncMqttClient& setServer(IPAddress ip, uint16_t port); - AsyncMqttClient& setServer(IPv6Address ipv6, uint16_t port); - AsyncMqttClient& setServer(const char* host, uint16_t port); -#if ASYNC_TCP_SSL_ENABLED - AsyncMqttClient& setSecure(bool secure); - AsyncMqttClient& addServerFingerprint(const uint8_t* fingerprint); -#endif - - AsyncMqttClient& onConnect(AsyncMqttClientInternals::OnConnectUserCallback callback); - AsyncMqttClient& onDisconnect(AsyncMqttClientInternals::OnDisconnectUserCallback callback); - AsyncMqttClient& onSubscribe(AsyncMqttClientInternals::OnSubscribeUserCallback callback); - AsyncMqttClient& onUnsubscribe(AsyncMqttClientInternals::OnUnsubscribeUserCallback callback); - AsyncMqttClient& onMessage(AsyncMqttClientInternals::OnMessageUserCallback callback); - AsyncMqttClient& onPublish(AsyncMqttClientInternals::OnPublishUserCallback callback); - - bool connected() const; - void connect(); - void disconnect(bool force = false); - uint16_t subscribe(const char* topic, uint8_t qos); - uint16_t unsubscribe(const char* topic); - uint16_t publish(const char* topic, uint8_t qos, bool retain, const char* payload = nullptr, size_t length = 0, bool dup = false, uint16_t message_id = 0); - bool clearQueue(); // Not MQTT compliant! - - const char* getClientId() const; - - private: - AsyncClient _client; - AsyncMqttClientInternals::OutPacket* _head; - AsyncMqttClientInternals::OutPacket* _tail; - size_t _sent; - enum { - CONNECTING, - CONNECTED, - DISCONNECTING, - DISCONNECTED - } _state; - AsyncMqttClientDisconnectReason _disconnectReason; - uint32_t _lastClientActivity; - uint32_t _lastServerActivity; - uint32_t _lastPingRequestTime; - - char _generatedClientId[18 + 1]; // esp8266-abc123 and esp32-abcdef123456 - IPAddress _ip; - IPv6Address _ipv6; - const char* _host; - bool _useIp; - bool _useIpv6; -#if ASYNC_TCP_SSL_ENABLED - bool _secure; -#endif - uint16_t _port; - uint16_t _keepAlive; - bool _cleanSession; - const char* _clientId; - const char* _username; - const char* _password; - const char* _willTopic; - const char* _willPayload; - uint16_t _willPayloadLength; - uint8_t _willQos; - bool _willRetain; - -#if ASYNC_TCP_SSL_ENABLED - std::vector> _secureServerFingerprints; -#endif - - std::vector _onConnectUserCallbacks; - std::vector _onDisconnectUserCallbacks; - std::vector _onSubscribeUserCallbacks; - std::vector _onUnsubscribeUserCallbacks; - std::vector _onMessageUserCallbacks; - std::vector _onPublishUserCallbacks; - - AsyncMqttClientInternals::ParsingInformation _parsingInformation; - AsyncMqttClientInternals::Packet* _currentParsedPacket; - uint8_t _remainingLengthBufferPosition; - char _remainingLengthBuffer[4]; - - std::vector _pendingPubRels; - -#if defined(ESP32) - SemaphoreHandle_t _xSemaphore = nullptr; -#elif defined(ESP8266) - bool _xSemaphore = false; -#endif - - void _clear(); - void _freeCurrentParsedPacket(); - - // TCP - void _onConnect(); - void _onDisconnect(); - // void _onError(int8_t error); - // void _onTimeout(); - void _onAck(size_t len); - void _onData(char* data, size_t len); - void _onPoll(); - - // QUEUE - void _insert(AsyncMqttClientInternals::OutPacket* packet); // for PUBREL - void _addFront(AsyncMqttClientInternals::OutPacket* packet); // for CONNECT - void _addBack(AsyncMqttClientInternals::OutPacket* packet); // all the rest - void _handleQueue(); - void _clearQueue(bool keepSessionData); - - // MQTT - void _onPingResp(); - void _onConnAck(bool sessionPresent, uint8_t connectReturnCode); - void _onSubAck(uint16_t packetId, char status); - void _onUnsubAck(uint16_t packetId); - void _onMessage(char* topic, char* payload, uint8_t qos, bool dup, bool retain, size_t len, size_t index, size_t total, uint16_t packetId); - void _onPublish(uint16_t packetId, uint8_t qos); - void _onPubRel(uint16_t packetId); - void _onPubAck(uint16_t packetId); - void _onPubRec(uint16_t packetId); - void _onPubComp(uint16_t packetId); - - void _sendPing(); -}; diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Callbacks.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Callbacks.hpp deleted file mode 100644 index 414034daa..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Callbacks.hpp +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once - -#include - -#include "DisconnectReasons.hpp" -#include "MessageProperties.hpp" -#include "Errors.hpp" - -namespace AsyncMqttClientInternals { -// user callbacks -typedef std::function OnConnectUserCallback; -typedef std::function OnDisconnectUserCallback; -typedef std::function OnSubscribeUserCallback; -typedef std::function OnUnsubscribeUserCallback; -typedef std::function OnMessageUserCallback; -typedef std::function OnPublishUserCallback; -typedef std::function OnErrorUserCallback; - -// internal callbacks -typedef std::function OnConnAckInternalCallback; -typedef std::function OnPingRespInternalCallback; -typedef std::function OnSubAckInternalCallback; -typedef std::function OnUnsubAckInternalCallback; -typedef std::function OnMessageInternalCallback; -typedef std::function OnPublishInternalCallback; -typedef std::function OnPubRelInternalCallback; -typedef std::function OnPubAckInternalCallback; -typedef std::function OnPubRecInternalCallback; -typedef std::function OnPubCompInternalCallback; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/DisconnectReasons.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/DisconnectReasons.hpp deleted file mode 100644 index a15114000..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/DisconnectReasons.hpp +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once - -enum class AsyncMqttClientDisconnectReason : uint8_t { - TCP_DISCONNECTED = 0, - - MQTT_UNACCEPTABLE_PROTOCOL_VERSION = 1, - MQTT_IDENTIFIER_REJECTED = 2, - MQTT_SERVER_UNAVAILABLE = 3, - MQTT_MALFORMED_CREDENTIALS = 4, - MQTT_NOT_AUTHORIZED = 5, - - ESP8266_NOT_ENOUGH_SPACE = 6, - - TLS_BAD_FINGERPRINT = 7 -}; diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Errors.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Errors.hpp deleted file mode 100644 index f93e80e39..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Errors.hpp +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once - -enum class AsyncMqttClientError : uint8_t { - MAX_RETRIES = 0, - OUT_OF_MEMORY = 1 -}; diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Helpers.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Helpers.hpp deleted file mode 100644 index ecb620f74..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Helpers.hpp +++ /dev/null @@ -1,61 +0,0 @@ -#pragma once - -namespace AsyncMqttClientInternals { -class Helpers { - public: - static uint32_t decodeRemainingLength(char* bytes) { - uint32_t multiplier = 1; - uint32_t value = 0; - uint8_t currentByte = 0; - uint8_t encodedByte; - do { - encodedByte = bytes[currentByte++]; - value += (encodedByte & 127) * multiplier; - multiplier *= 128; - } while ((encodedByte & 128) != 0); - - return value; - } - - static uint8_t encodeRemainingLength(uint32_t remainingLength, char* destination) { - uint8_t currentByte = 0; - uint8_t bytesNeeded = 0; - - do { - uint8_t encodedByte = remainingLength % 128; - remainingLength /= 128; - if (remainingLength > 0) { - encodedByte = encodedByte | 128; - } - - destination[currentByte++] = encodedByte; - bytesNeeded++; - } while (remainingLength > 0); - - return bytesNeeded; - } -}; - -#if defined(ARDUINO_ARCH_ESP32) - #define SEMAPHORE_TAKE() xSemaphoreTake(_xSemaphore, portMAX_DELAY) - #define SEMAPHORE_GIVE() xSemaphoreGive(_xSemaphore) - #define GET_FREE_MEMORY() ESP.getMaxAllocHeap() - #include -#elif defined(ARDUINO_ARCH_ESP8266) - #define SEMAPHORE_TAKE(X) while (_xSemaphore) { /*ESP.wdtFeed();*/ } _xSemaphore = true - #define SEMAPHORE_GIVE() _xSemaphore = false - #define GET_FREE_MEMORY() ESP.getMaxFreeBlockSize() - #if defined(DEBUG_ESP_PORT) && defined(DEBUG_ASYNC_MQTT_CLIENT) - #define log_i(...) DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.print("\n") - #define log_e(...) DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.print("\n") - #define log_w(...) DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.print("\n") - #else - #define log_i(...) - #define log_e(...) - #define log_w(...) - #endif -#else - #pragma error "No valid architecture" -#endif - -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/MessageProperties.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/MessageProperties.hpp deleted file mode 100644 index c04b59664..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/MessageProperties.hpp +++ /dev/null @@ -1,7 +0,0 @@ -#pragma once - -struct AsyncMqttClientMessageProperties { - uint8_t qos; - bool dup; - bool retain; -}; diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/ConnAckPacket.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/ConnAckPacket.cpp deleted file mode 100644 index fb4b97195..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/ConnAckPacket.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "ConnAckPacket.hpp" - -using AsyncMqttClientInternals::ConnAckPacket; - -ConnAckPacket::ConnAckPacket(ParsingInformation* parsingInformation, OnConnAckInternalCallback callback) -: _parsingInformation(parsingInformation) -, _callback(callback) -, _bytePosition(0) -, _sessionPresent(false) -, _connectReturnCode(0) { -} - -ConnAckPacket::~ConnAckPacket() { -} - -void ConnAckPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { - char currentByte = data[(*currentBytePosition)++]; - if (_bytePosition++ == 0) { - _sessionPresent = (currentByte << 7) >> 7; - } else { - _connectReturnCode = currentByte; - _parsingInformation->bufferState = BufferState::NONE; - _callback(_sessionPresent, _connectReturnCode); - } -} - -void ConnAckPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { - (void)data; - (void)currentBytePosition; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/ConnAckPacket.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/ConnAckPacket.hpp deleted file mode 100644 index 3dcd162ee..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/ConnAckPacket.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "Packet.hpp" -#include "../ParsingInformation.hpp" -#include "../Callbacks.hpp" - -namespace AsyncMqttClientInternals { -class ConnAckPacket : public Packet { - public: - explicit ConnAckPacket(ParsingInformation* parsingInformation, OnConnAckInternalCallback callback); - ~ConnAckPacket(); - - void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); - void parsePayload(char* data, size_t len, size_t* currentBytePosition); - - private: - ParsingInformation* _parsingInformation; - OnConnAckInternalCallback _callback; - - uint8_t _bytePosition; - bool _sessionPresent; - uint8_t _connectReturnCode; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Connect.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Connect.cpp deleted file mode 100644 index a9a86e453..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Connect.cpp +++ /dev/null @@ -1,162 +0,0 @@ -#include "Connect.hpp" - -using AsyncMqttClientInternals::ConnectOutPacket; - -ConnectOutPacket::ConnectOutPacket(bool cleanSession, - const char* username, - const char* password, - const char* willTopic, - bool willRetain, - uint8_t willQos, - const char* willPayload, - uint16_t willPayloadLength, - uint16_t keepAlive, - const char* clientId) { - char fixedHeader[5]; - fixedHeader[0] = AsyncMqttClientInternals::PacketType.CONNECT; - fixedHeader[0] = fixedHeader[0] << 4; - fixedHeader[0] = fixedHeader[0] | AsyncMqttClientInternals::HeaderFlag.CONNECT_RESERVED; - - uint16_t protocolNameLength = 4; - char protocolNameLengthBytes[2]; - protocolNameLengthBytes[0] = protocolNameLength >> 8; - protocolNameLengthBytes[1] = protocolNameLength & 0xFF; - - char protocolLevel[1]; - protocolLevel[0] = 0x04; - - char connectFlags[1]; - connectFlags[0] = 0; - if (cleanSession) connectFlags[0] |= AsyncMqttClientInternals::ConnectFlag.CLEAN_SESSION; - if (username != nullptr) connectFlags[0] |= AsyncMqttClientInternals::ConnectFlag.USERNAME; - if (password != nullptr) connectFlags[0] |= AsyncMqttClientInternals::ConnectFlag.PASSWORD; - if (willTopic != nullptr) { - connectFlags[0] |= AsyncMqttClientInternals::ConnectFlag.WILL; - if (willRetain) connectFlags[0] |= AsyncMqttClientInternals::ConnectFlag.WILL_RETAIN; - switch (willQos) { - case 0: - connectFlags[0] |= AsyncMqttClientInternals::ConnectFlag.WILL_QOS0; - break; - case 1: - connectFlags[0] |= AsyncMqttClientInternals::ConnectFlag.WILL_QOS1; - break; - case 2: - connectFlags[0] |= AsyncMqttClientInternals::ConnectFlag.WILL_QOS2; - break; - } - } - - char keepAliveBytes[2]; - keepAliveBytes[0] = keepAlive >> 8; - keepAliveBytes[1] = keepAlive & 0xFF; - - uint16_t clientIdLength = strlen(clientId); - char clientIdLengthBytes[2]; - clientIdLengthBytes[0] = clientIdLength >> 8; - clientIdLengthBytes[1] = clientIdLength & 0xFF; - - // Optional fields - uint16_t willTopicLength = 0; - char willTopicLengthBytes[2]; - char willPayloadLengthBytes[2]; - if (willTopic != nullptr) { - willTopicLength = strlen(willTopic); - willTopicLengthBytes[0] = willTopicLength >> 8; - willTopicLengthBytes[1] = willTopicLength & 0xFF; - - if (willPayload != nullptr && willPayloadLength == 0) willPayloadLength = strlen(willPayload); - - willPayloadLengthBytes[0] = willPayloadLength >> 8; - willPayloadLengthBytes[1] = willPayloadLength & 0xFF; - } - - uint16_t usernameLength = 0; - char usernameLengthBytes[2]; - if (username != nullptr) { - usernameLength = strlen(username); - usernameLengthBytes[0] = usernameLength >> 8; - usernameLengthBytes[1] = usernameLength & 0xFF; - } - - uint16_t passwordLength = 0; - char passwordLengthBytes[2]; - if (password != nullptr) { - passwordLength = strlen(password); - passwordLengthBytes[0] = passwordLength >> 8; - passwordLengthBytes[1] = passwordLength & 0xFF; - } - - uint32_t remainingLength = 2 + protocolNameLength + 1 + 1 + 2 + 2 + clientIdLength; // always present - if (willTopic != nullptr) remainingLength += 2 + willTopicLength + 2 + willPayloadLength; - if (username != nullptr) remainingLength += 2 + usernameLength; - if (password != nullptr) remainingLength += 2 + passwordLength; - uint8_t remainingLengthLength = AsyncMqttClientInternals::Helpers::encodeRemainingLength(remainingLength, fixedHeader + 1); - - uint32_t neededSpace = 1 + remainingLengthLength; - neededSpace += 2; - neededSpace += protocolNameLength; - neededSpace += 1; - neededSpace += 1; - neededSpace += 2; - neededSpace += 2; - neededSpace += clientIdLength; - if (willTopic != nullptr) { - neededSpace += 2; - neededSpace += willTopicLength; - - neededSpace += 2; - if (willPayload != nullptr) neededSpace += willPayloadLength; - } - if (username != nullptr) { - neededSpace += 2; - neededSpace += usernameLength; - } - if (password != nullptr) { - neededSpace += 2; - neededSpace += passwordLength; - } - - _data.reserve(neededSpace); - - _data.insert(_data.end(), fixedHeader, fixedHeader + 1 + remainingLengthLength); - - _data.push_back(protocolNameLengthBytes[0]); - _data.push_back(protocolNameLengthBytes[1]); - - _data.push_back('M'); - _data.push_back('Q'); - _data.push_back('T'); - _data.push_back('T'); - - _data.push_back(protocolLevel[0]); - _data.push_back(connectFlags[0]); - _data.push_back(keepAliveBytes[0]); - _data.push_back(keepAliveBytes[1]); - _data.push_back(clientIdLengthBytes[0]); - _data.push_back(clientIdLengthBytes[1]); - - _data.insert(_data.end(), clientId, clientId + clientIdLength); - if (willTopic != nullptr) { - _data.insert(_data.end(), willTopicLengthBytes, willTopicLengthBytes + 2); - _data.insert(_data.end(), willTopic, willTopic + willTopicLength); - - _data.insert(_data.end(), willPayloadLengthBytes, willPayloadLengthBytes + 2); - if (willPayload != nullptr) _data.insert(_data.end(), willPayload, willPayload + willPayloadLength); - } - if (username != nullptr) { - _data.insert(_data.end(), usernameLengthBytes, usernameLengthBytes + 2); - _data.insert(_data.end(), username, username + usernameLength); - } - if (password != nullptr) { - _data.insert(_data.end(), passwordLengthBytes, passwordLengthBytes + 2); - _data.insert(_data.end(), password, password + passwordLength); - } -} - -const uint8_t* ConnectOutPacket::data(size_t index) const { - return &_data.data()[index]; -} - -size_t ConnectOutPacket::size() const { - return _data.size(); -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Connect.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Connect.hpp deleted file mode 100644 index 5b17632fd..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Connect.hpp +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once - -#include -#include // strlen - -#include "OutPacket.hpp" -#include "../../Flags.hpp" -#include "../../Helpers.hpp" - -namespace AsyncMqttClientInternals { -class ConnectOutPacket : public OutPacket { - public: - ConnectOutPacket(bool cleanSession, - const char* username, - const char* password, - const char* willTopic, - bool willRetain, - uint8_t willQos, - const char* willPayload, - uint16_t willPayloadLength, - uint16_t keepAlive, - const char* clientId); - const uint8_t* data(size_t index = 0) const; - size_t size() const; - - private: - std::vector _data; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Disconn.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Disconn.cpp deleted file mode 100644 index 3e2890df1..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Disconn.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "Disconn.hpp" - -using AsyncMqttClientInternals::DisconnOutPacket; - -DisconnOutPacket::DisconnOutPacket() { - _data[0] = AsyncMqttClientInternals::PacketType.DISCONNECT; - _data[0] = _data[0] << 4; - _data[0] = _data[0] | AsyncMqttClientInternals::HeaderFlag.DISCONNECT_RESERVED; - _data[1] = 0; -} - -const uint8_t* DisconnOutPacket::data(size_t index) const { - return &_data[index]; -} - -size_t DisconnOutPacket::size() const { - return 2; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Disconn.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Disconn.hpp deleted file mode 100644 index 38dc9152f..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Disconn.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "OutPacket.hpp" -#include "../../Flags.hpp" -#include "../../Helpers.hpp" - -namespace AsyncMqttClientInternals { -class DisconnOutPacket : public OutPacket { - public: - DisconnOutPacket(); - const uint8_t* data(size_t index = 0) const; - size_t size() const; - - private: - uint8_t _data[2]; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/OutPacket.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/OutPacket.cpp deleted file mode 100644 index e69a87f8f..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/OutPacket.cpp +++ /dev/null @@ -1,44 +0,0 @@ -#include "OutPacket.hpp" - -using AsyncMqttClientInternals::OutPacket; - -OutPacket::OutPacket() -: next(nullptr) -, timeout(0) -, noTries(0) -, _released(true) -, _packetId(0) {} - -OutPacket::~OutPacket() {} - -bool OutPacket::released() const { - return _released; -} - -uint8_t OutPacket::packetType() const { - return data(0)[0] >> 4; -} - -uint16_t OutPacket::packetId() const { - return _packetId; -} - -uint8_t OutPacket::qos() const { - if (packetType() == AsyncMqttClientInternals::PacketType.PUBLISH) { - return (data()[1] & 0x06) >> 1; - } - return 0; -} - -void OutPacket::release() { - _released = true; -} - -uint16_t OutPacket::_nextPacketId = 0; - -uint16_t OutPacket::_getNextPacketId() { - if (++_nextPacketId == 0) { - ++_nextPacketId; - } - return _nextPacketId; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/OutPacket.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/OutPacket.hpp deleted file mode 100644 index 52c37de0b..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/OutPacket.hpp +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once - -#include // uint*_t -#include // size_t -#include // std::min - -#include "../../Flags.hpp" - -namespace AsyncMqttClientInternals { -class OutPacket { - public: - OutPacket(); - virtual ~OutPacket(); - virtual const uint8_t* data(size_t index = 0) const = 0; - virtual size_t size() const = 0; - bool released() const; - uint8_t packetType() const; - uint16_t packetId() const; - uint8_t qos() const; - void release(); - - public: - OutPacket* next; - uint32_t timeout; - uint8_t noTries; - - protected: - static uint16_t _getNextPacketId(); - bool _released; - uint16_t _packetId; - - private: - static uint16_t _nextPacketId; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PingReq.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PingReq.cpp deleted file mode 100644 index d59cf3dc1..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PingReq.cpp +++ /dev/null @@ -1,18 +0,0 @@ -#include "PingReq.hpp" - -using AsyncMqttClientInternals::PingReqOutPacket; - -PingReqOutPacket::PingReqOutPacket() { - _data[0] = AsyncMqttClientInternals::PacketType.PINGREQ; - _data[0] = _data[0] << 4; - _data[0] = _data[0] | AsyncMqttClientInternals::HeaderFlag.PINGREQ_RESERVED; - _data[1] = 0; -} - -const uint8_t* PingReqOutPacket::data(size_t index) const { - return &_data[index];; -} - -size_t PingReqOutPacket::size() const { - return 2; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PingReq.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PingReq.hpp deleted file mode 100644 index 1cb19a39e..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PingReq.hpp +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -#include "OutPacket.hpp" -#include "../../Flags.hpp" -#include "../../Helpers.hpp" - -namespace AsyncMqttClientInternals { -class PingReqOutPacket : public OutPacket { - public: - PingReqOutPacket(); - const uint8_t* data(size_t index = 0) const; - size_t size() const; - - private: - uint8_t _data[2]; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PubAck.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PubAck.cpp deleted file mode 100644 index 634607ba5..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PubAck.cpp +++ /dev/null @@ -1,25 +0,0 @@ -#include "PubAck.hpp" - -using AsyncMqttClientInternals::PubAckOutPacket; - -PubAckOutPacket::PubAckOutPacket(PendingAck pendingAck) { - _data[0] = pendingAck.packetType; - _data[0] = _data[0] << 4; - _data[0] = _data[0] | pendingAck.headerFlag; - _data[1] = 2; - _packetId = pendingAck.packetId; - _data[2] = pendingAck.packetId >> 8; - _data[3] = pendingAck.packetId & 0xFF; - if (packetType() == AsyncMqttClientInternals::PacketType.PUBREL || - packetType() == AsyncMqttClientInternals::PacketType.PUBREC) { - _released = false; - } -} - -const uint8_t* PubAckOutPacket::data(size_t index) const { - return &_data[index]; -} - -size_t PubAckOutPacket::size() const { - return 4; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PubAck.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PubAck.hpp deleted file mode 100644 index 9cd830ee4..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/PubAck.hpp +++ /dev/null @@ -1,18 +0,0 @@ -#pragma once - -#include "OutPacket.hpp" -#include "../../Flags.hpp" -#include "../../Helpers.hpp" -#include "../../Storage.hpp" - -namespace AsyncMqttClientInternals { -class PubAckOutPacket : public OutPacket { - public: - explicit PubAckOutPacket(PendingAck pendingAck); - const uint8_t* data(size_t index = 0) const; - size_t size() const; - - private: - uint8_t _data[4]; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Publish.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Publish.cpp deleted file mode 100644 index 3f4365b2d..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Publish.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "Publish.hpp" - -using AsyncMqttClientInternals::PublishOutPacket; - -PublishOutPacket::PublishOutPacket(const char* topic, uint8_t qos, bool retain, const char* payload, size_t length) { - char fixedHeader[5]; - fixedHeader[0] = AsyncMqttClientInternals::PacketType.PUBLISH; - fixedHeader[0] = fixedHeader[0] << 4; - // if (dup) fixedHeader[0] |= AsyncMqttClientInternals::HeaderFlag.PUBLISH_DUP; - if (retain) fixedHeader[0] |= AsyncMqttClientInternals::HeaderFlag.PUBLISH_RETAIN; - switch (qos) { - case 0: - fixedHeader[0] |= AsyncMqttClientInternals::HeaderFlag.PUBLISH_QOS0; - break; - case 1: - fixedHeader[0] |= AsyncMqttClientInternals::HeaderFlag.PUBLISH_QOS1; - break; - case 2: - fixedHeader[0] |= AsyncMqttClientInternals::HeaderFlag.PUBLISH_QOS2; - break; - } - - uint16_t topicLength = strlen(topic); - char topicLengthBytes[2]; - topicLengthBytes[0] = topicLength >> 8; - topicLengthBytes[1] = topicLength & 0xFF; - - uint32_t payloadLength = length; - if (payload != nullptr && payloadLength == 0) payloadLength = strlen(payload); - - uint32_t remainingLength = 2 + topicLength + payloadLength; - if (qos != 0) remainingLength += 2; - uint8_t remainingLengthLength = AsyncMqttClientInternals::Helpers::encodeRemainingLength(remainingLength, fixedHeader + 1); - - size_t neededSpace = 0; - neededSpace += 1 + remainingLengthLength; - neededSpace += 2; - neededSpace += topicLength; - if (qos != 0) neededSpace += 2; - if (payload != nullptr) neededSpace += payloadLength; - - _data.reserve(neededSpace); - - _packetId = (qos !=0) ? _getNextPacketId() : 1; - char packetIdBytes[2]; - packetIdBytes[0] = _packetId >> 8; - packetIdBytes[1] = _packetId & 0xFF; - - _data.insert(_data.end(), fixedHeader, fixedHeader + 1 + remainingLengthLength); - _data.insert(_data.end(), topicLengthBytes, topicLengthBytes + 2); - _data.insert(_data.end(), topic, topic + topicLength); - if (qos != 0) { - _data.insert(_data.end(), packetIdBytes, packetIdBytes + 2); - _released = false; - } - if (payload != nullptr) _data.insert(_data.end(), payload, payload + payloadLength); -} - -const uint8_t* PublishOutPacket::data(size_t index) const { - return &_data.data()[index]; -} - -size_t PublishOutPacket::size() const { - return _data.size(); -} - -void PublishOutPacket::setDup() { - _data[0] |= AsyncMqttClientInternals::HeaderFlag.PUBLISH_DUP; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Publish.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Publish.hpp deleted file mode 100644 index 6b8272ec9..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Publish.hpp +++ /dev/null @@ -1,23 +0,0 @@ -#pragma once - -#include // strlen -#include - -#include "OutPacket.hpp" -#include "../../Flags.hpp" -#include "../../Helpers.hpp" -#include "../../Storage.hpp" - -namespace AsyncMqttClientInternals { -class PublishOutPacket : public OutPacket { - public: - PublishOutPacket(const char* topic, uint8_t qos, bool retain, const char* payload, size_t length); - const uint8_t* data(size_t index = 0) const; - size_t size() const; - - void setDup(); // you cannot unset dup - - private: - std::vector _data; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Subscribe.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Subscribe.cpp deleted file mode 100644 index 85c10db4b..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Subscribe.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "Subscribe.hpp" - -using AsyncMqttClientInternals::SubscribeOutPacket; - -SubscribeOutPacket::SubscribeOutPacket(const char* topic, uint8_t qos) { - char fixedHeader[5]; - fixedHeader[0] = AsyncMqttClientInternals::PacketType.SUBSCRIBE; - fixedHeader[0] = fixedHeader[0] << 4; - fixedHeader[0] = fixedHeader[0] | AsyncMqttClientInternals::HeaderFlag.SUBSCRIBE_RESERVED; - - uint16_t topicLength = strlen(topic); - char topicLengthBytes[2]; - topicLengthBytes[0] = topicLength >> 8; - topicLengthBytes[1] = topicLength & 0xFF; - - char qosByte[1]; - qosByte[0] = qos; - - uint8_t remainingLengthLength = AsyncMqttClientInternals::Helpers::encodeRemainingLength(2 + 2 + topicLength + 1, fixedHeader + 1); - - size_t neededSpace = 0; - neededSpace += 1 + remainingLengthLength; - neededSpace += 2; - neededSpace += 2; - neededSpace += topicLength; - neededSpace += 1; - - _data.reserve(neededSpace); - - _packetId = _getNextPacketId(); - char packetIdBytes[2]; - packetIdBytes[0] = _packetId >> 8; - packetIdBytes[1] = _packetId & 0xFF; - - _data.insert(_data.end(), fixedHeader, fixedHeader + 1 + remainingLengthLength); - _data.insert(_data.end(), packetIdBytes, packetIdBytes + 2); - _data.insert(_data.end(), topicLengthBytes, topicLengthBytes + 2); - _data.insert(_data.end(), topic, topic + topicLength); - _data.push_back(qosByte[0]); - _released = false; -} - -const uint8_t* SubscribeOutPacket::data(size_t index) const { - return &_data.data()[index]; -} - -size_t SubscribeOutPacket::size() const { - return _data.size(); -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Subscribe.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Subscribe.hpp deleted file mode 100644 index 1f85f5913..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Subscribe.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include // strlen -#include - -#include "OutPacket.hpp" -#include "../../Flags.hpp" -#include "../../Helpers.hpp" -#include "../../Storage.hpp" - -namespace AsyncMqttClientInternals { -class SubscribeOutPacket : public OutPacket { - public: - SubscribeOutPacket(const char* topic, uint8_t qos); - const uint8_t* data(size_t index = 0) const; - size_t size() const; - - private: - std::vector _data; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Unsubscribe.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Unsubscribe.cpp deleted file mode 100644 index 4d859c9a4..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Unsubscribe.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "Unsubscribe.hpp" - -using AsyncMqttClientInternals::UnsubscribeOutPacket; - -UnsubscribeOutPacket::UnsubscribeOutPacket(const char* topic) { - char fixedHeader[5]; - fixedHeader[0] = AsyncMqttClientInternals::PacketType.UNSUBSCRIBE; - fixedHeader[0] = fixedHeader[0] << 4; - fixedHeader[0] = fixedHeader[0] | AsyncMqttClientInternals::HeaderFlag.UNSUBSCRIBE_RESERVED; - - uint16_t topicLength = strlen(topic); - char topicLengthBytes[2]; - topicLengthBytes[0] = topicLength >> 8; - topicLengthBytes[1] = topicLength & 0xFF; - - uint8_t remainingLengthLength = AsyncMqttClientInternals::Helpers::encodeRemainingLength(2 + 2 + topicLength, fixedHeader + 1); - - size_t neededSpace = 0; - neededSpace += 1 + remainingLengthLength; - neededSpace += 2; - neededSpace += 2; - neededSpace += topicLength; - - _packetId = _getNextPacketId(); - char packetIdBytes[2]; - packetIdBytes[0] = _packetId >> 8; - packetIdBytes[1] = _packetId & 0xFF; - - _data.insert(_data.end(), fixedHeader, fixedHeader + 1 + remainingLengthLength); - _data.insert(_data.end(), packetIdBytes, packetIdBytes + 2); - _data.insert(_data.end(), topicLengthBytes, topicLengthBytes + 2); - _data.insert(_data.end(), topic, topic + topicLength); - _released = false; -} - -const uint8_t* UnsubscribeOutPacket::data(size_t index) const { - return &_data.data()[index]; -} - -size_t UnsubscribeOutPacket::size() const { - return _data.size(); -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Unsubscribe.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Unsubscribe.hpp deleted file mode 100644 index 621802f6f..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Out/Unsubscribe.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include // strlen -#include - -#include "OutPacket.hpp" -#include "../../Flags.hpp" -#include "../../Helpers.hpp" -#include "../../Storage.hpp" - -namespace AsyncMqttClientInternals { -class UnsubscribeOutPacket : public OutPacket { - public: - explicit UnsubscribeOutPacket(const char* topic); - const uint8_t* data(size_t index = 0) const; - size_t size() const; - - private: - std::vector _data; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Packet.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Packet.hpp deleted file mode 100644 index e8dfdfba4..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/Packet.hpp +++ /dev/null @@ -1,11 +0,0 @@ -#pragma once - -namespace AsyncMqttClientInternals { -class Packet { - public: - virtual ~Packet() {} - - virtual void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) = 0; - virtual void parsePayload(char* data, size_t len, size_t* currentBytePosition) = 0; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PingRespPacket.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PingRespPacket.cpp deleted file mode 100644 index 4aa4db892..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PingRespPacket.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "PingRespPacket.hpp" - -using AsyncMqttClientInternals::PingRespPacket; - -PingRespPacket::PingRespPacket(ParsingInformation* parsingInformation, OnPingRespInternalCallback callback) -: _parsingInformation(parsingInformation) -, _callback(callback) { -} - -PingRespPacket::~PingRespPacket() { -} - -void PingRespPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { - (void)data; - (void)currentBytePosition; -} - -void PingRespPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { - (void)data; - (void)currentBytePosition; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PingRespPacket.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PingRespPacket.hpp deleted file mode 100644 index 098049adb..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PingRespPacket.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "Packet.hpp" -#include "../ParsingInformation.hpp" -#include "../Callbacks.hpp" - -namespace AsyncMqttClientInternals { -class PingRespPacket : public Packet { - public: - explicit PingRespPacket(ParsingInformation* parsingInformation, OnPingRespInternalCallback callback); - ~PingRespPacket(); - - void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); - void parsePayload(char* data, size_t len, size_t* currentBytePosition); - - private: - ParsingInformation* _parsingInformation; - OnPingRespInternalCallback _callback; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubAckPacket.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubAckPacket.cpp deleted file mode 100644 index 66e303b9d..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubAckPacket.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "PubAckPacket.hpp" - -using AsyncMqttClientInternals::PubAckPacket; - -PubAckPacket::PubAckPacket(ParsingInformation* parsingInformation, OnPubAckInternalCallback callback) -: _parsingInformation(parsingInformation) -, _callback(callback) -, _bytePosition(0) -, _packetIdMsb(0) -, _packetId(0) { -} - -PubAckPacket::~PubAckPacket() { -} - -void PubAckPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { - char currentByte = data[(*currentBytePosition)++]; - if (_bytePosition++ == 0) { - _packetIdMsb = currentByte; - } else { - _packetId = currentByte | _packetIdMsb << 8; - _parsingInformation->bufferState = BufferState::NONE; - _callback(_packetId); - } -} - -void PubAckPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { - (void)data; - (void)currentBytePosition; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubAckPacket.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubAckPacket.hpp deleted file mode 100644 index ea8a526a7..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubAckPacket.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "Packet.hpp" -#include "../ParsingInformation.hpp" -#include "../Callbacks.hpp" - -namespace AsyncMqttClientInternals { -class PubAckPacket : public Packet { - public: - explicit PubAckPacket(ParsingInformation* parsingInformation, OnPubAckInternalCallback callback); - ~PubAckPacket(); - - void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); - void parsePayload(char* data, size_t len, size_t* currentBytePosition); - - private: - ParsingInformation* _parsingInformation; - OnPubAckInternalCallback _callback; - - uint8_t _bytePosition; - char _packetIdMsb; - uint16_t _packetId; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubCompPacket.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubCompPacket.cpp deleted file mode 100644 index b845d2367..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubCompPacket.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "PubCompPacket.hpp" - -using AsyncMqttClientInternals::PubCompPacket; - -PubCompPacket::PubCompPacket(ParsingInformation* parsingInformation, OnPubCompInternalCallback callback) -: _parsingInformation(parsingInformation) -, _callback(callback) -, _bytePosition(0) -, _packetIdMsb(0) -, _packetId(0) { -} - -PubCompPacket::~PubCompPacket() { -} - -void PubCompPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { - char currentByte = data[(*currentBytePosition)++]; - if (_bytePosition++ == 0) { - _packetIdMsb = currentByte; - } else { - _packetId = currentByte | _packetIdMsb << 8; - _parsingInformation->bufferState = BufferState::NONE; - _callback(_packetId); - } -} - -void PubCompPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { - (void)data; - (void)currentBytePosition; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubCompPacket.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubCompPacket.hpp deleted file mode 100644 index b6aaaa96e..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubCompPacket.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "Packet.hpp" -#include "../ParsingInformation.hpp" -#include "../Callbacks.hpp" - -namespace AsyncMqttClientInternals { -class PubCompPacket : public Packet { - public: - explicit PubCompPacket(ParsingInformation* parsingInformation, OnPubCompInternalCallback callback); - ~PubCompPacket(); - - void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); - void parsePayload(char* data, size_t len, size_t* currentBytePosition); - - private: - ParsingInformation* _parsingInformation; - OnPubCompInternalCallback _callback; - - uint8_t _bytePosition; - char _packetIdMsb; - uint16_t _packetId; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRecPacket.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRecPacket.cpp deleted file mode 100644 index 8e19135b6..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRecPacket.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "PubRecPacket.hpp" - -using AsyncMqttClientInternals::PubRecPacket; - -PubRecPacket::PubRecPacket(ParsingInformation* parsingInformation, OnPubRecInternalCallback callback) -: _parsingInformation(parsingInformation) -, _callback(callback) -, _bytePosition(0) -, _packetIdMsb(0) -, _packetId(0) { -} - -PubRecPacket::~PubRecPacket() { -} - -void PubRecPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { - char currentByte = data[(*currentBytePosition)++]; - if (_bytePosition++ == 0) { - _packetIdMsb = currentByte; - } else { - _packetId = currentByte | _packetIdMsb << 8; - _parsingInformation->bufferState = BufferState::NONE; - _callback(_packetId); - } -} - -void PubRecPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { - (void)data; - (void)currentBytePosition; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRecPacket.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRecPacket.hpp deleted file mode 100644 index 09e2d77af..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRecPacket.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "Packet.hpp" -#include "../ParsingInformation.hpp" -#include "../Callbacks.hpp" - -namespace AsyncMqttClientInternals { -class PubRecPacket : public Packet { - public: - explicit PubRecPacket(ParsingInformation* parsingInformation, OnPubRecInternalCallback callback); - ~PubRecPacket(); - - void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); - void parsePayload(char* data, size_t len, size_t* currentBytePosition); - - private: - ParsingInformation* _parsingInformation; - OnPubRecInternalCallback _callback; - - uint8_t _bytePosition; - char _packetIdMsb; - uint16_t _packetId; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRelPacket.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRelPacket.cpp deleted file mode 100644 index 8a1f2d468..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRelPacket.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "PubRelPacket.hpp" - -using AsyncMqttClientInternals::PubRelPacket; - -PubRelPacket::PubRelPacket(ParsingInformation* parsingInformation, OnPubRelInternalCallback callback) -: _parsingInformation(parsingInformation) -, _callback(callback) -, _bytePosition(0) -, _packetIdMsb(0) -, _packetId(0) { -} - -PubRelPacket::~PubRelPacket() { -} - -void PubRelPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { - char currentByte = data[(*currentBytePosition)++]; - if (_bytePosition++ == 0) { - _packetIdMsb = currentByte; - } else { - _packetId = currentByte | _packetIdMsb << 8; - _parsingInformation->bufferState = BufferState::NONE; - _callback(_packetId); - } -} - -void PubRelPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { - (void)data; - (void)currentBytePosition; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRelPacket.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRelPacket.hpp deleted file mode 100644 index 96e9af720..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PubRelPacket.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "Packet.hpp" -#include "../ParsingInformation.hpp" -#include "../Callbacks.hpp" - -namespace AsyncMqttClientInternals { -class PubRelPacket : public Packet { - public: - explicit PubRelPacket(ParsingInformation* parsingInformation, OnPubRelInternalCallback callback); - ~PubRelPacket(); - - void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); - void parsePayload(char* data, size_t len, size_t* currentBytePosition); - - private: - ParsingInformation* _parsingInformation; - OnPubRelInternalCallback _callback; - - uint8_t _bytePosition; - char _packetIdMsb; - uint16_t _packetId; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PublishPacket.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PublishPacket.cpp deleted file mode 100644 index 2c5192f0c..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PublishPacket.cpp +++ /dev/null @@ -1,91 +0,0 @@ -#include "PublishPacket.hpp" - -using AsyncMqttClientInternals::PublishPacket; - -PublishPacket::PublishPacket(ParsingInformation* parsingInformation, OnMessageInternalCallback dataCallback, OnPublishInternalCallback completeCallback) -: _parsingInformation(parsingInformation) -, _dataCallback(dataCallback) -, _completeCallback(completeCallback) -, _dup(false) -, _qos(0) -, _retain(0) -, _bytePosition(0) -, _topicLengthMsb(0) -, _topicLength(0) -, _ignore(false) -, _packetIdMsb(0) -, _packetId(0) -, _payloadLength(0) -, _payloadBytesRead(0) { - _dup = _parsingInformation->packetFlags & HeaderFlag.PUBLISH_DUP; - _retain = _parsingInformation->packetFlags & HeaderFlag.PUBLISH_RETAIN; - char qosMasked = _parsingInformation->packetFlags & 0x06; - switch (qosMasked) { - case HeaderFlag.PUBLISH_QOS0: - _qos = 0; - break; - case HeaderFlag.PUBLISH_QOS1: - _qos = 1; - break; - case HeaderFlag.PUBLISH_QOS2: - _qos = 2; - break; - } -} - -PublishPacket::~PublishPacket() { -} - -void PublishPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { - char currentByte = data[(*currentBytePosition)++]; - if (_bytePosition == 0) { - _topicLengthMsb = currentByte; - } else if (_bytePosition == 1) { - _topicLength = currentByte | _topicLengthMsb << 8; - if (_topicLength > _parsingInformation->maxTopicLength) { - _ignore = true; - } else { - _parsingInformation->topicBuffer[_topicLength] = '\0'; - } - } else if (_bytePosition >= 2 && _bytePosition < 2 + _topicLength) { - // Starting from here, _ignore might be true - if (!_ignore) _parsingInformation->topicBuffer[_bytePosition - 2] = currentByte; - if (_bytePosition == 2 + _topicLength - 1 && _qos == 0) { - _preparePayloadHandling(_parsingInformation->remainingLength - (_bytePosition + 1)); - return; - } - } else if (_bytePosition == 2 + _topicLength) { - _packetIdMsb = currentByte; - } else { - _packetId = currentByte | _packetIdMsb << 8; - _preparePayloadHandling(_parsingInformation->remainingLength - (_bytePosition + 1)); - } - _bytePosition++; -} - -void PublishPacket::_preparePayloadHandling(uint32_t payloadLength) { - _payloadLength = payloadLength; - if (payloadLength == 0) { - _parsingInformation->bufferState = BufferState::NONE; - if (!_ignore) { - _dataCallback(_parsingInformation->topicBuffer, nullptr, _qos, _dup, _retain, 0, 0, 0, _packetId); - _completeCallback(_packetId, _qos); - } - } else { - _parsingInformation->bufferState = BufferState::PAYLOAD; - } -} - -void PublishPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { - size_t remainToRead = len - (*currentBytePosition); - if (_payloadBytesRead + remainToRead > _payloadLength) remainToRead = _payloadLength - _payloadBytesRead; - - if (!_ignore) _dataCallback(_parsingInformation->topicBuffer, data + (*currentBytePosition), _qos, _dup, _retain, remainToRead, _payloadBytesRead, _payloadLength, _packetId); - _payloadBytesRead += remainToRead; - (*currentBytePosition) += remainToRead; - - if (_payloadBytesRead == _payloadLength) { - _parsingInformation->bufferState = BufferState::NONE; - if (!_ignore) _completeCallback(_packetId, _qos); - } -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PublishPacket.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PublishPacket.hpp deleted file mode 100644 index d97205ce1..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/PublishPacket.hpp +++ /dev/null @@ -1,38 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "Packet.hpp" -#include "../Flags.hpp" -#include "../ParsingInformation.hpp" -#include "../Callbacks.hpp" - -namespace AsyncMqttClientInternals { -class PublishPacket : public Packet { - public: - explicit PublishPacket(ParsingInformation* parsingInformation, OnMessageInternalCallback dataCallback, OnPublishInternalCallback completeCallback); - ~PublishPacket(); - - void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); - void parsePayload(char* data, size_t len, size_t* currentBytePosition); - - private: - ParsingInformation* _parsingInformation; - OnMessageInternalCallback _dataCallback; - OnPublishInternalCallback _completeCallback; - - void _preparePayloadHandling(uint32_t payloadLength); - - bool _dup; - uint8_t _qos; - bool _retain; - - uint8_t _bytePosition; - char _topicLengthMsb; - uint16_t _topicLength; - bool _ignore; - char _packetIdMsb; - uint16_t _packetId; - uint32_t _payloadLength; - uint32_t _payloadBytesRead; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/SubAckPacket.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/SubAckPacket.cpp deleted file mode 100644 index 724f05fab..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/SubAckPacket.cpp +++ /dev/null @@ -1,46 +0,0 @@ -#include "SubAckPacket.hpp" - -using AsyncMqttClientInternals::SubAckPacket; - -SubAckPacket::SubAckPacket(ParsingInformation* parsingInformation, OnSubAckInternalCallback callback) -: _parsingInformation(parsingInformation) -, _callback(callback) -, _bytePosition(0) -, _packetIdMsb(0) -, _packetId(0) { -} - -SubAckPacket::~SubAckPacket() { -} - -void SubAckPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { - char currentByte = data[(*currentBytePosition)++]; - if (_bytePosition++ == 0) { - _packetIdMsb = currentByte; - } else { - _packetId = currentByte | _packetIdMsb << 8; - _parsingInformation->bufferState = BufferState::PAYLOAD; - } -} - -void SubAckPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { - char status = data[(*currentBytePosition)++]; - - /* switch (status) { - case 0: - Serial.println("Success QoS 0"); - break; - case 1: - Serial.println("Success QoS 1"); - break; - case 2: - Serial.println("Success QoS 2"); - break; - case 0x80: - Serial.println("Failure"); - break; - } */ - - _parsingInformation->bufferState = BufferState::NONE; - _callback(_packetId, status); -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/SubAckPacket.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/SubAckPacket.hpp deleted file mode 100644 index 26077c23d..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/SubAckPacket.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "Packet.hpp" -#include "../ParsingInformation.hpp" -#include "../Callbacks.hpp" - -namespace AsyncMqttClientInternals { -class SubAckPacket : public Packet { - public: - explicit SubAckPacket(ParsingInformation* parsingInformation, OnSubAckInternalCallback callback); - ~SubAckPacket(); - - void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); - void parsePayload(char* data, size_t len, size_t* currentBytePosition); - - private: - ParsingInformation* _parsingInformation; - OnSubAckInternalCallback _callback; - - uint8_t _bytePosition; - char _packetIdMsb; - uint16_t _packetId; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/UnsubAckPacket.cpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/UnsubAckPacket.cpp deleted file mode 100644 index 3c0ed7424..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/UnsubAckPacket.cpp +++ /dev/null @@ -1,30 +0,0 @@ -#include "UnsubAckPacket.hpp" - -using AsyncMqttClientInternals::UnsubAckPacket; - -UnsubAckPacket::UnsubAckPacket(ParsingInformation* parsingInformation, OnUnsubAckInternalCallback callback) -: _parsingInformation(parsingInformation) -, _callback(callback) -, _bytePosition(0) -, _packetIdMsb(0) -, _packetId(0) { -} - -UnsubAckPacket::~UnsubAckPacket() { -} - -void UnsubAckPacket::parseVariableHeader(char* data, size_t len, size_t* currentBytePosition) { - char currentByte = data[(*currentBytePosition)++]; - if (_bytePosition++ == 0) { - _packetIdMsb = currentByte; - } else { - _packetId = currentByte | _packetIdMsb << 8; - _parsingInformation->bufferState = BufferState::NONE; - _callback(_packetId); - } -} - -void UnsubAckPacket::parsePayload(char* data, size_t len, size_t* currentBytePosition) { - (void)data; - (void)currentBytePosition; -} diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/UnsubAckPacket.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Packets/UnsubAckPacket.hpp deleted file mode 100644 index 9c17c2d02..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Packets/UnsubAckPacket.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once - -#include "Arduino.h" -#include "Packet.hpp" -#include "../ParsingInformation.hpp" -#include "../Callbacks.hpp" - -namespace AsyncMqttClientInternals { -class UnsubAckPacket : public Packet { - public: - explicit UnsubAckPacket(ParsingInformation* parsingInformation, OnUnsubAckInternalCallback callback); - ~UnsubAckPacket(); - - void parseVariableHeader(char* data, size_t len, size_t* currentBytePosition); - void parsePayload(char* data, size_t len, size_t* currentBytePosition); - - private: - ParsingInformation* _parsingInformation; - OnUnsubAckInternalCallback _callback; - - uint8_t _bytePosition; - char _packetIdMsb; - uint16_t _packetId; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/ParsingInformation.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/ParsingInformation.hpp deleted file mode 100644 index a14640cb3..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/ParsingInformation.hpp +++ /dev/null @@ -1,21 +0,0 @@ -#pragma once - -namespace AsyncMqttClientInternals { -enum class BufferState : uint8_t { - NONE = 0, - REMAINING_LENGTH = 2, - VARIABLE_HEADER = 3, - PAYLOAD = 4 -}; - -struct ParsingInformation { - BufferState bufferState; - - uint16_t maxTopicLength; - char* topicBuffer; - - uint8_t packetType; - uint16_t packetFlags; - uint32_t remainingLength; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Storage.hpp b/lib/async-mqtt-client/src/AsyncMqttClient/Storage.hpp deleted file mode 100644 index 725307b7f..000000000 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Storage.hpp +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -namespace AsyncMqttClientInternals { -struct PendingPubRel { - uint16_t packetId; -}; - -struct PendingAck { - uint8_t packetType; - uint8_t headerFlag; - uint16_t packetId; -}; -} // namespace AsyncMqttClientInternals diff --git a/lib/async-mqtt-client/LICENSE b/lib/espMqttClient/LICENSE similarity index 94% rename from lib/async-mqtt-client/LICENSE rename to lib/espMqttClient/LICENSE index a3ee21720..1cc5546f9 100644 --- a/lib/async-mqtt-client/LICENSE +++ b/lib/espMqttClient/LICENSE @@ -1,6 +1,6 @@ -The MIT License (MIT) +MIT License -Copyright (c) 2015-2021 Marvin Roger +Copyright (c) 2022 Bert Melis Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/lib/espMqttClient/README.md b/lib/espMqttClient/README.md new file mode 100644 index 000000000..586d3339e --- /dev/null +++ b/lib/espMqttClient/README.md @@ -0,0 +1,54 @@ +# espMqttClient + +MQTT client library for the Espressif devices ESP8266 and ESP32 on the Arduino framework. +Aims to be a non-blocking, fully compliant MQTT 3.1.1 client. + +![platformio](https://github.com/bertmelis/espMqttClient/actions/workflows/build_platformio.yml/badge.svg) +![cpplint](https://github.com/bertmelis/espMqttClient/actions/workflows/cpplint.yml/badge.svg) +![cppcheck](https://github.com/bertmelis/espMqttClient/actions/workflows/cppcheck.yml/badge.svg) +[![PlatformIO Registry](https://badges.registry.platformio.org/packages/bertmelis/library/espMqttClient.svg)](https://registry.platformio.org/libraries/bertmelis/espMqttClient) + +# Features + +- MQTT 3.1.1 compliant library +- Sending and receiving at all QoS levels +- TCP and TCP/TLS using standard WiFiClient and WiFiClientSecure connections +- Virtually unlimited incoming and outgoing payload sizes +- Readable and understandable code +- Fully async clients available via [AsyncTCP](https://github.com/me-no-dev/AsyncTCP) or [ESPAsnycTCP](https://github.com/me-no-dev/ESPAsyncTCP) (no TLS supported) +- Supported platforms: + - Espressif ESP8266 and ESP32 using the Arduino framework +- Basic Linux compatibility*. This includes WSL on Windows + + > Linux compatibility is mainly for automatic testing. It relies on a quick and dirty Arduino-style `Client` with a POSIX TCP client underneath and Arduino-style `IPAddress` class. These are lacking many features needed for proper Linux support. + +# Documentation + +See [documentation](https://www.emelis.net/espMqttClient/) and the [examples](examples/). + +## Limitations + +### MQTT 3.1.1 Compliancy + +Outgoing messages and session data are not stored in non-volatile memory. Any events like loss of power or sudden resets result in loss of data. Despite this limitation, one could still consider this library as fully complaint based on the non normative remark in point 4.1.1 of the specification. + +### Non-blocking + +This library aims to be fully non-blocking. It is however limited by the underlying `WiFiClient` library which is part of the Arduino framework and has a blocking `connect` method. This is not an issue on ESP32 because the call is offloaded to a separate task. On ESP8266 however, connecting will block until succesful or until the connection timeouts. + +If you need a fully asynchronous MQTT client, you can use `espMqttClientAsync` which uses AsyncTCP/ESPAsyncTCP under the hood. These underlying libraries do not support TLS (anymore). I will not provide support TLS for the async client. + +# Bugs and feature requests + +Please use Github's facilities to get in touch. + +# About this library + +This client wouldn't exist without [Async-mqtt-client](https://github.com/marvinroger/async-mqtt-client). It has been my go-to MQTT client for many years. It was fast, reliable and had features that were non-existing in alternative libraries. However, the underlying async TCP libraries are lacking updates, especially updates related to secure connections. Adapting this library to use up-to-date TCP clients would not be trivial. I eventually decided to write my own MQTT library, from scratch. + +The result is an almost non-blocking library with no external dependencies. The library is almost a drop-in replacement for the async-mqtt-client except a few parameter type changes (eg. `uint8_t*` instead of `char*` for payloads). + +# License + +This library is released under the MIT Licence. A copy is included in the repo. +Parts of this library, most notably the API, are based on [Async MQTT client for ESP8266 and ESP32](https://github.com/marvinroger/async-mqtt-client). diff --git a/lib/espMqttClient/src/Config.h b/lib/espMqttClient/src/Config.h new file mode 100644 index 000000000..aba779565 --- /dev/null +++ b/lib/espMqttClient/src/Config.h @@ -0,0 +1,58 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#ifndef EMC_TX_TIMEOUT +#define EMC_TX_TIMEOUT 5000 +#endif + +#ifndef EMC_RX_BUFFER_SIZE +#define EMC_RX_BUFFER_SIZE 1440 +#endif + +#ifndef EMC_TX_BUFFER_SIZE +#define EMC_TX_BUFFER_SIZE 1440 +#endif + +#ifndef EMC_MAX_TOPIC_LENGTH +#define EMC_MAX_TOPIC_LENGTH 128 +#endif + +#ifndef EMC_PAYLOAD_BUFFER_SIZE +#define EMC_PAYLOAD_BUFFER_SIZE 32 +#endif + +#ifndef EMC_MIN_FREE_MEMORY +#define EMC_MIN_FREE_MEMORY 4096 +#endif + +#ifndef EMC_ESP8266_MULTITHREADING +#define EMC_ESP8266_MULTITHREADING 0 +#endif + +#ifndef EMC_ALLOW_NOT_CONNECTED_PUBLISH +#define EMC_ALLOW_NOT_CONNECTED_PUBLISH 1 +#endif + +#ifndef EMC_WAIT_FOR_CONNACK +#define EMC_WAIT_FOR_CONNACK 1 +#endif + +#ifndef EMC_CLIENTID_LENGTH +// esp8266abc123 and esp32abcdef123456 +#define EMC_CLIENTID_LENGTH 23 + 1 +#endif + +#ifndef EMC_TASK_STACK_SIZE +#define EMC_TASK_STACK_SIZE 5120 +#endif + +#ifndef EMC_USE_WATCHDOG +#define EMC_USE_WATCHDOG 0 +#endif diff --git a/lib/espMqttClient/src/Helpers.h b/lib/espMqttClient/src/Helpers.h new file mode 100644 index 000000000..4a19224ba --- /dev/null +++ b/lib/espMqttClient/src/Helpers.h @@ -0,0 +1,49 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#if defined(ARDUINO_ARCH_ESP32) + #include // millis(), ESP.getFreeHeap(); + #include "freertos/FreeRTOS.h" + #include "freertos/task.h" + #include "esp_task_wdt.h" + #define EMC_SEMAPHORE_TAKE() xSemaphoreTake(_xSemaphore, portMAX_DELAY) + #define EMC_SEMAPHORE_GIVE() xSemaphoreGive(_xSemaphore) + #define EMC_GET_FREE_MEMORY() std::max(ESP.getMaxAllocHeap(), ESP.getMaxAllocPsram()) + #define EMC_YIELD() taskYIELD() + #define EMC_GENERATE_CLIENTID(x) snprintf(x, EMC_CLIENTID_LENGTH, "esp32%06llx", ESP.getEfuseMac()); +#elif defined(ARDUINO_ARCH_ESP8266) + #include // millis(), ESP.getFreeHeap(); + #if EMC_ESP8266_MULTITHREADING + // This lib doesn't run use multithreading on ESP8266 + // _xSemaphore defined as std::atomic + #define EMC_SEMAPHORE_TAKE() while (_xSemaphore) { /*ESP.wdtFeed();*/ } _xSemaphore = true + #define EMC_SEMAPHORE_GIVE() _xSemaphore = false + #else + #define EMC_SEMAPHORE_TAKE() + #define EMC_SEMAPHORE_GIVE() + #endif + #define EMC_GET_FREE_MEMORY() ESP.getMaxFreeBlockSize() + // no need to yield for ESP8266, the Arduino framework does this internally + // yielding in async is forbidden (will crash) + #define EMC_YIELD() + #define EMC_GENERATE_CLIENTID(x) snprintf(x, EMC_CLIENTID_LENGTH, "esp8266%06x", ESP.getChipId()); +#elif defined(__linux__) + #include // NOLINT [build/c++11] + #include // NOLINT [build/c++11] for yield() + #define millis() std::chrono::duration_cast(std::chrono::steady_clock::now().time_since_epoch()).count() + #define EMC_GET_FREE_MEMORY() 1000000000 + #define EMC_YIELD() std::this_thread::yield() + #define EMC_GENERATE_CLIENTID(x) snprintf(x, EMC_CLIENTID_LENGTH, "Client%04d%04d%04d", rand()%10000, rand()%10000, rand()%10000) + #include // NOLINT [build/c++11] + #define EMC_SEMAPHORE_TAKE() mtx.lock(); + #define EMC_SEMAPHORE_GIVE() mtx.unlock(); +#else + #error Target platform not supported +#endif diff --git a/lib/espMqttClient/src/Logging.h b/lib/espMqttClient/src/Logging.h new file mode 100644 index 000000000..3ba096a8d --- /dev/null +++ b/lib/espMqttClient/src/Logging.h @@ -0,0 +1,43 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#if defined(ARDUINO_ARCH_ESP32) + #include + #include "freertos/FreeRTOS.h" + #include "freertos/task.h" + #if defined(DEBUG_ESP_MQTT_CLIENT) + // Logging is en/disabled by Arduino framework macros + #define emc_log_i(...) log_i(__VA_ARGS__) + #define emc_log_e(...) log_e(__VA_ARGS__) + #define emc_log_w(...) log_w(__VA_ARGS__) + #else + // Logging is disabled + #define emc_log_i(...) + #define emc_log_e(...) + #define emc_log_w(...) + #endif +#elif defined(ARDUINO_ARCH_ESP8266) + #if defined(DEBUG_ESP_PORT) && defined(DEBUG_ESP_MQTT_CLIENT) + #include + #define emc_log_i(...) DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.print("\n") + #define emc_log_e(...) DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.print("\n") + #define emc_log_w(...) DEBUG_ESP_PORT.printf(__VA_ARGS__); DEBUG_ESP_PORT.print("\n") + #else + #define emc_log_i(...) + #define emc_log_e(...) + #define emc_log_w(...) + #endif +#else + // when building for PC, always show debug statements as part of testing suite + #include + #define emc_log_i(...) std::cout << "[I] " << __FILE__ ":" << __LINE__ << ": "; printf(__VA_ARGS__); std::cout << std::endl + #define emc_log_e(...) std::cout << "[E] " << __FILE__ ":" << __LINE__ << ": "; printf(__VA_ARGS__); std::cout << std::endl + #define emc_log_w(...) std::cout << "[W] " << __FILE__ ":" << __LINE__ << ": "; printf(__VA_ARGS__); std::cout << std::endl +#endif diff --git a/lib/espMqttClient/src/MqttClient.cpp b/lib/espMqttClient/src/MqttClient.cpp new file mode 100644 index 000000000..2f1d0d643 --- /dev/null +++ b/lib/espMqttClient/src/MqttClient.cpp @@ -0,0 +1,754 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#include "MqttClient.h" + +using espMqttClientInternals::Packet; +using espMqttClientInternals::PacketType; +using espMqttClientTypes::DisconnectReason; +using espMqttClientTypes::Error; + +MqttClient::MqttClient(espMqttClientTypes::UseInternalTask useInternalTask, uint8_t priority, uint8_t core) +#if defined(ARDUINO_ARCH_ESP32) + : _useInternalTask(useInternalTask) + , _transport(nullptr) +#else + : _transport(nullptr) +#endif + , _onConnectCallback(nullptr) + , _onDisconnectCallback(nullptr) + , _onSubscribeCallback(nullptr) + , _onUnsubscribeCallback(nullptr) + , _onMessageCallback(nullptr) + , _onPublishCallback(nullptr) + , _onErrorCallback(nullptr) + , _clientId(nullptr) + , _ip() + , _host(nullptr) + , _port(1883) + , _useIp(false) + , _keepAlive(15000) + , _cleanSession(true) + , _username(nullptr) + , _password(nullptr) + , _willTopic(nullptr) + , _willPayload(nullptr) + , _willPayloadLength(0) + , _willQos(0) + , _willRetain(false) + , _timeout(EMC_TX_TIMEOUT) + , _state(State::disconnected) + , _generatedClientId{0} + , _packetId(0) +#if defined(ARDUINO_ARCH_ESP32) + , _xSemaphore(nullptr) + , _taskHandle(nullptr) +#endif + , _rxBuffer{0} + , _outbox() + , _bytesSent(0) + , _parser() + , _lastClientActivity(0) + , _lastServerActivity(0) + , _pingSent(false) + , _disconnectReason(DisconnectReason::TCP_DISCONNECTED) +#if defined(ARDUINO_ARCH_ESP32) && ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO + , _highWaterMark(4294967295) +#endif +{ + EMC_GENERATE_CLIENTID(_generatedClientId); +#if defined(ARDUINO_ARCH_ESP32) + _xSemaphore = xSemaphoreCreateMutex(); + EMC_SEMAPHORE_GIVE(); // release before first use + if (_useInternalTask == espMqttClientTypes::UseInternalTask::YES) { + xTaskCreatePinnedToCore((TaskFunction_t)_loop, "mqttclient", EMC_TASK_STACK_SIZE, this, priority, &_taskHandle, core); + } +#else + (void)useInternalTask; + (void)priority; + (void)core; +#endif + _clientId = _generatedClientId; +} + +MqttClient::~MqttClient() { + disconnect(true); + _clearQueue(2); +#if defined(ARDUINO_ARCH_ESP32) + vSemaphoreDelete(_xSemaphore); + if (_useInternalTask == espMqttClientTypes::UseInternalTask::YES) { +#if EMC_USE_WATCHDOG + esp_task_wdt_delete(_taskHandle); // not sure if this is really needed +#endif + vTaskDelete(_taskHandle); + } +#endif +} + +bool MqttClient::connected() const { + if (_state == State::connected) + return true; + return false; +} + +bool MqttClient::disconnected() const { + if (_state == State::disconnected) + return true; + return false; +} + +bool MqttClient::connect() { + bool result = true; + if (_state == State::disconnected) { + EMC_SEMAPHORE_TAKE(); + if (_addPacketFront(_cleanSession, + _username, + _password, + _willTopic, + _willRetain, + _willQos, + _willPayload, + _willPayloadLength, + (uint16_t)(_keepAlive / 1000), // 32b to 16b doesn't overflow because it comes from 16b orignally + _clientId)) { +#if defined(ARDUINO_ARCH_ESP32) + if (_useInternalTask == espMqttClientTypes::UseInternalTask::YES) { + vTaskResume(_taskHandle); + } +#endif + _state = State::connectingTcp1; + } else { + EMC_SEMAPHORE_GIVE(); + emc_log_e("Could not create CONNECT packet"); + _onError(0, Error::OUT_OF_MEMORY); + result = false; + } + EMC_SEMAPHORE_GIVE(); + } + return result; +} + +bool MqttClient::disconnect(bool force) { + if (force && _state != State::disconnected && _state != State::disconnectingTcp1 && _state != State::disconnectingTcp2) { + _state = State::disconnectingTcp1; + return true; + } + if (!force && _state == State::connected) { + _state = State::disconnectingMqtt1; + return true; + } + return false; +} + +uint16_t MqttClient::publish(const char * topic, uint8_t qos, bool retain, const uint8_t * payload, size_t length) { +#if !EMC_ALLOW_NOT_CONNECTED_PUBLISH + if (_state != State::connected) { +#else + if (_state > State::connected) { +#endif + return 0; + } + uint16_t packetId = (qos > 0) ? _getNextPacketId() : 1; + EMC_SEMAPHORE_TAKE(); + if (!_addPacket(packetId, topic, payload, length, qos, retain)) { + emc_log_e("Could not create PUBLISH packet"); + _onError(packetId, Error::OUT_OF_MEMORY); + packetId = 0; + } + EMC_SEMAPHORE_GIVE(); + return packetId; +} + +uint16_t MqttClient::publish(const char * topic, uint8_t qos, bool retain, const char * payload) { + size_t len = strlen(payload); + return publish(topic, qos, retain, reinterpret_cast(payload), len); +} + +uint16_t MqttClient::publish(const char * topic, uint8_t qos, bool retain, espMqttClientTypes::PayloadCallback callback, size_t length) { +#if !EMC_ALLOW_NOT_CONNECTED_PUBLISH + if (_state != State::connected) { +#else + if (_state > State::connected) { +#endif + return 0; + } + uint16_t packetId = (qos > 0) ? _getNextPacketId() : 1; + EMC_SEMAPHORE_TAKE(); + if (!_addPacket(packetId, topic, callback, length, qos, retain)) { + emc_log_e("Could not create PUBLISH packet"); + _onError(packetId, Error::OUT_OF_MEMORY); + packetId = 0; + } + EMC_SEMAPHORE_GIVE(); + return packetId; +} + +void MqttClient::clearQueue(bool deleteSessionData) { + _clearQueue(deleteSessionData ? 2 : 0); +} + +const char * MqttClient::getClientId() const { + return _clientId; +} + +void MqttClient::loop() { + switch (_state) { + case State::disconnected: +#if defined(ARDUINO_ARCH_ESP32) + if (_useInternalTask == espMqttClientTypes::UseInternalTask::YES) { + vTaskSuspend(_taskHandle); + } +#endif + break; + case State::connectingTcp1: + if (_useIp ? _transport->connect(_ip, _port) : _transport->connect(_host, _port)) { + _state = State::connectingTcp2; + } else { + _state = State::disconnectingTcp1; + _disconnectReason = DisconnectReason::TCP_DISCONNECTED; + break; + } + // Falling through to speed up connecting on blocking transport 'connect' implementations + [[fallthrough]]; + case State::connectingTcp2: + if (_transport->connected()) { + _parser.reset(); + _lastClientActivity = _lastServerActivity = millis(); + _state = State::connectingMqtt; + } + break; + case State::connectingMqtt: +#if EMC_WAIT_FOR_CONNACK + if (_transport->connected()) { + _sendPacket(); + _checkIncoming(); + _checkPing(); + } else { + _state = State::disconnectingTcp1; + _disconnectReason = DisconnectReason::TCP_DISCONNECTED; + } + break; +#else + // receipt of CONNACK packet will set state to CONNECTED + // client however is allowed to send packets before CONNACK is received + // so we fall through to 'connected' + [[fallthrough]]; +#endif + case State::connected: + [[fallthrough]]; + case State::disconnectingMqtt2: + if (_transport->connected()) { + // CONNECT packet is first in the queue + _checkOutbox(); + _checkIncoming(); + _checkPing(); + _checkTimeout(); + } else { + _state = State::disconnectingTcp1; + _disconnectReason = DisconnectReason::TCP_DISCONNECTED; + } + break; + case State::disconnectingMqtt1: + EMC_SEMAPHORE_TAKE(); + if (_outbox.empty()) { + if (!_addPacket(PacketType.DISCONNECT)) { + EMC_SEMAPHORE_GIVE(); + emc_log_e("Could not create DISCONNECT packet"); + _onError(0, Error::OUT_OF_MEMORY); + } else { + _state = State::disconnectingMqtt2; + } + } + EMC_SEMAPHORE_GIVE(); + _checkOutbox(); + _checkIncoming(); + _checkPing(); + _checkTimeout(); + break; + case State::disconnectingTcp1: + _transport->stop(); + _state = State::disconnectingTcp2; + break; // keep break to accomodate async clients + case State::disconnectingTcp2: + if (_transport->disconnected()) { + _clearQueue(0); + _bytesSent = 0; + _state = State::disconnected; + if (_onDisconnectCallback) + _onDisconnectCallback(_disconnectReason); + } + break; + // all cases covered, no default case + } + EMC_YIELD(); +#if defined(ARDUINO_ARCH_ESP32) && ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO + size_t waterMark = uxTaskGetStackHighWaterMark(NULL); + if (waterMark < _highWaterMark) { + _highWaterMark = waterMark; + emc_log_i("Stack usage: %zu/%i", EMC_TASK_STACK_SIZE - _highWaterMark, EMC_TASK_STACK_SIZE); + } +#endif +} + +#if defined(ARDUINO_ARCH_ESP32) +void MqttClient::_loop(MqttClient * c) { +#if EMC_USE_WATCHDOG + if (esp_task_wdt_add(NULL) != ESP_OK) { + emc_log_e("Failed to add async task to WDT"); + } +#endif + for (;;) { + c->loop(); +#if EMC_USE_WATCHDOG + esp_task_wdt_reset(); +#endif + } +} +#endif + +uint16_t MqttClient::_getNextPacketId() { + uint16_t packetId = 0; + EMC_SEMAPHORE_TAKE(); + // cppcheck-suppress knownConditionTrueFalse + packetId = (++_packetId == 0) ? ++_packetId : _packetId; + EMC_SEMAPHORE_GIVE(); + return packetId; +} + +void MqttClient::_checkOutbox() { + while (_sendPacket() > 0) { + if (!_advanceOutbox()) { + break; + } + } +} + +int MqttClient::_sendPacket() { + EMC_SEMAPHORE_TAKE(); + OutgoingPacket * packet = _outbox.getCurrent(); + + int32_t wantToWrite = 0; + int32_t written = 0; + if (packet && (wantToWrite == written)) { + // mixing signed with unsigned here but safe because of MQTT packet size limits + wantToWrite = packet->packet.available(_bytesSent); + if (wantToWrite == 0) { + EMC_SEMAPHORE_GIVE(); + return 0; + } + written = _transport->write(packet->packet.data(_bytesSent), wantToWrite); + if (written < 0) { + emc_log_w("Write error, check connection"); + EMC_SEMAPHORE_GIVE(); + return -1; + } + packet->timeSent = millis(); + _lastClientActivity = millis(); + _bytesSent += written; + emc_log_i("tx %zu/%zu (%02x)", _bytesSent, packet->packet.size(), packet->packet.packetType()); + } + EMC_SEMAPHORE_GIVE(); + return written; +} + +bool MqttClient::_advanceOutbox() { + EMC_SEMAPHORE_TAKE(); + OutgoingPacket * packet = _outbox.getCurrent(); + if (packet && _bytesSent == packet->packet.size()) { + if ((packet->packet.packetType()) == PacketType.DISCONNECT) { + _state = State::disconnectingTcp1; + _disconnectReason = DisconnectReason::USER_OK; + } + if (packet->packet.removable()) { + _outbox.removeCurrent(); + } else { + // we already set 'dup' here, in case we have to retry + if ((packet->packet.packetType()) == PacketType.PUBLISH) + packet->packet.setDup(); + _outbox.next(); + } + packet = _outbox.getCurrent(); + _bytesSent = 0; + } + EMC_SEMAPHORE_GIVE(); + return packet; +} + +void MqttClient::_checkIncoming() { + int32_t remainingBufferLength = _transport->read(_rxBuffer, EMC_RX_BUFFER_SIZE); + if (remainingBufferLength > 0) { + _lastServerActivity = millis(); + emc_log_i("rx len %i", remainingBufferLength); + size_t bytesParsed = 0; + size_t index = 0; + while (remainingBufferLength > 0) { + espMqttClientInternals::ParserResult result = _parser.parse(&_rxBuffer[index], remainingBufferLength, &bytesParsed); + if (result == espMqttClientInternals::ParserResult::packet) { + espMqttClientInternals::MQTTPacketType packetType = _parser.getPacket().fixedHeader.packetType & 0xF0; + if (_state == State::connectingMqtt && packetType != PacketType.CONNACK) { + emc_log_w("Disconnecting, expected CONNACK - protocol error"); + _state = State::disconnectingTcp1; + return; + } + switch (packetType & 0xF0) { + case PacketType.CONNACK: + _onConnack(); + if (_state != State::connected) { + return; + } + break; + case PacketType.PUBLISH: + if (_state >= State::disconnectingMqtt1) + break; // stop processing incoming once user has called disconnect + _onPublish(); + break; + case PacketType.PUBACK: + _onPuback(); + break; + case PacketType.PUBREC: + _onPubrec(); + break; + case PacketType.PUBREL: + _onPubrel(); + break; + case PacketType.PUBCOMP: + _onPubcomp(); + break; + case PacketType.SUBACK: + _onSuback(); + break; + case PacketType.UNSUBACK: + _onUnsuback(); + break; + case PacketType.PINGRESP: + _pingSent = false; + break; + } + } else if (result == espMqttClientInternals::ParserResult::protocolError) { + emc_log_w("Disconnecting, protocol error"); + _state = State::disconnectingTcp1; + _disconnectReason = DisconnectReason::TCP_DISCONNECTED; + return; + } + remainingBufferLength -= bytesParsed; + index += bytesParsed; + emc_log_i("Parsed %zu - remaining %i", bytesParsed, remainingBufferLength); + bytesParsed = 0; + } + } +} + +void MqttClient::_checkPing() { + if (_keepAlive == 0) + return; // keepalive is disabled + + uint32_t currentMillis = millis(); + + // disconnect when server was inactive for twice the keepalive time + if (currentMillis - _lastServerActivity > 2 * _keepAlive) { + emc_log_w("Disconnecting, server exceeded keepalive"); + _state = State::disconnectingTcp1; + _disconnectReason = DisconnectReason::TCP_DISCONNECTED; + return; + } + + // send ping when client was inactive during the keepalive time + // or when server hasn't responded within keepalive time (typically due to QOS 0) + if (!_pingSent && ((currentMillis - _lastClientActivity > _keepAlive) || (currentMillis - _lastServerActivity > _keepAlive))) { + EMC_SEMAPHORE_TAKE(); + if (!_addPacket(PacketType.PINGREQ)) { + EMC_SEMAPHORE_GIVE(); + emc_log_e("Could not create PING packet"); + return; + } + EMC_SEMAPHORE_GIVE(); + _pingSent = true; + } +} + +void MqttClient::_checkTimeout() { + EMC_SEMAPHORE_TAKE(); + espMqttClientInternals::Outbox::Iterator it = _outbox.front(); + // check that we're not busy sending + // don't check when first item hasn't been sent yet + if (it && _bytesSent == 0 && it.get() != _outbox.getCurrent()) { + if (millis() - it.get()->timeSent > _timeout) { + emc_log_w("Packet ack timeout, retrying"); + _outbox.resetCurrent(); + } + } + EMC_SEMAPHORE_GIVE(); +} + +void MqttClient::_onConnack() { + if (_parser.getPacket().variableHeader.fixed.connackVarHeader.returnCode == 0x00) { + _pingSent = false; // reset after keepalive timeout disconnect + _state = State::connected; + _advanceOutbox(); + if (_parser.getPacket().variableHeader.fixed.connackVarHeader.sessionPresent == 0) { + _clearQueue(1); + } + if (_onConnectCallback) { + _onConnectCallback(_parser.getPacket().variableHeader.fixed.connackVarHeader.sessionPresent); + } + } else { + _state = State::disconnectingTcp1; + // cast is safe because the parser already checked for a valid return code + _disconnectReason = static_cast(_parser.getPacket().variableHeader.fixed.connackVarHeader.returnCode); + } +} + +void MqttClient::_onPublish() { + espMqttClientInternals::IncomingPacket p = _parser.getPacket(); + uint8_t qos = p.qos(); + bool retain = p.retain(); + bool dup = p.dup(); + uint16_t packetId = p.variableHeader.fixed.packetId; + bool callback = true; + if (qos == 1) { + if (p.payload.index + p.payload.length == p.payload.total) { + EMC_SEMAPHORE_TAKE(); + if (!_addPacket(PacketType.PUBACK, packetId)) { + emc_log_e("Could not create PUBACK packet"); + } + EMC_SEMAPHORE_GIVE(); + } + } else if (qos == 2) { + EMC_SEMAPHORE_TAKE(); + espMqttClientInternals::Outbox::Iterator it = _outbox.front(); + while (it) { + if ((it.get()->packet.packetType()) == PacketType.PUBREC && it.get()->packet.packetId() == packetId) { + callback = false; + _outbox.remove(it); + emc_log_e("QoS2 packet previously delivered"); + break; + } + ++it; + } + if (p.payload.index + p.payload.length == p.payload.total) { + if (!_addPacket(PacketType.PUBREC, packetId)) { + emc_log_e("Could not create PUBREC packet"); + } + } + EMC_SEMAPHORE_GIVE(); + } + if (callback && _onMessageCallback) + _onMessageCallback({qos, dup, retain, packetId}, p.variableHeader.topic, p.payload.data, p.payload.length, p.payload.index, p.payload.total); +} + +void MqttClient::_onPuback() { + bool callback = false; + uint16_t idToMatch = _parser.getPacket().variableHeader.fixed.packetId; + EMC_SEMAPHORE_TAKE(); + espMqttClientInternals::Outbox::Iterator it = _outbox.front(); + while (it) { + // PUBACKs come in the order PUBs are sent. So we only check the first PUB packet in outbox + // if it doesn't match the ID, return + if ((it.get()->packet.packetType()) == PacketType.PUBLISH) { + if (it.get()->packet.packetId() == idToMatch) { + callback = true; + _outbox.remove(it); + break; + } + emc_log_w("Received out of order PUBACK"); + break; + } + ++it; + } + EMC_SEMAPHORE_GIVE(); + if (callback) { + if (_onPublishCallback) + _onPublishCallback(idToMatch); + } else { + emc_log_w("No matching PUBLISH packet found"); + } +} + +void MqttClient::_onPubrec() { + bool success = false; + uint16_t idToMatch = _parser.getPacket().variableHeader.fixed.packetId; + EMC_SEMAPHORE_TAKE(); + espMqttClientInternals::Outbox::Iterator it = _outbox.front(); + while (it) { + // PUBRECs come in the order PUBs are sent. So we only check the first PUB packet in outbox + // if it doesn't match the ID, return + if ((it.get()->packet.packetType()) == PacketType.PUBLISH || (it.get()->packet.packetType()) == PacketType.PUBREL) { + if (it.get()->packet.packetId() == idToMatch) { + if (!_addPacket(PacketType.PUBREL, idToMatch)) { + emc_log_e("Could not create PUBREL packet"); + } + _outbox.remove(it); + success = true; + break; + } + emc_log_w("Received out of order PUBREC"); + break; + } + ++it; + } + if (!success) { + emc_log_w("No matching PUBLISH packet found"); + } + EMC_SEMAPHORE_GIVE(); +} + +void MqttClient::_onPubrel() { + bool success = false; + uint16_t idToMatch = _parser.getPacket().variableHeader.fixed.packetId; + EMC_SEMAPHORE_TAKE(); + espMqttClientInternals::Outbox::Iterator it = _outbox.front(); + while (it) { + // PUBRELs come in the order PUBRECs are sent. So we only check the first PUBREC packet in outbox + // if it doesn't match the ID, return + if ((it.get()->packet.packetType()) == PacketType.PUBREC) { + if (it.get()->packet.packetId() == idToMatch) { + if (!_addPacket(PacketType.PUBCOMP, idToMatch)) { + emc_log_e("Could not create PUBCOMP packet"); + } + _outbox.remove(it); + success = true; + break; + } + emc_log_w("Received out of order PUBREL"); + break; + } + ++it; + } + if (!success) { + emc_log_w("No matching PUBREC packet found"); + } + EMC_SEMAPHORE_GIVE(); +} + +void MqttClient::_onPubcomp() { + bool callback = false; + EMC_SEMAPHORE_TAKE(); + espMqttClientInternals::Outbox::Iterator it = _outbox.front(); + uint16_t idToMatch = _parser.getPacket().variableHeader.fixed.packetId; + while (it) { + // PUBCOMPs come in the order PUBRELs are sent. So we only check the first PUBREL packet in outbox + // if it doesn't match the ID, return + if ((it.get()->packet.packetType()) == PacketType.PUBREL) { + if (it.get()->packet.packetId() == idToMatch) { + // if (!_addPacket(PacketType.PUBCOMP, idToMatch)) { + // emc_log_e("Could not create PUBCOMP packet"); + // } + callback = true; + _outbox.remove(it); + break; + } + emc_log_w("Received out of order PUBCOMP"); + break; + } + ++it; + } + EMC_SEMAPHORE_GIVE(); + if (callback) { + if (_onPublishCallback) + _onPublishCallback(idToMatch); + } else { + emc_log_w("No matching PUBREL packet found"); + } +} + +void MqttClient::_onSuback() { + bool callback = false; + uint16_t idToMatch = _parser.getPacket().variableHeader.fixed.packetId; + EMC_SEMAPHORE_TAKE(); + espMqttClientInternals::Outbox::Iterator it = _outbox.front(); + while (it) { + if (((it.get()->packet.packetType()) == PacketType.SUBSCRIBE) && it.get()->packet.packetId() == idToMatch) { + callback = true; + _outbox.remove(it); + break; + } + ++it; + } + EMC_SEMAPHORE_GIVE(); + if (callback) { + if (_onSubscribeCallback) + _onSubscribeCallback(idToMatch, + reinterpret_cast(_parser.getPacket().payload.data), + _parser.getPacket().payload.total); + } else { + emc_log_w("received SUBACK without SUB"); + } +} + +void MqttClient::_onUnsuback() { + bool callback = false; + EMC_SEMAPHORE_TAKE(); + espMqttClientInternals::Outbox::Iterator it = _outbox.front(); + uint16_t idToMatch = _parser.getPacket().variableHeader.fixed.packetId; + while (it) { + if (it.get()->packet.packetId() == idToMatch) { + callback = true; + _outbox.remove(it); + break; + } + ++it; + } + EMC_SEMAPHORE_GIVE(); + if (callback) { + if (_onUnsubscribeCallback) + _onUnsubscribeCallback(idToMatch); + } else { + emc_log_w("received UNSUBACK without UNSUB"); + } +} + +uint16_t MqttClient::getQueue() const { + EMC_SEMAPHORE_TAKE(); + espMqttClientInternals::Outbox::Iterator it = _outbox.front(); + uint16_t count = 0; + while (it) { + ++count; + ++it; + } + EMC_SEMAPHORE_GIVE(); + return count; +} + +void MqttClient::_clearQueue(int clearData) { + emc_log_i("clearing queue (clear session: %d)", clearData); + EMC_SEMAPHORE_TAKE(); + espMqttClientInternals::Outbox::Iterator it = _outbox.front(); + if (clearData == 0) { + // keep PUB (qos > 0, aka packetID != 0), PUBREC and PUBREL + // Spec only mentions PUB and PUBREL but this lib implements method B from point 4.3.3 (Fig. 4.3) + // and stores the packet id in the PUBREC packet. So we also must keep PUBREC. + while (it) { + espMqttClientInternals::MQTTPacketType type = it.get()->packet.packetType(); + if (type == PacketType.PUBREC || type == PacketType.PUBREL || (type == PacketType.PUBLISH && it.get()->packet.packetId() != 0)) { + ++it; + } else { + _outbox.remove(it); + } + } + } else if (clearData == 1) { + // keep PUB + while (it) { + if (it.get()->packet.packetType() == PacketType.PUBLISH) { + ++it; + } else { + _outbox.remove(it); + } + } + } else { // clearData == 2 + while (it) { + _outbox.remove(it); + } + } + EMC_SEMAPHORE_GIVE(); +} + +void MqttClient::_onError(uint16_t packetId, espMqttClientTypes::Error error) { + if (_onErrorCallback) { + _onErrorCallback(packetId, error); + } +} diff --git a/lib/espMqttClient/src/MqttClient.h b/lib/espMqttClient/src/MqttClient.h new file mode 100644 index 000000000..6d36e0af5 --- /dev/null +++ b/lib/espMqttClient/src/MqttClient.h @@ -0,0 +1,190 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +API is based on the original work of Marvin Roger: +https://github.com/marvinroger/async-mqtt-client + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#include +#include + +#include "Helpers.h" +#include "Config.h" +#include "TypeDefs.h" +#include "Logging.h" +#include "Outbox.h" +#include "Packets/Packet.h" +#include "Packets/Parser.h" +#include "Transport/Transport.h" + +class MqttClient { + public: + virtual ~MqttClient(); + bool connected() const; + bool disconnected() const; + bool connect(); + bool disconnect(bool force = false); + template + uint16_t subscribe(const char* topic, uint8_t qos, Args&&... args) { + uint16_t packetId = _getNextPacketId(); + if (_state != State::connected) { + packetId = 0; + } else { + EMC_SEMAPHORE_TAKE(); + if (!_addPacket(packetId, topic, qos, std::forward(args) ...)) { + emc_log_e("Could not create SUBSCRIBE packet"); + packetId = 0; + } + EMC_SEMAPHORE_GIVE(); + } + return packetId; + } + template + uint16_t unsubscribe(const char* topic, Args&&... args) { + uint16_t packetId = _getNextPacketId(); + if (_state != State::connected) { + packetId = 0; + } else { + EMC_SEMAPHORE_TAKE(); + if (!_addPacket(packetId, topic, std::forward(args) ...)) { + emc_log_e("Could not create UNSUBSCRIBE packet"); + packetId = 0; + } + EMC_SEMAPHORE_GIVE(); + } + return packetId; + } + uint16_t publish(const char* topic, uint8_t qos, bool retain, const uint8_t* payload, size_t length); + uint16_t publish(const char* topic, uint8_t qos, bool retain, const char* payload); + uint16_t publish(const char* topic, uint8_t qos, bool retain, espMqttClientTypes::PayloadCallback callback, size_t length); + void clearQueue(bool deleteSessionData = false); // Not MQTT compliant and may cause unpredictable results when `deleteSessionData` = true! + const char* getClientId() const; + uint16_t getQueue() const; + void loop(); + + protected: + explicit MqttClient(espMqttClientTypes::UseInternalTask useInternalTask, uint8_t priority = 1, uint8_t core = 1); + espMqttClientTypes::UseInternalTask _useInternalTask; + espMqttClientInternals::Transport* _transport; + + espMqttClientTypes::OnConnectCallback _onConnectCallback; + espMqttClientTypes::OnDisconnectCallback _onDisconnectCallback; + espMqttClientTypes::OnSubscribeCallback _onSubscribeCallback; + espMqttClientTypes::OnUnsubscribeCallback _onUnsubscribeCallback; + espMqttClientTypes::OnMessageCallback _onMessageCallback; + espMqttClientTypes::OnPublishCallback _onPublishCallback; + espMqttClientTypes::OnErrorCallback _onErrorCallback; + typedef void(*mqttClientHook)(void*); + const char* _clientId; + IPAddress _ip; + const char* _host; + uint16_t _port; + bool _useIp; + uint32_t _keepAlive; + bool _cleanSession; + const char* _username; + const char* _password; + const char* _willTopic; + const uint8_t* _willPayload; + uint16_t _willPayloadLength; + uint8_t _willQos; + bool _willRetain; + uint32_t _timeout; + + // state is protected to allow state changes by the transport system, defined in child classes + // eg. to allow AsyncTCP + enum class State { + disconnected = 0, + connectingTcp1 = 1, + connectingTcp2 = 2, + connectingMqtt = 3, + connected = 4, + disconnectingMqtt1 = 5, + disconnectingMqtt2 = 6, + disconnectingTcp1 = 7, + disconnectingTcp2 = 8 + }; + std::atomic _state; + + private: + char _generatedClientId[EMC_CLIENTID_LENGTH]; + uint16_t _packetId; + +#if defined(ARDUINO_ARCH_ESP32) + SemaphoreHandle_t _xSemaphore; + TaskHandle_t _taskHandle; + static void _loop(MqttClient* c); +#elif defined(ARDUINO_ARCH_ESP8266) && EMC_ESP8266_MULTITHREADING + std::atomic _xSemaphore = false; +#elif defined(__linux__) + std::mutex mtx; +#endif + + uint8_t _rxBuffer[EMC_RX_BUFFER_SIZE]; + struct OutgoingPacket { + uint32_t timeSent; + espMqttClientInternals::Packet packet; + template + OutgoingPacket(uint32_t t, espMqttClientTypes::Error error, Args&&... args) : + timeSent(t), + packet(error, std::forward(args) ...) {} + }; + espMqttClientInternals::Outbox _outbox; + size_t _bytesSent; + espMqttClientInternals::Parser _parser; + uint32_t _lastClientActivity; + uint32_t _lastServerActivity; + bool _pingSent; + espMqttClientTypes::DisconnectReason _disconnectReason; + + uint16_t _getNextPacketId(); + + template + bool _addPacket(Args&&... args) { + espMqttClientTypes::Error error(espMqttClientTypes::Error::SUCCESS); + espMqttClientInternals::Outbox::Iterator it = _outbox.emplace(0, error, std::forward(args) ...); + if (it && error == espMqttClientTypes::Error::SUCCESS) return true; + return false; + } + + template + bool _addPacketFront(Args&&... args) { + espMqttClientTypes::Error error(espMqttClientTypes::Error::SUCCESS); + espMqttClientInternals::Outbox::Iterator it = _outbox.emplaceFront(0, error, std::forward(args) ...); + if (it && error == espMqttClientTypes::Error::SUCCESS) return true; + return false; + } + + void _checkOutbox(); + int _sendPacket(); + bool _advanceOutbox(); + void _checkIncoming(); + void _checkPing(); + void _checkTimeout(); + + void _onConnack(); + void _onPublish(); + void _onPuback(); + void _onPubrec(); + void _onPubrel(); + void _onPubcomp(); + void _onSuback(); + void _onUnsuback(); + + void _clearQueue(int clearData); // 0: keep session, + // 1: keep only PUBLISH qos > 0 + // 2: delete all + void _onError(uint16_t packetId, espMqttClientTypes::Error error); + + #if defined(ARDUINO_ARCH_ESP32) + #if ARDUHAL_LOG_LEVEL >= ARDUHAL_LOG_LEVEL_INFO + size_t _highWaterMark; + #endif + #endif +}; diff --git a/lib/espMqttClient/src/MqttClientSetup.h b/lib/espMqttClient/src/MqttClientSetup.h new file mode 100644 index 000000000..73458d477 --- /dev/null +++ b/lib/espMqttClient/src/MqttClientSetup.h @@ -0,0 +1,116 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +API is based on the original work of Marvin Roger: +https://github.com/marvinroger/async-mqtt-client + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#include "MqttClient.h" + +template +class MqttClientSetup : public MqttClient { + public: + T& setKeepAlive(uint16_t keepAlive) { + _keepAlive = keepAlive * 1000; // s to ms conversion, will also do 16 to 32 bit conversion + return static_cast(*this); + } + + T& setClientId(const char* clientId) { + _clientId = clientId; + return static_cast(*this); + } + + T& setCleanSession(bool cleanSession) { + _cleanSession = cleanSession; + return static_cast(*this); + } + + T& setCredentials(const char* username, const char* password) { + _username = username; + _password = password; + return static_cast(*this); + } + + T& setWill(const char* topic, uint8_t qos, bool retain, const uint8_t* payload, size_t length) { + _willTopic = topic; + _willQos = qos; + _willRetain = retain; + _willPayload = payload; + if (!_willPayload) { + _willPayloadLength = 0; + } else { + _willPayloadLength = length; + } + return static_cast(*this); + } + + T& setWill(const char* topic, uint8_t qos, bool retain, const char* payload) { + return setWill(topic, qos, retain, reinterpret_cast(payload), strlen(payload)); + } + + T& setServer(IPAddress ip, uint16_t port) { + _ip = ip; + _port = port; + _useIp = true; + return static_cast(*this); + } + + T& setServer(const char* host, uint16_t port) { + _host = host; + _port = port; + _useIp = false; + return static_cast(*this); + } + + T& setTimeout(uint16_t timeout) { + _timeout = timeout * 1000; // s to ms conversion, will also do 16 to 32 bit conversion + return static_cast(*this); + } + + T& onConnect(espMqttClientTypes::OnConnectCallback callback) { + _onConnectCallback = callback; + return static_cast(*this); + } + + T& onDisconnect(espMqttClientTypes::OnDisconnectCallback callback) { + _onDisconnectCallback = callback; + return static_cast(*this); + } + + T& onSubscribe(espMqttClientTypes::OnSubscribeCallback callback) { + _onSubscribeCallback = callback; + return static_cast(*this); + } + + T& onUnsubscribe(espMqttClientTypes::OnUnsubscribeCallback callback) { + _onUnsubscribeCallback = callback; + return static_cast(*this); + } + + T& onMessage(espMqttClientTypes::OnMessageCallback callback) { + _onMessageCallback = callback; + return static_cast(*this); + } + + T& onPublish(espMqttClientTypes::OnPublishCallback callback) { + _onPublishCallback = callback; + return static_cast(*this); + } + + /* + T& onError(espMqttClientTypes::OnErrorCallback callback) { + _onErrorCallback = callback; + return static_cast(*this); + } + */ + + protected: + explicit MqttClientSetup(espMqttClientTypes::UseInternalTask useInternalTask, uint8_t priority = 1, uint8_t core = 1) + : MqttClient(useInternalTask, priority, core) {} +}; diff --git a/lib/espMqttClient/src/Outbox.h b/lib/espMqttClient/src/Outbox.h new file mode 100644 index 000000000..dfbbd13c0 --- /dev/null +++ b/lib/espMqttClient/src/Outbox.h @@ -0,0 +1,207 @@ + +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#include // new (std::nothrow) +#include // std::forward + +namespace espMqttClientInternals { + +/** + * @brief Singly linked queue with builtin non-invalidating forward iterator + * + * Queue items can only be emplaced, at front and back of the queue. + * Remove items using an iterator or the builtin iterator. + */ + +template +class Outbox { + public: + Outbox() + : _first(nullptr) + , _last(nullptr) + , _current(nullptr) + , _prev(nullptr) {} + ~Outbox() { + while (_first) { + Node* n = _first->next; + delete _first; + _first = n; + } + } + + struct Node { + public: + template + explicit Node(Args&&... args) + : data(std::forward(args) ...) + , next(nullptr) { + // empty + } + + T data; + Node* next; + }; + + class Iterator { + friend class Outbox; + public: + void operator++() { + if (_node) { + _prev = _node; + _node = _node->next; + } + } + + explicit operator bool() const { + if (_node) return true; + return false; + } + + T* get() const { + if (_node) return &(_node->data); + return nullptr; + } + + private: + Node* _node = nullptr; + Node* _prev = nullptr; + }; + + // add node to back, advance current to new if applicable + template + Iterator emplace(Args&&... args) { + Iterator it; + Node* node = new (std::nothrow) Node(std::forward(args) ...); + if (node != nullptr) { + if (!_first) { + // queue is empty + _first = _current = node; + } else { + // queue has at least one item + _last->next = node; + it._prev = _last; + } + _last = node; + it._node = node; + // point current to newly created if applicable + if (!_current) { + _current = _last; + } + } + return it; + } + + // add item to front, current points to newly created front. + template + Iterator emplaceFront(Args&&... args) { + Iterator it; + Node* node = new (std::nothrow) Node(std::forward(args) ...); + if (node != nullptr) { + if (!_first) { + // queue is empty + _last = node; + } else { + // queue has at least one item + node->next = _first; + } + _current = _first = node; + _prev = nullptr; + it._node = node; + } + return it; + } + + // remove node at iterator, iterator points to next + void remove(Iterator& it) { // NOLINT(runtime/references) + if (!it) return; + Node* node = it._node; + Node* prev = it._prev; + ++it; + _remove(prev, node); + } + + // remove current node, current points to next + void removeCurrent() { + _remove(_prev, _current); + } + + // Get current item or return nullptr + T* getCurrent() const { + if (_current) return &(_current->data); + return nullptr; + } + + void resetCurrent() { + _current = _first; + } + + Iterator front() const { + Iterator it; + it._node = _first; + return it; + } + + // Advance current item + void next() { + if (_current) { + _prev = _current; + _current = _current->next; + } + } + + // Outbox is empty + bool empty() { + if (!_first) return true; + return false; + } + + private: + Node* _first; + Node* _last; + Node* _current; + Node* _prev; // element just before _current + + void _remove(Node* prev, Node* node) { + if (!node) return; + + // set current to next, node->next may be nullptr + if (_current == node) { + _current = node->next; + } + + if (_prev == node) { + _prev = prev; + } + + // only one element in outbox + if (_first == _last) { + _first = _last = nullptr; + + // delete first el in longer outbox + } else if (_first == node) { + _first = node->next; + + // delete last in longer outbox + } else if (_last == node) { + _last = prev; + _last->next = nullptr; + + // delete somewhere in the middle + } else { + prev->next = node->next; + } + + // finally, delete the node + delete node; + } +}; + +} // end namespace espMqttClientInternals diff --git a/lib/async-mqtt-client/src/AsyncMqttClient/Flags.hpp b/lib/espMqttClient/src/Packets/Constants.h similarity index 54% rename from lib/async-mqtt-client/src/AsyncMqttClient/Flags.hpp rename to lib/espMqttClient/src/Packets/Constants.h index a1fb3e3c8..ee92e3114 100644 --- a/lib/async-mqtt-client/src/AsyncMqttClient/Flags.hpp +++ b/lib/espMqttClient/src/Packets/Constants.h @@ -1,23 +1,42 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +Parts are based on the original work of Marvin Roger: +https://github.com/marvinroger/async-mqtt-client + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + #pragma once -namespace AsyncMqttClientInternals { +#include + +namespace espMqttClientInternals { + +constexpr const char PROTOCOL[] = "MQTT"; +constexpr const uint8_t PROTOCOL_LEVEL = 0b00000100; + +typedef uint8_t MQTTPacketType; + constexpr struct { - const uint8_t RESERVED = 0; - const uint8_t CONNECT = 1; - const uint8_t CONNACK = 2; - const uint8_t PUBLISH = 3; - const uint8_t PUBACK = 4; - const uint8_t PUBREC = 5; - const uint8_t PUBREL = 6; - const uint8_t PUBCOMP = 7; - const uint8_t SUBSCRIBE = 8; - const uint8_t SUBACK = 9; - const uint8_t UNSUBSCRIBE = 10; - const uint8_t UNSUBACK = 11; - const uint8_t PINGREQ = 12; - const uint8_t PINGRESP = 13; - const uint8_t DISCONNECT = 14; - const uint8_t RESERVED2 = 1; + const uint8_t RESERVED1 = 0; + const uint8_t CONNECT = 1 << 4; + const uint8_t CONNACK = 2 << 4; + const uint8_t PUBLISH = 3 << 4; + const uint8_t PUBACK = 4 << 4; + const uint8_t PUBREC = 5 << 4; + const uint8_t PUBREL = 6 << 4; + const uint8_t PUBCOMP = 7 << 4; + const uint8_t SUBSCRIBE = 8 << 4; + const uint8_t SUBACK = 9 << 4; + const uint8_t UNSUBSCRIBE = 10 << 4; + const uint8_t UNSUBACK = 11 << 4; + const uint8_t PINGREQ = 12 << 4; + const uint8_t PINGRESP = 13 << 4; + const uint8_t DISCONNECT = 14 << 4; + const uint8_t RESERVED2 = 1 << 4; } PacketType; constexpr struct { @@ -54,4 +73,5 @@ constexpr struct { const uint8_t CLEAN_SESSION = 0x02; const uint8_t RESERVED = 0x00; } ConnectFlag; -} // namespace AsyncMqttClientInternals + +} // end namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/Packets/Packet.cpp b/lib/espMqttClient/src/Packets/Packet.cpp new file mode 100644 index 000000000..df463ef7b --- /dev/null +++ b/lib/espMqttClient/src/Packets/Packet.cpp @@ -0,0 +1,438 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#include "Packet.h" + +namespace espMqttClientInternals { + +Packet::~Packet() { + free(_data); +} + +size_t Packet::available(size_t index) { + if (index >= _size) return 0; + if (!_getPayload) return _size - index; + return _chunkedAvailable(index); +} + +const uint8_t* Packet::data(size_t index) const { + if (!_getPayload) { + if (!_data) return nullptr; + if (index >= _size) return nullptr; + return &_data[index]; + } + return _chunkedData(index); +} + +size_t Packet::size() const { + return _size; +} + +void Packet::setDup() { + if (!_data) return; + if (packetType() != PacketType.PUBLISH) return; + if (_packetId == 0) return; + _data[0] |= 0x08; +} + +uint16_t Packet::packetId() const { + return _packetId; +} + +MQTTPacketType Packet::packetType() const { + if (_data) return static_cast(_data[0] & 0xF0); + return static_cast(0); +} + +bool Packet::removable() const { + if (_packetId == 0) return true; + if ((packetType() == PacketType.PUBACK) || (packetType() == PacketType.PUBCOMP)) return true; + return false; +} + +Packet::Packet(espMqttClientTypes::Error& error, + bool cleanSession, + const char* username, + const char* password, + const char* willTopic, + bool willRetain, + uint8_t willQos, + const uint8_t* willPayload, + uint16_t willPayloadLength, + uint16_t keepAlive, + const char* clientId) +: _packetId(0) +, _data(nullptr) +, _size(0) +, _payloadIndex(0) +, _payloadStartIndex(0) +, _payloadEndIndex(0) +, _getPayload(nullptr) { + if (willPayload && willPayloadLength == 0) { + size_t length = strlen(reinterpret_cast(willPayload)); + if (length > UINT16_MAX) { + emc_log_w("Payload length truncated (l:%zu)", length); + willPayloadLength = UINT16_MAX; + } else { + willPayloadLength = length; + } + } + if (!clientId || strlen(clientId) == 0) { + emc_log_w("clientId not set error"); + error = espMqttClientTypes::Error::MALFORMED_PARAMETER; + return; + } + + // Calculate size + size_t remainingLength = + 6 + // protocol + 1 + // protocol level + 1 + // connect flags + 2 + // keepalive + 2 + strlen(clientId) + + (willTopic ? 2 + strlen(willTopic) + 2 + willPayloadLength : 0) + + (username ? 2 + strlen(username) : 0) + + (password ? 2 + strlen(password) : 0); + + // allocate memory + if (!_allocate(remainingLength)) { + error = espMqttClientTypes::Error::OUT_OF_MEMORY; + return; + } + + // serialize + size_t pos = 0; + + // FIXED HEADER + _data[pos++] = PacketType.CONNECT | HeaderFlag.CONNECT_RESERVED; + pos += encodeRemainingLength(remainingLength, &_data[pos]); + pos += encodeString(PROTOCOL, &_data[pos]); + _data[pos++] = PROTOCOL_LEVEL; + uint8_t connectFlags = 0; + if (cleanSession) connectFlags |= espMqttClientInternals::ConnectFlag.CLEAN_SESSION; + if (username != nullptr) connectFlags |= espMqttClientInternals::ConnectFlag.USERNAME; + if (password != nullptr) connectFlags |= espMqttClientInternals::ConnectFlag.PASSWORD; + if (willTopic != nullptr) { + connectFlags |= espMqttClientInternals::ConnectFlag.WILL; + if (willRetain) connectFlags |= espMqttClientInternals::ConnectFlag.WILL_RETAIN; + switch (willQos) { + case 0: + connectFlags |= espMqttClientInternals::ConnectFlag.WILL_QOS0; + break; + case 1: + connectFlags |= espMqttClientInternals::ConnectFlag.WILL_QOS1; + break; + case 2: + connectFlags |= espMqttClientInternals::ConnectFlag.WILL_QOS2; + break; + } + } + _data[pos++] = connectFlags; + _data[pos++] = keepAlive >> 8; + _data[pos++] = keepAlive & 0xFF; + + // PAYLOAD + // client ID + pos += encodeString(clientId, &_data[pos]); + // will + if (willTopic != nullptr && willPayload != nullptr) { + pos += encodeString(willTopic, &_data[pos]); + _data[pos++] = willPayloadLength >> 8; + _data[pos++] = willPayloadLength & 0xFF; + memcpy(&_data[pos], willPayload, willPayloadLength); + pos += willPayloadLength; + } + // credentials + if (username != nullptr) pos += encodeString(username, &_data[pos]); + if (password != nullptr) encodeString(password, &_data[pos]); + + error = espMqttClientTypes::Error::SUCCESS; +} + +Packet::Packet(espMqttClientTypes::Error& error, + uint16_t packetId, + const char* topic, + const uint8_t* payload, + size_t payloadLength, + uint8_t qos, + bool retain) +: _packetId(packetId) +, _data(nullptr) +, _size(0) +, _payloadIndex(0) +, _payloadStartIndex(0) +, _payloadEndIndex(0) +, _getPayload(nullptr) { + size_t remainingLength = + 2 + strlen(topic) + // topic length + topic + 2 + // packet ID + payloadLength; + + if (qos == 0) { + remainingLength -= 2; + _packetId = 0; + } + + if (!_allocate(remainingLength)) { + error = espMqttClientTypes::Error::OUT_OF_MEMORY; + return; + } + + size_t pos = _fillPublishHeader(packetId, topic, remainingLength, qos, retain); + + // PAYLOAD + memcpy(&_data[pos], payload, payloadLength); + + error = espMqttClientTypes::Error::SUCCESS; +} + +Packet::Packet(espMqttClientTypes::Error& error, + uint16_t packetId, + const char* topic, + espMqttClientTypes::PayloadCallback payloadCallback, + size_t payloadLength, + uint8_t qos, + bool retain) +: _packetId(packetId) +, _data(nullptr) +, _size(0) +, _payloadIndex(0) +, _payloadStartIndex(0) +, _payloadEndIndex(0) +, _getPayload(payloadCallback) { + size_t remainingLength = + 2 + strlen(topic) + // topic length + topic + 2 + // packet ID + payloadLength; + + if (qos == 0) { + remainingLength -= 2; + _packetId = 0; + } + + if (!_allocate(remainingLength - payloadLength + std::min(payloadLength, static_cast(EMC_RX_BUFFER_SIZE)))) { + error = espMqttClientTypes::Error::OUT_OF_MEMORY; + return; + } + + size_t pos = _fillPublishHeader(packetId, topic, remainingLength, qos, retain); + + // payload will be added by 'Packet::available' + _size = pos + payloadLength; + _payloadIndex = pos; + _payloadStartIndex = _payloadIndex; + _payloadEndIndex = _payloadIndex; + + error = espMqttClientTypes::Error::SUCCESS; +} + +Packet::Packet(espMqttClientTypes::Error& error, uint16_t packetId, const char* topic, uint8_t qos) +: _packetId(packetId) +, _data(nullptr) +, _size(0) +, _payloadIndex(0) +, _payloadStartIndex(0) +, _payloadEndIndex(0) +, _getPayload(nullptr) { + SubscribeItem list[1] = {topic, qos}; + _createSubscribe(error, list, 1); +} + +Packet::Packet(espMqttClientTypes::Error& error, MQTTPacketType type, uint16_t packetId) +: _packetId(packetId) +, _data(nullptr) +, _size(0) +, _payloadIndex(0) +, _payloadStartIndex(0) +, _payloadEndIndex(0) +, _getPayload(nullptr) { + if (!_allocate(2)) { + error = espMqttClientTypes::Error::OUT_OF_MEMORY; + return; + } + + size_t pos = 0; + _data[pos] = type; + if (type == PacketType.PUBREL) { + _data[pos++] |= HeaderFlag.PUBREL_RESERVED; + } else { + pos++; + } + pos += encodeRemainingLength(2, &_data[pos]); + _data[pos++] = packetId >> 8; + _data[pos] = packetId & 0xFF; + + error = espMqttClientTypes::Error::SUCCESS; +} + +Packet::Packet(espMqttClientTypes::Error& error, uint16_t packetId, const char* topic) +: _packetId(packetId) +, _data(nullptr) +, _size(0) +, _payloadIndex(0) +, _payloadStartIndex(0) +, _payloadEndIndex(0) +, _getPayload(nullptr) { + const char* list[1] = {topic}; + _createUnsubscribe(error, list, 1); +} + +Packet::Packet(espMqttClientTypes::Error& error, MQTTPacketType type) +: _packetId(0) +, _data(nullptr) +, _size(0) +, _payloadIndex(0) +, _payloadStartIndex(0) +, _payloadEndIndex(0) +, _getPayload(nullptr) { + if (!_allocate(0)) { + error = espMqttClientTypes::Error::OUT_OF_MEMORY; + return; + } + _data[0] |= type; + + error = espMqttClientTypes::Error::SUCCESS; +} + + +bool Packet::_allocate(size_t remainingLength) { + if (EMC_GET_FREE_MEMORY() < EMC_MIN_FREE_MEMORY) { + emc_log_w("Packet buffer not allocated: low memory"); + return false; + } + _size = 1 + remainingLengthLength(remainingLength) + remainingLength; + _data = reinterpret_cast(malloc(_size)); + if (!_data) { + _size = 0; + emc_log_w("Alloc failed (l:%zu)", _size); + return false; + } + emc_log_i("Alloc (l:%zu)", _size); + memset(_data, 0, _size); + return true; +} + +size_t Packet::_fillPublishHeader(uint16_t packetId, + const char* topic, + size_t remainingLength, + uint8_t qos, + bool retain) { + size_t index = 0; + + // FIXED HEADER + _data[index] = PacketType.PUBLISH; + if (retain) _data[index] |= HeaderFlag.PUBLISH_RETAIN; + if (qos == 0) { + _data[index++] |= HeaderFlag.PUBLISH_QOS0; + } else if (qos == 1) { + _data[index++] |= HeaderFlag.PUBLISH_QOS1; + } else if (qos == 2) { + _data[index++] |= HeaderFlag.PUBLISH_QOS2; + } + index += encodeRemainingLength(remainingLength, &_data[index]); + + // VARIABLE HEADER + index += encodeString(topic, &_data[index]); + if (qos > 0) { + _data[index++] = packetId >> 8; + _data[index++] = packetId & 0xFF; + } + + return index; +} + +void Packet::_createSubscribe(espMqttClientTypes::Error& error, + SubscribeItem* list, + size_t numberTopics) { + // Calculate size + size_t payload = 0; + for (size_t i = 0; i < numberTopics; ++i) { + payload += 2 + strlen(list[i].topic) + 1; // length bytes, string, qos + } + size_t remainingLength = 2 + payload; // packetId + payload + + // allocate memory + if (!_allocate(remainingLength)) { + error = espMqttClientTypes::Error::OUT_OF_MEMORY; + return; + } + + // serialize + size_t pos = 0; + _data[pos++] = PacketType.SUBSCRIBE | HeaderFlag.SUBSCRIBE_RESERVED; + pos += encodeRemainingLength(remainingLength, &_data[pos]); + _data[pos++] = _packetId >> 8; + _data[pos++] = _packetId & 0xFF; + for (size_t i = 0; i < numberTopics; ++i) { + pos += encodeString(list[i].topic, &_data[pos]); + _data[pos++] = list[i].qos; + } + + error = espMqttClientTypes::Error::SUCCESS; +} + +void Packet::_createUnsubscribe(espMqttClientTypes::Error& error, + const char** list, + size_t numberTopics) { + // Calculate size + size_t payload = 0; + for (size_t i = 0; i < numberTopics; ++i) { + payload += 2 + strlen(list[i]); // length bytes, string + } + size_t remainingLength = 2 + payload; // packetId + payload + + // allocate memory + if (!_allocate(remainingLength)) { + error = espMqttClientTypes::Error::OUT_OF_MEMORY; + return; + } + + // serialize + size_t pos = 0; + _data[pos++] = PacketType.UNSUBSCRIBE | HeaderFlag.UNSUBSCRIBE_RESERVED; + pos += encodeRemainingLength(remainingLength, &_data[pos]); + _data[pos++] = _packetId >> 8; + _data[pos++] = _packetId & 0xFF; + for (size_t i = 0; i < numberTopics; ++i) { + pos += encodeString(list[i], &_data[pos]); + } + + error = espMqttClientTypes::Error::SUCCESS; +} + +size_t Packet::_chunkedAvailable(size_t index) { + // index vs size check done in 'available(index)' + + // index points to header or first payload byte + if (index < _payloadIndex) { + if (_size > _payloadIndex && _payloadEndIndex != 0) { + size_t copied = _getPayload(&_data[_payloadIndex], std::min(static_cast(EMC_TX_BUFFER_SIZE), _size - _payloadStartIndex), index); + _payloadStartIndex = _payloadIndex; + _payloadEndIndex = _payloadStartIndex + copied - 1; + } + + // index points to payload unavailable + } else if (index > _payloadEndIndex || _payloadStartIndex > index) { + _payloadStartIndex = index; + size_t copied = _getPayload(&_data[_payloadIndex], std::min(static_cast(EMC_TX_BUFFER_SIZE), _size - _payloadStartIndex), index); + _payloadEndIndex = _payloadStartIndex + copied - 1; + } + + // now index points to header or payload available + return _payloadEndIndex - index + 1; +} + +const uint8_t* Packet::_chunkedData(size_t index) const { + // CAUTION!! available(index) has to be called first to check available data and possibly fill payloadbuffer + if (index < _payloadIndex) { + return &_data[index]; + } + return &_data[index - _payloadStartIndex + _payloadIndex]; +} + +} // end namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/Packets/Packet.h b/lib/espMqttClient/src/Packets/Packet.h new file mode 100644 index 000000000..1af2f06af --- /dev/null +++ b/lib/espMqttClient/src/Packets/Packet.h @@ -0,0 +1,155 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#include +#include + +#include "Constants.h" +#include "../Config.h" +#include "../TypeDefs.h" +#include "../Helpers.h" +#include "../Logging.h" +#include "RemainingLength.h" +#include "String.h" + +namespace espMqttClientInternals { + +class Packet { + public: + ~Packet(); + size_t available(size_t index); + const uint8_t* data(size_t index) const; + + size_t size() const; + void setDup(); + uint16_t packetId() const; + MQTTPacketType packetType() const; + bool removable() const; + + protected: + uint16_t _packetId; // save as separate variable: will be accessed frequently + uint8_t* _data; + size_t _size; + + // variables for chunked payload handling + size_t _payloadIndex; + size_t _payloadStartIndex; + size_t _payloadEndIndex; + espMqttClientTypes::PayloadCallback _getPayload; + + struct SubscribeItem { + const char* topic; + uint8_t qos; + }; + + public: + // CONNECT + Packet(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + bool cleanSession, + const char* username, + const char* password, + const char* willTopic, + bool willRetain, + uint8_t willQos, + const uint8_t* willPayload, + uint16_t willPayloadLength, + uint16_t keepAlive, + const char* clientId); + // PUBLISH + Packet(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + uint16_t packetId, + const char* topic, + const uint8_t* payload, + size_t payloadLength, + uint8_t qos, + bool retain); + Packet(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + uint16_t packetId, + const char* topic, + espMqttClientTypes::PayloadCallback payloadCallback, + size_t payloadLength, + uint8_t qos, + bool retain); + // SUBSCRIBE + Packet(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + uint16_t packetId, + const char* topic, + uint8_t qos); + template + Packet(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + uint16_t packetId, + const char* topic1, + uint8_t qos1, + const char* topic2, + uint8_t qos2, + Args&& ... args) + : _packetId(packetId) + , _data(nullptr) + , _size(0) + , _payloadIndex(0) + , _payloadStartIndex(0) + , _payloadEndIndex(0) + , _getPayload(nullptr) { + static_assert(sizeof...(Args) % 2 == 0, "Subscribe should be in topic/qos pairs"); + size_t numberTopics = 2 + (sizeof...(Args) / 2); + SubscribeItem list[numberTopics] = {topic1, qos1, topic2, qos2, args...}; + _createSubscribe(error, list, numberTopics); + } + // UNSUBSCRIBE + Packet(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + uint16_t packetId, + const char* topic); + template + Packet(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + uint16_t packetId, + const char* topic1, + const char* topic2, + Args&& ... args) + : _packetId(packetId) + , _data(nullptr) + , _size(0) + , _payloadIndex(0) + , _payloadStartIndex(0) + , _payloadEndIndex(0) + , _getPayload(nullptr) { + size_t numberTopics = 2 + sizeof...(Args); + const char* list[numberTopics] = {topic1, topic2, args...}; + _createUnsubscribe(error, list, numberTopics); + } + // PUBACK, PUBREC, PUBREL, PUBCOMP + Packet(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + MQTTPacketType type, + uint16_t packetId); + // PING, DISCONN + explicit Packet(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + MQTTPacketType type); + + private: + // pass remainingLength = total size - header - remainingLengthLength! + bool _allocate(size_t remainingLength); + + // fills header and returns index of next available byte in buffer + size_t _fillPublishHeader(uint16_t packetId, + const char* topic, + size_t remainingLength, + uint8_t qos, + bool retain); + void _createSubscribe(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + SubscribeItem* list, + size_t numberTopics); + void _createUnsubscribe(espMqttClientTypes::Error& error, // NOLINT(runtime/references) + const char** list, + size_t numberTopics); + + size_t _chunkedAvailable(size_t index); + const uint8_t* _chunkedData(size_t index) const; +}; + +} // end namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/Packets/Parser.cpp b/lib/espMqttClient/src/Packets/Parser.cpp new file mode 100644 index 000000000..07998a3da --- /dev/null +++ b/lib/espMqttClient/src/Packets/Parser.cpp @@ -0,0 +1,316 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#include "Parser.h" + +namespace espMqttClientInternals { + +uint8_t IncomingPacket::qos() const { + if ((fixedHeader.packetType & 0xF0) != PacketType.PUBLISH) return 0; + return (fixedHeader.packetType & 0x06) >> 1; // mask 0x00000110 +} + +bool IncomingPacket::retain() const { + if ((fixedHeader.packetType & 0xF0) != PacketType.PUBLISH) return 0; + return fixedHeader.packetType & 0x01; // mask 0x00000001 +} + +bool IncomingPacket::dup() const { + if ((fixedHeader.packetType & 0xF0) != PacketType.PUBLISH) return 0; + return fixedHeader.packetType & 0x08; // mask 0x00001000 +} + +void IncomingPacket::reset() { + fixedHeader.packetType = 0; + variableHeader.topicLength = 0; + variableHeader.fixed.packetId = 0; + payload.index = 0; + payload.length = 0; +} + +Parser::Parser() +: _data(nullptr) +, _len(0) +, _bytesRead(0) +, _bytePos(0) +, _parse(_fixedHeader) +, _packet() +, _payloadBuffer{0} { + // empty +} + +ParserResult Parser::parse(const uint8_t* data, size_t len, size_t* bytesRead) { + _data = data; + _len = len; + _bytesRead = 0; + ParserResult result = ParserResult::awaitData; + while (result == ParserResult::awaitData && _bytesRead < _len) { + result = _parse(this); + ++_bytesRead; + } + (*bytesRead) += _bytesRead; + return result; +} + +const IncomingPacket& Parser::getPacket() const { + return _packet; +} + +void Parser::reset() { + _parse = _fixedHeader; + _bytesRead = 0; + _bytePos = 0; + _packet.reset(); +} + +ParserResult Parser::_fixedHeader(Parser* p) { + p->_packet.reset(); + p->_packet.fixedHeader.packetType = p->_data[p->_bytesRead]; + + // keep PUBLISH out of the switch and handle in separate if/else + if ((p->_packet.fixedHeader.packetType & 0xF0) == PacketType.PUBLISH) { + uint8_t headerFlags = p->_packet.fixedHeader.packetType & 0x0F; + /* flags can be: 0b0000 --> no dup, qos 0, no retain + 0x0001 --> no dup, qos 0, retain + 0x0010 --> no dup, qos 1, no retain + 0x0011 --> no dup, qos 1, retain + 0x0100 --> no dup, qos 2, no retain + 0x0101 --> no dup, qos 2, retain + 0x1010 --> dup, qos 1, no retain + 0x1011 --> dup, qos 1, retain + 0x1100 --> dup, qos 2, no retain + 0x1101 --> dup, qos 2, retain + */ + if (headerFlags <= 0x05 || headerFlags >= 0x0A) { + p->_parse = _remainingLengthVariable; + p->_bytePos = 0; + } else { + emc_log_w("Invalid packet header: 0x%02x", p->_packet.fixedHeader.packetType); + return ParserResult::protocolError; + } + } else { + switch (p->_packet.fixedHeader.packetType) { + case PacketType.CONNACK | HeaderFlag.CONNACK_RESERVED: + case PacketType.PUBACK | HeaderFlag.PUBACK_RESERVED: + case PacketType.PUBREC | HeaderFlag.PUBREC_RESERVED: + case PacketType.PUBREL | HeaderFlag.PUBREL_RESERVED: + case PacketType.PUBCOMP | HeaderFlag.PUBCOMP_RESERVED: + case PacketType.UNSUBACK | HeaderFlag.UNSUBACK_RESERVED: + p->_parse = _remainingLengthFixed; + break; + case PacketType.SUBACK | HeaderFlag.SUBACK_RESERVED: + p->_parse = _remainingLengthVariable; + p->_bytePos = 0; + break; + case PacketType.PINGRESP | HeaderFlag.PINGRESP_RESERVED: + p->_parse = _remainingLengthNone; + break; + default: + emc_log_w("Invalid packet header: 0x%02x", p->_packet.fixedHeader.packetType); + return ParserResult::protocolError; + } + } + emc_log_i("Packet type: 0x%02x", p->_packet.fixedHeader.packetType); + return ParserResult::awaitData; +} + +ParserResult Parser::_remainingLengthFixed(Parser* p) { + p->_packet.fixedHeader.remainingLength.remainingLength = p->_data[p->_bytesRead]; + + if (p->_packet.fixedHeader.remainingLength.remainingLength == 2) { // variable header is 2 bytes long + if ((p->_packet.fixedHeader.packetType & 0xF0) != PacketType.CONNACK) { + p->_parse = _varHeaderPacketId1; + } else { + p->_parse = _varHeaderConnack1; + } + emc_log_i("Remaining length: %zu", p->_packet.fixedHeader.remainingLength.remainingLength); + return ParserResult::awaitData; + } + p->_parse = _fixedHeader; + emc_log_w("Invalid remaining length (fixed): %zu", p->_packet.fixedHeader.remainingLength.remainingLength); + return ParserResult::protocolError; +} + +ParserResult Parser::_remainingLengthVariable(Parser* p) { + p->_packet.fixedHeader.remainingLength.remainingLengthRaw[p->_bytePos] = p->_data[p->_bytesRead]; + if (p->_packet.fixedHeader.remainingLength.remainingLengthRaw[p->_bytePos] & 0x80) { + p->_bytePos++; + if (p->_bytePos == 4) { + emc_log_w("Invalid remaining length (variable)"); + return ParserResult::protocolError; + } else { + return ParserResult::awaitData; + } + } + + // no need to check for negative decoded length, check is already done + p->_packet.fixedHeader.remainingLength.remainingLength = decodeRemainingLength(p->_packet.fixedHeader.remainingLength.remainingLengthRaw); + + if ((p->_packet.fixedHeader.packetType & 0xF0) == PacketType.PUBLISH) { + p->_parse = _varHeaderTopicLength1; + emc_log_i("Remaining length: %zu", p->_packet.fixedHeader.remainingLength.remainingLength); + return ParserResult::awaitData; + } else { + int32_t payloadSize = p->_packet.fixedHeader.remainingLength.remainingLength - 2; // total - packet ID + if (0 < payloadSize && payloadSize < EMC_PAYLOAD_BUFFER_SIZE) { + p->_bytePos = 0; + p->_packet.payload.data = p->_payloadBuffer; + p->_packet.payload.index = 0; + p->_packet.payload.length = payloadSize; + p->_packet.payload.total = payloadSize; + p->_parse = _varHeaderPacketId1; + emc_log_i("Remaining length: %zu", p->_packet.fixedHeader.remainingLength.remainingLength); + return ParserResult::awaitData; + } else { + emc_log_w("Invalid payload length"); + } + } + p->_parse = _fixedHeader; + return ParserResult::protocolError; +} + +ParserResult Parser::_remainingLengthNone(Parser* p) { + p->_packet.fixedHeader.remainingLength.remainingLength = p->_data[p->_bytesRead]; + p->_parse = _fixedHeader; + if (p->_packet.fixedHeader.remainingLength.remainingLength == 0) { + emc_log_i("Remaining length: %zu", p->_packet.fixedHeader.remainingLength.remainingLength); + return ParserResult::packet; + } + emc_log_w("Invalid remaining length (none)"); + return ParserResult::protocolError; +} + +ParserResult Parser::_varHeaderConnack1(Parser* p) { + uint8_t data = p->_data[p->_bytesRead]; + if (data < 2) { // session present flag: equal to 0 or 1 + p->_packet.variableHeader.fixed.connackVarHeader.sessionPresent = data; + p->_parse = _varHeaderConnack2; + return ParserResult::awaitData; + } + p->_parse = _fixedHeader; + emc_log_w("Invalid session flags"); + return ParserResult::protocolError; +} + +ParserResult Parser::_varHeaderConnack2(Parser* p) { + uint8_t data = p->_data[p->_bytesRead]; + p->_parse = _fixedHeader; + if (data <= 5) { // connect return code max is 5 + p->_packet.variableHeader.fixed.connackVarHeader.returnCode = data; + emc_log_i("Packet complete"); + return ParserResult::packet; + } + emc_log_w("Invalid connack return code"); + return ParserResult::protocolError; +} + +ParserResult Parser::_varHeaderPacketId1(Parser* p) { + p->_packet.variableHeader.fixed.packetId |= p->_data[p->_bytesRead] << 8; + p->_parse = _varHeaderPacketId2; + return ParserResult::awaitData; +} + +ParserResult Parser::_varHeaderPacketId2(Parser* p) { + p->_packet.variableHeader.fixed.packetId |= p->_data[p->_bytesRead]; + p->_parse = _fixedHeader; + if (p->_packet.variableHeader.fixed.packetId != 0) { + emc_log_i("Packet variable header complete"); + if ((p->_packet.fixedHeader.packetType & 0xF0) == PacketType.SUBACK) { + p->_parse = _payloadSuback; + return ParserResult::awaitData; + } else if ((p->_packet.fixedHeader.packetType & 0xF0) == PacketType.PUBLISH) { + p->_packet.payload.total -= 2; // substract packet id length from payload + if (p->_packet.payload.total == 0) { + p->_parse = _fixedHeader; + return ParserResult::packet; + } else { + p->_parse = _payloadPublish; + } + return ParserResult::awaitData; + } else { + return ParserResult::packet; + } + } else { + emc_log_w("Invalid packet id"); + return ParserResult::protocolError; + } +} + +ParserResult Parser::_varHeaderTopicLength1(Parser* p) { + p->_packet.variableHeader.topicLength = p->_data[p->_bytesRead] << 8; + p->_parse = _varHeaderTopicLength2; + return ParserResult::awaitData; +} + +ParserResult Parser::_varHeaderTopicLength2(Parser* p) { + p->_packet.variableHeader.topicLength |= p->_data[p->_bytesRead]; + size_t maxTopicLength = + p->_packet.fixedHeader.remainingLength.remainingLength + - 2 // topic length bytes + - ((p->_packet.fixedHeader.packetType & (HeaderFlag.PUBLISH_QOS1 | HeaderFlag.PUBLISH_QOS2)) ? 2 : 0); + if (p->_packet.variableHeader.topicLength <= maxTopicLength) { + p->_parse = _varHeaderTopic; + p->_bytePos = 0; + p->_packet.payload.total = p->_packet.fixedHeader.remainingLength.remainingLength - 2 - p->_packet.variableHeader.topicLength; + return ParserResult::awaitData; + } + emc_log_w("Invalid topic length: %u > %zu", p->_packet.variableHeader.topicLength, maxTopicLength); + p->_parse = _fixedHeader; + return ParserResult::protocolError; +} + +ParserResult Parser::_varHeaderTopic(Parser* p) { + // no checking for character [MQTT-3.3.2-1] [MQTT-3.3.2-2] + p->_packet.variableHeader.topic[p->_bytePos] = static_cast(p->_data[p->_bytesRead]); + p->_bytePos++; + if (p->_bytePos == p->_packet.variableHeader.topicLength || p->_bytePos == EMC_MAX_TOPIC_LENGTH) { + p->_packet.variableHeader.topic[p->_bytePos] = 0x00; // add c-string delimiter + emc_log_i("Packet variable header topic complete"); + if (p->_packet.fixedHeader.packetType & (HeaderFlag.PUBLISH_QOS1 | HeaderFlag.PUBLISH_QOS2)) { + p->_parse = _varHeaderPacketId1; + } else if (p->_packet.payload.total == 0) { + p->_parse = _fixedHeader; + return ParserResult::packet; + } else { + p->_parse = _payloadPublish; + } + } + return ParserResult::awaitData; +} + +ParserResult Parser::_payloadSuback(Parser* p) { + uint8_t data = p->_data[p->_bytesRead]; + if (data < 0x03 || data == 0x80) { + p->_payloadBuffer[p->_bytePos] = data; + p->_bytePos++; + } else { + p->_parse = _fixedHeader; + emc_log_w("Invalid suback return code"); + return ParserResult::protocolError; + } + if (p->_bytePos == p->_packet.payload.total) { + p->_parse = _fixedHeader; + emc_log_i("Packet complete"); + return ParserResult::packet; + } + return ParserResult::awaitData; +} + +ParserResult Parser::_payloadPublish(Parser* p) { + p->_packet.payload.index += p->_packet.payload.length; + p->_packet.payload.data = &p->_data[p->_bytesRead]; + emc_log_i("payload: index %zu, total %zu, avail %zu/%zu", p->_packet.payload.index, p->_packet.payload.total, p->_len - p->_bytesRead, p->_len); + p->_packet.payload.length = std::min(p->_len - p->_bytesRead, p->_packet.payload.total - p->_packet.payload.index); + p->_bytesRead += p->_packet.payload.length - 1; // compensate for increment in _parse-loop + if (p->_packet.payload.index + p->_packet.payload.length == p->_packet.payload.total) { + p->_parse = _fixedHeader; + } + return ParserResult::packet; +} + +} // end namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/Packets/Parser.h b/lib/espMqttClient/src/Packets/Parser.h new file mode 100644 index 000000000..2f6334e42 --- /dev/null +++ b/lib/espMqttClient/src/Packets/Parser.h @@ -0,0 +1,100 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#include +#include +#include + +#include "../Config.h" +#include "Constants.h" +#include "../Logging.h" +#include "RemainingLength.h" + +namespace espMqttClientInternals { + +struct IncomingPacket { + struct __attribute__((__packed__)) { + MQTTPacketType packetType; + union { + size_t remainingLength; + uint8_t remainingLengthRaw[4]; + } remainingLength; + } fixedHeader; + struct __attribute__((__packed__)) { + uint16_t topicLength; + char topic[EMC_MAX_TOPIC_LENGTH + 1]; // + 1 for c-string delimiter + union { + struct { + uint8_t sessionPresent; + uint8_t returnCode; + } connackVarHeader; + uint16_t packetId; + } fixed; + } variableHeader; + struct { + const uint8_t* data; + size_t length; + size_t index; + size_t total; + } payload; + + uint8_t qos() const; + bool retain() const; + bool dup() const; + void reset(); +}; + +enum class ParserResult : uint8_t { + awaitData, + packet, + protocolError +}; + +class Parser; +typedef ParserResult(*ParserFunc)(Parser*); + +class Parser { + public: + Parser(); + ParserResult parse(const uint8_t* data, size_t len, size_t* bytesRead); + const IncomingPacket& getPacket() const; + void reset(); + + private: + // keep data variables in class to avoid copying on every iteration of the parser + const uint8_t* _data; + size_t _len; + size_t _bytesRead; + size_t _bytePos; + ParserFunc _parse; + IncomingPacket _packet; + uint8_t _payloadBuffer[EMC_PAYLOAD_BUFFER_SIZE]; + + static ParserResult _fixedHeader(Parser* p); + static ParserResult _remainingLengthFixed(Parser* p); + static ParserResult _remainingLengthNone(Parser* p); + static ParserResult _remainingLengthVariable(Parser* p); + + + static ParserResult _varHeaderConnack1(Parser* p); + static ParserResult _varHeaderConnack2(Parser* p); + + static ParserResult _varHeaderPacketId1(Parser* p); + static ParserResult _varHeaderPacketId2(Parser* p); + + static ParserResult _varHeaderTopicLength1(Parser* p); + static ParserResult _varHeaderTopicLength2(Parser* p); + static ParserResult _varHeaderTopic(Parser* p); + + static ParserResult _payloadSuback(Parser* p); + static ParserResult _payloadPublish(Parser* p); +}; + +} // end namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/Packets/RemainingLength.cpp b/lib/espMqttClient/src/Packets/RemainingLength.cpp new file mode 100644 index 000000000..d8644a33a --- /dev/null +++ b/lib/espMqttClient/src/Packets/RemainingLength.cpp @@ -0,0 +1,57 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#include "RemainingLength.h" + +namespace espMqttClientInternals { + +int32_t decodeRemainingLength(const uint8_t* stream) { + uint32_t multiplier = 1; + int32_t remainingLength = 0; + uint8_t currentByte = 0; + uint8_t encodedByte; + + do { + encodedByte = stream[currentByte++]; + remainingLength += (encodedByte & 127) * multiplier; + if (multiplier > 128 * 128 * 128) { + emc_log_e("Malformed Remaining Length"); + return -1; + } + multiplier *= 128; + } while ((encodedByte & 128) != 0); + + return remainingLength; +} + +uint8_t remainingLengthLength(uint32_t remainingLength) { + if (remainingLength < 128) return 1; + if (remainingLength < 16384) return 2; + if (remainingLength < 2097152) return 3; + if (remainingLength > 268435455) return 0; + return 4; +} + +uint8_t encodeRemainingLength(uint32_t remainingLength, uint8_t* destination) { + uint8_t currentByte = 0; + uint8_t bytesNeeded = 0; + + do { + uint8_t encodedByte = remainingLength % 128; + remainingLength /= 128; + if (remainingLength > 0) { + encodedByte = encodedByte | 128; + } + destination[currentByte++] = encodedByte; + bytesNeeded++; + } while (remainingLength > 0); + + return bytesNeeded; +} + +} // namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/Packets/RemainingLength.h b/lib/espMqttClient/src/Packets/RemainingLength.h new file mode 100644 index 000000000..0b84e23e5 --- /dev/null +++ b/lib/espMqttClient/src/Packets/RemainingLength.h @@ -0,0 +1,32 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#include + +#include "../Logging.h" + +namespace espMqttClientInternals { + +// Calculations are based on non normative comment in section 2.2.3 Remaining Length of the MQTT specification + +// returns decoded length based on input stream +// stream is expected to contain full encoded remaining length +// return -1 on error. +int32_t decodeRemainingLength(const uint8_t* stream); + + +// returns the number of bytes needed to encode the remaining length +uint8_t remainingLengthLength(uint32_t remainingLength); + +// encodes the given remaining length to destination and returns number of bytes used +// destination is expected to be large enough to hold the number of bytes needed +uint8_t encodeRemainingLength(uint32_t remainingLength, uint8_t* destination); + +} // namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/Packets/String.cpp b/lib/espMqttClient/src/Packets/String.cpp new file mode 100644 index 000000000..c3fe23fdc --- /dev/null +++ b/lib/espMqttClient/src/Packets/String.cpp @@ -0,0 +1,26 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#include "String.h" + +namespace espMqttClientInternals { + +size_t encodeString(const char* source, uint8_t* dest) { + size_t length = strlen(source); + if (length > 65535) { + emc_log_e("String length error"); + return 0; + } + + dest[0] = static_cast(length) >> 8; + dest[1] = static_cast(length) & 0xFF; + memcpy(&dest[2], source, length); + return 2 + length; +} + +} // namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/Packets/String.h b/lib/espMqttClient/src/Packets/String.h new file mode 100644 index 000000000..7f1e1e848 --- /dev/null +++ b/lib/espMqttClient/src/Packets/String.h @@ -0,0 +1,22 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#include +#include // memcpy + +#include "../Logging.h" + +namespace espMqttClientInternals { + +// encodes the given source string into destination and returns number of bytes used +// destination is expected to be large enough to hold the number of bytes needed +size_t encodeString(const char* source, uint8_t* dest); + +} // namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/Transport/ClientAsync.cpp b/lib/espMqttClient/src/Transport/ClientAsync.cpp new file mode 100644 index 000000000..4f8d69eeb --- /dev/null +++ b/lib/espMqttClient/src/Transport/ClientAsync.cpp @@ -0,0 +1,58 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) + +#include "ClientAsync.h" + +namespace espMqttClientInternals { + +ClientAsync::ClientAsync() +: client() +, availableData(0) +, bufData(nullptr) { + // empty +} + +bool ClientAsync::connect(IPAddress ip, uint16_t port) { + return client.connect(ip, port); +} + +bool ClientAsync::connect(const char* host, uint16_t port) { + return client.connect(host, port); +} + +size_t ClientAsync::write(const uint8_t* buf, size_t size) { + return client.write(reinterpret_cast(buf), size); +} + +int ClientAsync::read(uint8_t* buf, size_t size) { + size_t willRead = std::min(size, availableData); + memcpy(buf, bufData, std::min(size, availableData)); + if (availableData > size) { + emc_log_w("Buffer is smaller than available data: %zu - %zu", size, availableData); + } + availableData = 0; + return willRead; +} + +void ClientAsync::stop() { + client.close(false); +} + +bool ClientAsync::connected() { + return client.connected(); +} + +bool ClientAsync::disconnected() { + return client.disconnected(); +} + +} // namespace espMqttClientInternals + +#endif diff --git a/lib/espMqttClient/src/Transport/ClientAsync.h b/lib/espMqttClient/src/Transport/ClientAsync.h new file mode 100644 index 000000000..c3ddd0388 --- /dev/null +++ b/lib/espMqttClient/src/Transport/ClientAsync.h @@ -0,0 +1,44 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) + +#pragma once + +#if defined(ARDUINO_ARCH_ESP32) + #include "freertos/FreeRTOS.h" + #include +#elif defined(ARDUINO_ARCH_ESP8266) + #include +#endif + +#include "Transport.h" +#include "../Config.h" +#include "../Logging.h" + +namespace espMqttClientInternals { + +class ClientAsync : public Transport { + public: + ClientAsync(); + bool connect(IPAddress ip, uint16_t port) override; + bool connect(const char* host, uint16_t port) override; + size_t write(const uint8_t* buf, size_t size) override; + int read(uint8_t* buf, size_t size) override; + void stop() override; + bool connected() override; + bool disconnected() override; + + AsyncClient client; + size_t availableData; + uint8_t* bufData; +}; + +} // namespace espMqttClientInternals + +#endif diff --git a/lib/espMqttClient/src/Transport/ClientPosix.cpp b/lib/espMqttClient/src/Transport/ClientPosix.cpp new file mode 100644 index 000000000..83b555d1b --- /dev/null +++ b/lib/espMqttClient/src/Transport/ClientPosix.cpp @@ -0,0 +1,92 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#include "ClientPosix.h" + +#if defined(__linux__) + +namespace espMqttClientInternals { + +ClientPosix::ClientPosix() +: _sockfd(-1) +, _host() { + // empty +} + +ClientPosix::~ClientPosix() { + ClientPosix::stop(); +} + +bool ClientPosix::connect(IPAddress ip, uint16_t port) { + if (connected()) stop(); + + _sockfd = ::socket(AF_INET, SOCK_STREAM, 0); + if (_sockfd < 0) { + emc_log_e("Error %d opening socket", errno); + } + + int flag = 1; + if (setsockopt(_sockfd, IPPROTO_TCP, TCP_NODELAY, &flag, sizeof(int)) < 0) { + emc_log_e("Error %d disabling nagle", errno); + } + + memset(&_host, 0, sizeof(_host)); + _host.sin_family = AF_INET; + _host.sin_addr.s_addr = htonl(uint32_t(ip)); + _host.sin_port = ::htons(port); + + int ret = ::connect(_sockfd, (struct sockaddr *)&_host, sizeof(_host)); + + if (ret < 0) { + emc_log_e("Error connecting: %d - (%d) %s", ret, errno, strerror(errno)); + return false; + } + + emc_log_i("Connected"); + return true; +} + +bool ClientPosix::connect(const char* host, uint16_t port) { + // tbi + (void) host; + (void) port; + return false; +} + +size_t ClientPosix::write(const uint8_t* buf, size_t size) { + return ::send(_sockfd, buf, size, 0); +} + +int ClientPosix::read(uint8_t* buf, size_t size) { + int ret = ::recv(_sockfd, buf, size, MSG_DONTWAIT); + /* + if (ret < 0) { + emc_log_e("Error reading: %s", strerror(errno)); + } + */ + return ret; +} + +void ClientPosix::stop() { + if (_sockfd >= 0) { + ::close(_sockfd); + _sockfd = -1; + } +} + +bool ClientPosix::connected() { + return _sockfd >= 0; +} + +bool ClientPosix::disconnected() { + return _sockfd < 0; +} + +} // namespace espMqttClientInternals + +#endif diff --git a/lib/espMqttClient/src/Transport/ClientPosix.h b/lib/espMqttClient/src/Transport/ClientPosix.h new file mode 100644 index 000000000..a2f9c9fae --- /dev/null +++ b/lib/espMqttClient/src/Transport/ClientPosix.h @@ -0,0 +1,51 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#if defined(__linux__) + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "Transport.h" // includes IPAddress +#include "../Logging.h" + +#ifndef EMC_POSIX_PEEK_SIZE +#define EMC_POSIX_PEEK_SIZE 1500 +#endif + +namespace espMqttClientInternals { + +class ClientPosix : public Transport { + public: + ClientPosix(); + ~ClientPosix(); + bool connect(IPAddress ip, uint16_t port) override; + bool connect(const char* host, uint16_t port) override; + size_t write(const uint8_t* buf, size_t size) override; + int read(uint8_t* buf, size_t size) override; + void stop() override; + bool connected() override; + bool disconnected() override; + + protected: + int _sockfd; + struct sockaddr_in _host; +}; + +} // namespace espMqttClientInternals + +#endif diff --git a/lib/espMqttClient/src/Transport/ClientSecureSync.cpp b/lib/espMqttClient/src/Transport/ClientSecureSync.cpp new file mode 100644 index 000000000..36288c6a5 --- /dev/null +++ b/lib/espMqttClient/src/Transport/ClientSecureSync.cpp @@ -0,0 +1,71 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) + +#include "ClientSecureSync.h" +#include // socket options + +namespace espMqttClientInternals { + +ClientSecureSync::ClientSecureSync() +: client() { + // empty +} + +bool ClientSecureSync::connect(IPAddress ip, uint16_t port) { + bool ret = client.connect(ip, port); // implicit conversion of return code int --> bool + if (ret) { + #if defined(ARDUINO_ARCH_ESP8266) + client.setNoDelay(true); + #elif defined(ARDUINO_ARCH_ESP32) + // Set TCP option directly to bypass lack of working setNoDelay for WiFiClientSecure + int val = true; + client.setSocketOption(IPPROTO_TCP, TCP_NODELAY, &val, sizeof(int)); + #endif + } + return ret; +} + +bool ClientSecureSync::connect(const char* host, uint16_t port) { + bool ret = client.connect(host, port); // implicit conversion of return code int --> bool + if (ret) { + #if defined(ARDUINO_ARCH_ESP8266) + client.setNoDelay(true); + #elif defined(ARDUINO_ARCH_ESP32) + // Set TCP option directly to bypass lack of working setNoDelay for WiFiClientSecure + int val = true; + client.setSocketOption(IPPROTO_TCP, TCP_NODELAY, &val, sizeof(int)); + #endif + } + return ret; +} + +size_t ClientSecureSync::write(const uint8_t* buf, size_t size) { + return client.write(buf, size); +} + +int ClientSecureSync::read(uint8_t* buf, size_t size) { + return client.read(buf, size); +} + +void ClientSecureSync::stop() { + client.stop(); +} + +bool ClientSecureSync::connected() { + return client.connected(); +} + +bool ClientSecureSync::disconnected() { + return !client.connected(); +} + +} // namespace espMqttClientInternals + +#endif diff --git a/lib/espMqttClient/src/Transport/ClientSecureSync.h b/lib/espMqttClient/src/Transport/ClientSecureSync.h new file mode 100644 index 000000000..b81681e36 --- /dev/null +++ b/lib/espMqttClient/src/Transport/ClientSecureSync.h @@ -0,0 +1,34 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) + +#include // includes IPAddress + +#include "Transport.h" + +namespace espMqttClientInternals { + +class ClientSecureSync : public Transport { + public: + ClientSecureSync(); + bool connect(IPAddress ip, uint16_t port) override; + bool connect(const char* host, uint16_t port) override; + size_t write(const uint8_t* buf, size_t size) override; + int read(uint8_t* buf, size_t size) override; + void stop() override; + bool connected() override; + bool disconnected() override; + WiFiClientSecure client; +}; + +} // namespace espMqttClientInternals + +#endif diff --git a/lib/espMqttClient/src/Transport/ClientSync.cpp b/lib/espMqttClient/src/Transport/ClientSync.cpp new file mode 100644 index 000000000..b2c4045f1 --- /dev/null +++ b/lib/espMqttClient/src/Transport/ClientSync.cpp @@ -0,0 +1,71 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) + +#include "ClientSync.h" +#include // socket options + +namespace espMqttClientInternals { + +ClientSync::ClientSync() +: client() { + // empty +} + +bool ClientSync::connect(IPAddress ip, uint16_t port) { + bool ret = client.connect(ip, port); // implicit conversion of return code int --> bool + if (ret) { + #if defined(ARDUINO_ARCH_ESP8266) + client.setNoDelay(true); + #elif defined(ARDUINO_ARCH_ESP32) + // Set TCP option directly to bypass lack of working setNoDelay for WiFiClientSecure (for consistency also here) + int val = true; + client.setSocketOption(IPPROTO_TCP, TCP_NODELAY, &val, sizeof(int)); + #endif + } + return ret; +} + +bool ClientSync::connect(const char* host, uint16_t port) { + bool ret = client.connect(host, port); // implicit conversion of return code int --> bool + if (ret) { + #if defined(ARDUINO_ARCH_ESP8266) + client.setNoDelay(true); + #elif defined(ARDUINO_ARCH_ESP32) + // Set TCP option directly to bypass lack of working setNoDelay for WiFiClientSecure (for consistency also here) + int val = true; + client.setSocketOption(IPPROTO_TCP, TCP_NODELAY, &val, sizeof(int)); + #endif + } + return ret; +} + +size_t ClientSync::write(const uint8_t* buf, size_t size) { + return client.write(buf, size); +} + +int ClientSync::read(uint8_t* buf, size_t size) { + return client.read(buf, size); +} + +void ClientSync::stop() { + client.stop(); +} + +bool ClientSync::connected() { + return client.connected(); +} + +bool ClientSync::disconnected() { + return !client.connected(); +} + +} // namespace espMqttClientInternals + +#endif diff --git a/lib/espMqttClient/src/Transport/ClientSync.h b/lib/espMqttClient/src/Transport/ClientSync.h new file mode 100644 index 000000000..ccfbdbae5 --- /dev/null +++ b/lib/espMqttClient/src/Transport/ClientSync.h @@ -0,0 +1,34 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) + +#include // includes IPAddress + +#include "Transport.h" + +namespace espMqttClientInternals { + +class ClientSync : public Transport { + public: + ClientSync(); + bool connect(IPAddress ip, uint16_t port) override; + bool connect(const char* host, uint16_t port) override; + size_t write(const uint8_t* buf, size_t size) override; + int read(uint8_t* buf, size_t size) override; + void stop() override; + bool connected() override; + bool disconnected() override; + WiFiClient client; +}; + +} // namespace espMqttClientInternals + +#endif diff --git a/lib/espMqttClient/src/Transport/IPAddress.cpp b/lib/espMqttClient/src/Transport/IPAddress.cpp new file mode 100644 index 000000000..b198429dc --- /dev/null +++ b/lib/espMqttClient/src/Transport/IPAddress.cpp @@ -0,0 +1,32 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#if defined(__linux__) + +#include "IPAddress.h" + +IPAddress::IPAddress() +: _address(0) { + // empty +} + +IPAddress::IPAddress(uint8_t p0, uint8_t p1, uint8_t p2, uint8_t p3) +: _address(0) { + _address = (uint32_t)p0 << 24 | (uint32_t)p1 << 16 | (uint32_t)p2 << 8 | p3; +} + +IPAddress::IPAddress(uint32_t address) +: _address(address) { + // empty +} + +IPAddress::operator uint32_t() { + return _address; +} + +#endif diff --git a/lib/espMqttClient/src/Transport/IPAddress.h b/lib/espMqttClient/src/Transport/IPAddress.h new file mode 100644 index 000000000..279a1957d --- /dev/null +++ b/lib/espMqttClient/src/Transport/IPAddress.h @@ -0,0 +1,28 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#if defined(ARDUINO) + #include +#else + +#include + +class IPAddress { + public: + IPAddress(); + IPAddress(uint8_t p0, uint8_t p1, uint8_t p2, uint8_t p3); + explicit IPAddress(uint32_t address); + operator uint32_t(); + + protected: + uint32_t _address; +}; + +#endif diff --git a/lib/espMqttClient/src/Transport/Transport.h b/lib/espMqttClient/src/Transport/Transport.h new file mode 100644 index 000000000..6720c024f --- /dev/null +++ b/lib/espMqttClient/src/Transport/Transport.h @@ -0,0 +1,28 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#include // size_t + +#include "IPAddress.h" + +namespace espMqttClientInternals { + +class Transport { + public: + virtual bool connect(IPAddress ip, uint16_t port) = 0; + virtual bool connect(const char* host, uint16_t port) = 0; + virtual size_t write(const uint8_t* buf, size_t size) = 0; + virtual int read(uint8_t* buf, size_t size) = 0; + virtual void stop() = 0; + virtual bool connected() = 0; + virtual bool disconnected() = 0; +}; + +} // namespace espMqttClientInternals diff --git a/lib/espMqttClient/src/TypeDefs.cpp b/lib/espMqttClient/src/TypeDefs.cpp new file mode 100644 index 000000000..4f92c1f64 --- /dev/null +++ b/lib/espMqttClient/src/TypeDefs.cpp @@ -0,0 +1,51 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +Parts are based on the original work of Marvin Roger: +https://github.com/marvinroger/async-mqtt-client + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#include "TypeDefs.h" + +namespace espMqttClientTypes { + +const char* disconnectReasonToString(DisconnectReason reason) { + switch (reason) { + case DisconnectReason::USER_OK: return "No error"; + case DisconnectReason::MQTT_UNACCEPTABLE_PROTOCOL_VERSION: return "Unacceptable protocol version"; + case DisconnectReason::MQTT_IDENTIFIER_REJECTED: return "Identified rejected"; + case DisconnectReason::MQTT_SERVER_UNAVAILABLE: return "Server unavailable"; + case DisconnectReason::MQTT_MALFORMED_CREDENTIALS: return "Malformed credentials"; + case DisconnectReason::MQTT_NOT_AUTHORIZED: return "Not authorized"; + case DisconnectReason::TLS_BAD_FINGERPRINT: return "Bad fingerprint"; + case DisconnectReason::TCP_DISCONNECTED: return "TCP disconnected"; + default: return ""; + } +} + +const char* subscribeReturncodeToString(SubscribeReturncode returnCode) { + switch (returnCode) { + case SubscribeReturncode::QOS0: return "QoS 0"; + case SubscribeReturncode::QOS1: return "QoS 1"; + case SubscribeReturncode::QOS2: return "QoS 2"; + case SubscribeReturncode::FAIL: return "Failed"; + default: return ""; + } +} + +const char* errorToString(Error error) { + switch (error) { + case Error::SUCCESS: return "Success"; + case Error::OUT_OF_MEMORY: return "Out of memory"; + case Error::MAX_RETRIES: return "Maximum retries exceeded"; + case Error::MALFORMED_PARAMETER: return "Malformed parameters"; + case Error::MISC_ERROR: return "Misc error"; + default: return ""; + } +} + +} // end namespace espMqttClientTypes diff --git a/lib/espMqttClient/src/TypeDefs.h b/lib/espMqttClient/src/TypeDefs.h new file mode 100644 index 000000000..0f1536069 --- /dev/null +++ b/lib/espMqttClient/src/TypeDefs.h @@ -0,0 +1,73 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +Parts are based on the original work of Marvin Roger: +https://github.com/marvinroger/async-mqtt-client + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#include +#include +#include + +namespace espMqttClientTypes { + +enum class DisconnectReason : uint8_t { + USER_OK = 0, + MQTT_UNACCEPTABLE_PROTOCOL_VERSION = 1, + MQTT_IDENTIFIER_REJECTED = 2, + MQTT_SERVER_UNAVAILABLE = 3, + MQTT_MALFORMED_CREDENTIALS = 4, + MQTT_NOT_AUTHORIZED = 5, + TLS_BAD_FINGERPRINT = 6, + TCP_DISCONNECTED = 7 +}; + +const char* disconnectReasonToString(DisconnectReason reason); + +enum class SubscribeReturncode : uint8_t { + QOS0 = 0x00, + QOS1 = 0x01, + QOS2 = 0x02, + FAIL = 0X80 +}; + +const char* subscribeReturncodeToString(SubscribeReturncode returnCode); + +enum class Error : uint8_t { + SUCCESS = 0, + OUT_OF_MEMORY = 1, + MAX_RETRIES = 2, + MALFORMED_PARAMETER = 3, + MISC_ERROR = 4 +}; + +const char* errorToString(Error error); + +struct MessageProperties { + uint8_t qos; + bool dup; + bool retain; + uint16_t packetId; +}; + +typedef std::function OnConnectCallback; +typedef std::function OnDisconnectCallback; +typedef std::function OnSubscribeCallback; +typedef std::function OnUnsubscribeCallback; +typedef std::function OnMessageCallback; +typedef std::function OnPublishCallback; +typedef std::function PayloadCallback; +typedef std::function OnErrorCallback; + +enum class UseInternalTask { + NO = 0, + YES = 1, +}; + +} // end namespace espMqttClientTypes diff --git a/lib/espMqttClient/src/espMqttClient.cpp b/lib/espMqttClient/src/espMqttClient.cpp new file mode 100644 index 000000000..833ece10b --- /dev/null +++ b/lib/espMqttClient/src/espMqttClient.cpp @@ -0,0 +1,113 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#include "espMqttClient.h" + +#if defined(ARDUINO_ARCH_ESP8266) +espMqttClient::espMqttClient() +: MqttClientSetup(espMqttClientTypes::UseInternalTask::NO) +, _client() { + _transport = &_client; +} + +espMqttClientSecure::espMqttClientSecure() +: MqttClientSetup(espMqttClientTypes::UseInternalTask::NO) +, _client() { + _transport = &_client; +} + +espMqttClientSecure& espMqttClientSecure::setInsecure() { + _client.client.setInsecure(); + return *this; +} + +espMqttClientSecure& espMqttClientSecure::setFingerprint(const uint8_t fingerprint[20]) { + _client.client.setFingerprint(fingerprint); + return *this; +} + +espMqttClientSecure& espMqttClientSecure::setTrustAnchors(const X509List *ta) { + _client.client.setTrustAnchors(ta); + return *this; +} + +espMqttClientSecure& espMqttClientSecure::setClientRSACert(const X509List *cert, const PrivateKey *sk) { + _client.client.setClientRSACert(cert, sk); + return *this; +} + +espMqttClientSecure& espMqttClientSecure::setClientECCert(const X509List *cert, const PrivateKey *sk, unsigned allowed_usages, unsigned cert_issuer_key_type) { + _client.client.setClientECCert(cert, sk, allowed_usages, cert_issuer_key_type); + return *this; +} + +espMqttClientSecure& espMqttClientSecure::setCertStore(CertStoreBase *certStore) { + _client.client.setCertStore(certStore); + return *this; +} +#endif + +#if defined(ARDUINO_ARCH_ESP32) +espMqttClient::espMqttClient(espMqttClientTypes::UseInternalTask useInternalTask) +: MqttClientSetup(useInternalTask) +, _client() { + _transport = &_client; +} + +espMqttClient::espMqttClient(uint8_t priority, uint8_t core) +: MqttClientSetup(espMqttClientTypes::UseInternalTask::YES, priority, core) +, _client() { + _transport = &_client; +} + +espMqttClientSecure::espMqttClientSecure(espMqttClientTypes::UseInternalTask useInternalTask) +: MqttClientSetup(useInternalTask) +, _client() { + _transport = &_client; +} + +espMqttClientSecure::espMqttClientSecure(uint8_t priority, uint8_t core) +: MqttClientSetup(espMqttClientTypes::UseInternalTask::YES, priority, core) +, _client() { + _transport = &_client; +} + +espMqttClientSecure& espMqttClientSecure::setInsecure() { + _client.client.setInsecure(); + return *this; +} + +espMqttClientSecure& espMqttClientSecure::setCACert(const char* rootCA) { + _client.client.setCACert(rootCA); + return *this; +} + +espMqttClientSecure& espMqttClientSecure::setCertificate(const char* clientCa) { + _client.client.setCertificate(clientCa); + return *this; +} + +espMqttClientSecure& espMqttClientSecure::setPrivateKey(const char* privateKey) { + _client.client.setPrivateKey(privateKey); + return *this; +} + +espMqttClientSecure& espMqttClientSecure::setPreSharedKey(const char* pskIdent, const char* psKey) { + _client.client.setPreSharedKey(pskIdent, psKey); + return *this; +} + +#endif + +#if defined(__linux__) +espMqttClient::espMqttClient() +: MqttClientSetup(espMqttClientTypes::UseInternalTask::NO) +, _client() { + _transport = &_client; +} +#endif diff --git a/lib/espMqttClient/src/espMqttClient.h b/lib/espMqttClient/src/espMqttClient.h new file mode 100644 index 000000000..4e448011d --- /dev/null +++ b/lib/espMqttClient/src/espMqttClient.h @@ -0,0 +1,80 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +API is based on the original work of Marvin Roger: +https://github.com/marvinroger/async-mqtt-client + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) +#include "Transport/ClientSync.h" +#include "Transport/ClientSecureSync.h" +#elif defined(__linux__) +#include "Transport/ClientPosix.h" +#endif + +#include "MqttClientSetup.h" + +#if defined(ARDUINO_ARCH_ESP8266) +class espMqttClient : public MqttClientSetup { + public: + espMqttClient(); + + protected: + espMqttClientInternals::ClientSync _client; +}; + +class espMqttClientSecure : public MqttClientSetup { + public: + espMqttClientSecure(); + espMqttClientSecure& setInsecure(); + espMqttClientSecure& setFingerprint(const uint8_t fingerprint[20]); + espMqttClientSecure& setTrustAnchors(const X509List *ta); + espMqttClientSecure& setClientRSACert(const X509List *cert, const PrivateKey *sk); + espMqttClientSecure& setClientECCert(const X509List *cert, const PrivateKey *sk, unsigned allowed_usages, unsigned cert_issuer_key_type); + espMqttClientSecure& setCertStore(CertStoreBase *certStore); + + protected: + espMqttClientInternals::ClientSecureSync _client; +}; +#endif + +#if defined(ARDUINO_ARCH_ESP32) +class espMqttClient : public MqttClientSetup { + public: + explicit espMqttClient(espMqttClientTypes::UseInternalTask useInternalTask); + explicit espMqttClient(uint8_t priority = 1, uint8_t core = 1); + + protected: + espMqttClientInternals::ClientSync _client; +}; + +class espMqttClientSecure : public MqttClientSetup { + public: + explicit espMqttClientSecure(espMqttClientTypes::UseInternalTask useInternalTask); + explicit espMqttClientSecure(uint8_t priority = 1, uint8_t core = 1); + espMqttClientSecure& setInsecure(); + espMqttClientSecure& setCACert(const char* rootCA); + espMqttClientSecure& setCertificate(const char* clientCa); + espMqttClientSecure& setPrivateKey(const char* privateKey); + espMqttClientSecure& setPreSharedKey(const char* pskIdent, const char* psKey); + + protected: + espMqttClientInternals::ClientSecureSync _client; +}; +#endif + +#if defined(__linux__) +class espMqttClient : public MqttClientSetup { + public: + espMqttClient(); + + protected: + espMqttClientInternals::ClientPosix _client; +}; +#endif diff --git a/lib/espMqttClient/src/espMqttClientAsync.cpp b/lib/espMqttClient/src/espMqttClientAsync.cpp new file mode 100644 index 000000000..98b7f1519 --- /dev/null +++ b/lib/espMqttClient/src/espMqttClientAsync.cpp @@ -0,0 +1,61 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) + +#include "espMqttClientAsync.h" + +espMqttClientAsync::espMqttClientAsync() +: MqttClientSetup(espMqttClientTypes::UseInternalTask::NO) +, _clientAsync() { + _transport = &_clientAsync; + _clientAsync.client.onConnect(onConnectCb, this); + _clientAsync.client.onDisconnect(onDisconnectCb, this); + _clientAsync.client.onData(onDataCb, this); + _clientAsync.client.onPoll(onPollCb, this); +} + +bool espMqttClientAsync::connect() { + bool ret = MqttClient::connect(); + loop(); + return ret; +} + +void espMqttClientAsync::_setupClient(espMqttClientAsync* c) { + (void)c; +} + +void espMqttClientAsync::onConnectCb(void* a, AsyncClient* c) { + c->setNoDelay(true); + espMqttClientAsync* client = reinterpret_cast(a); + client->_state = MqttClient::State::connectingTcp2; + client->loop(); +} + +void espMqttClientAsync::onDataCb(void* a, AsyncClient* c, void* data, size_t len) { + (void)c; + espMqttClientAsync* client = reinterpret_cast(a); + client->_clientAsync.bufData = reinterpret_cast(data); + client->_clientAsync.availableData = len; + client->loop(); +} + +void espMqttClientAsync::onDisconnectCb(void* a, AsyncClient* c) { + (void)c; + espMqttClientAsync* client = reinterpret_cast(a); + client->_state = MqttClient::State::disconnectingTcp2; + client->loop(); +} + +void espMqttClientAsync::onPollCb(void* a, AsyncClient* c) { + (void)c; + espMqttClientAsync* client = reinterpret_cast(a); + client->loop(); +} + +#endif diff --git a/lib/espMqttClient/src/espMqttClientAsync.h b/lib/espMqttClient/src/espMqttClientAsync.h new file mode 100644 index 000000000..1b9ed8beb --- /dev/null +++ b/lib/espMqttClient/src/espMqttClientAsync.h @@ -0,0 +1,36 @@ +/* +Copyright (c) 2022 Bert Melis. All rights reserved. + +API is based on the original work of Marvin Roger: +https://github.com/marvinroger/async-mqtt-client + +This work is licensed under the terms of the MIT license. +For a copy, see or +the LICENSE file. +*/ + +#pragma once + +#if defined(ARDUINO_ARCH_ESP8266) || defined(ARDUINO_ARCH_ESP32) + +#include "Transport/ClientAsync.h" + +#include "MqttClientSetup.h" + +class espMqttClientAsync : public MqttClientSetup { + public: + espMqttClientAsync(); + bool connect(); + + protected: + espMqttClientInternals::ClientAsync _clientAsync; + static void _setupClient(espMqttClientAsync* c); + static void _disconnectClient(espMqttClientAsync* c); + + static void onConnectCb(void* a, AsyncClient* c); + static void onDataCb(void* a, AsyncClient* c, void* data, size_t len); + static void onDisconnectCb(void* a, AsyncClient* c); + static void onPollCb(void* a, AsyncClient* c); +}; + +#endif diff --git a/lib/framework/ESP8266React.h b/lib/framework/ESP8266React.h index 953232f78..32ca0f55c 100644 --- a/lib/framework/ESP8266React.h +++ b/lib/framework/ESP8266React.h @@ -59,7 +59,7 @@ class ESP8266React { return &_mqttSettingsService; } - AsyncMqttClient * getMqttClient() { + espMqttClient * getMqttClient() { return _mqttSettingsService.getMqttClient(); } diff --git a/lib/framework/MqttPubSub.h b/lib/framework/MqttPubSub.h deleted file mode 100644 index fe8e56434..000000000 --- a/lib/framework/MqttPubSub.h +++ /dev/null @@ -1,163 +0,0 @@ -#ifndef MqttPubSub_h -#define MqttPubSub_h - -#include -#include - -using namespace std::placeholders; // for `_1` etc - -#define MQTT_ORIGIN_ID "mqtt" - -template -class MqttConnector { - protected: - StatefulService * _statefulService; - AsyncMqttClient * _mqttClient; - size_t _bufferSize; - - MqttConnector(StatefulService * statefulService, AsyncMqttClient * mqttClient, size_t bufferSize) - : _statefulService(statefulService) - , _mqttClient(mqttClient) - , _bufferSize(bufferSize) { - _mqttClient->onConnect(std::bind(&MqttConnector::onConnect, this)); - } - - virtual void onConnect() = 0; - - public: - inline AsyncMqttClient * getMqttClient() const { - return _mqttClient; - } -}; - -template -class MqttPub : virtual public MqttConnector { - public: - MqttPub(JsonStateReader stateReader, - StatefulService * statefulService, - AsyncMqttClient * mqttClient, - const String & pubTopic = "", - size_t bufferSize = DEFAULT_BUFFER_SIZE) - : MqttConnector(statefulService, mqttClient, bufferSize) - , _stateReader(stateReader) - , _pubTopic(pubTopic) { - MqttConnector::_statefulService->addUpdateHandler([&](const String & originId) { publish(); }, false); - } - - void setPubTopic(const String & pubTopic) { - _pubTopic = pubTopic; - publish(); - } - - protected: - virtual void onConnect() { - publish(); - } - - private: - JsonStateReader _stateReader; - String _pubTopic; - - void publish() { - if (_pubTopic.length() > 0 && MqttConnector::_mqttClient->connected()) { - // serialize to json doc - DynamicJsonDocument json(MqttConnector::_bufferSize); - JsonObject jsonObject = json.to(); - MqttConnector::_statefulService->read(jsonObject, _stateReader); - - // serialize to string - String payload; - serializeJson(json, payload); - - // publish the payload - MqttConnector::_mqttClient->publish(_pubTopic.c_str(), 0, false, payload.c_str()); - } - } -}; - -template -class MqttSub : virtual public MqttConnector { - public: - MqttSub(JsonStateUpdater stateUpdater, - StatefulService * statefulService, - AsyncMqttClient * mqttClient, - const String & subTopic = "", - size_t bufferSize = DEFAULT_BUFFER_SIZE) - : MqttConnector(statefulService, mqttClient, bufferSize) - , _stateUpdater(stateUpdater) - , _subTopic(subTopic) { - MqttConnector::_mqttClient->onMessage(std::bind(&MqttSub::onMqttMessage, this, _1, _2, _3, _4, _5, _6)); - } - - void setSubTopic(const String & subTopic) { - if (!_subTopic.equals(subTopic)) { - // unsubscribe from the existing topic if one was set - if (_subTopic.length() > 0) { - MqttConnector::_mqttClient->unsubscribe(_subTopic.c_str()); - } - // set the new topic and re-configure the subscription - _subTopic = subTopic; - subscribe(); - } - } - - protected: - virtual void onConnect() { - subscribe(); - } - - private: - JsonStateUpdater _stateUpdater; - String _subTopic; - - void subscribe() { - if (_subTopic.length() > 0) { - MqttConnector::_mqttClient->subscribe(_subTopic.c_str(), 2); - } - } - - void onMqttMessage(char * topic, char * payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total) { - // we only care about the topic we are watching in this class - if (strcmp(_subTopic.c_str(), topic)) { - return; - } - - // deserialize from string - DynamicJsonDocument json(MqttConnector::_bufferSize); - DeserializationError error = deserializeJson(json, payload, len); - if (!error && json.is()) { - JsonObject jsonObject = json.as(); - MqttConnector::_statefulService->update(jsonObject, _stateUpdater, MQTT_ORIGIN_ID); - } - } -}; - -template -class MqttPubSub : public MqttPub, public MqttSub { - public: - MqttPubSub(JsonStateReader stateReader, - JsonStateUpdater stateUpdater, - StatefulService * statefulService, - AsyncMqttClient * mqttClient, - const String & pubTopic = "", - const String & subTopic = "", - size_t bufferSize = DEFAULT_BUFFER_SIZE) - : MqttConnector(statefulService, mqttClient, bufferSize) - , MqttPub(stateReader, statefulService, mqttClient, pubTopic, bufferSize) - , MqttSub(stateUpdater, statefulService, mqttClient, subTopic, bufferSize) { - } - - public: - void configureTopics(const String & pubTopic, const String & subTopic) { - MqttSub::setSubTopic(subTopic); - MqttPub::setPubTopic(pubTopic); - } - - protected: - void onConnect() { - MqttSub::onConnect(); - MqttPub::onConnect(); - } -}; - -#endif diff --git a/lib/framework/MqttSettingsService.cpp b/lib/framework/MqttSettingsService.cpp index 13e9d243d..59b5c0f43 100644 --- a/lib/framework/MqttSettingsService.cpp +++ b/lib/framework/MqttSettingsService.cpp @@ -33,8 +33,8 @@ MqttSettingsService::MqttSettingsService(AsyncWebServer * server, FS * fs, Secur , _retainedPassword(nullptr) , _reconfigureMqtt(false) , _disconnectedAt(0) - , _disconnectReason(AsyncMqttClientDisconnectReason::TCP_DISCONNECTED) - , _mqttClient() { + , _disconnectReason(espMqttClientTypes::DisconnectReason::TCP_DISCONNECTED) + , _mqttClient(espMqttClientTypes::UseInternalTask::NO) { WiFi.onEvent(std::bind(&MqttSettingsService::WiFiEvent, this, _1, _2)); _mqttClient.onConnect(std::bind(&MqttSettingsService::onMqttConnect, this, _1)); _mqttClient.onDisconnect(std::bind(&MqttSettingsService::onMqttDisconnect, this, _1)); @@ -51,12 +51,13 @@ void MqttSettingsService::begin() { void MqttSettingsService::loop() { if (_reconfigureMqtt || (_disconnectedAt && (uint32_t)(uuid::get_uptime() - _disconnectedAt) >= MQTT_RECONNECTION_DELAY)) { // reconfigure MQTT client - configureMqtt(); - - // clear the reconnection flags + _disconnectedAt = uuid::get_uptime(); + if (configureMqtt()) { + _disconnectedAt = 0; + } _reconfigureMqtt = false; - _disconnectedAt = 0; } + _mqttClient.loop(); } bool MqttSettingsService::isEnabled() { @@ -71,22 +72,27 @@ const char * MqttSettingsService::getClientId() { return _mqttClient.getClientId(); } -AsyncMqttClientDisconnectReason MqttSettingsService::getDisconnectReason() { +espMqttClientTypes::DisconnectReason MqttSettingsService::getDisconnectReason() { return _disconnectReason; } -AsyncMqttClient * MqttSettingsService::getMqttClient() { +espMqttClient * MqttSettingsService::getMqttClient() { return &_mqttClient; } void MqttSettingsService::onMqttConnect(bool sessionPresent) { + // _disconnectedAt = 0; + emsesp::EMSESP::mqtt_.on_connect(); // emsesp::EMSESP::logger().info("Connected to MQTT, %s", (sessionPresent) ? ("with persistent session") : ("without persistent session")); } -void MqttSettingsService::onMqttDisconnect(AsyncMqttClientDisconnectReason reason) { +void MqttSettingsService::onMqttDisconnect(espMqttClientTypes::DisconnectReason reason) { // emsesp::EMSESP::logger().info("Disconnected from MQTT reason: %d", (uint8_t)reason); _disconnectReason = reason; - _disconnectedAt = uuid::get_uptime(); + if (!_disconnectedAt) { + _disconnectedAt = uuid::get_uptime(); + } + emsesp::EMSESP::mqtt_.on_disconnect(reason); } void MqttSettingsService::onConfigUpdated() { @@ -112,7 +118,7 @@ void MqttSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) { case ARDUINO_EVENT_ETH_DISCONNECTED: if (_state.enabled) { // emsesp::EMSESP::logger().info("Network connection dropped, stopping MQTT client"); - _mqttClient.disconnect(); + _mqttClient.disconnect(true); } break; @@ -121,9 +127,9 @@ void MqttSettingsService::WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info) { } } -void MqttSettingsService::configureMqtt() { +bool MqttSettingsService::configureMqtt() { // disconnect if connected - _mqttClient.disconnect(); + _mqttClient.disconnect(true); // only connect if WiFi is connected and MQTT is enabled if (_state.enabled && emsesp::EMSESP::system_.network_connected() && !_state.host.isEmpty()) { // emsesp::EMSESP::logger().info("Configuring MQTT client"); @@ -137,11 +143,11 @@ void MqttSettingsService::configureMqtt() { _mqttClient.setClientId(retainCstr(_state.clientId.c_str(), &_retainedClientId)); _mqttClient.setKeepAlive(_state.keepAlive); _mqttClient.setCleanSession(_state.cleanSession); - _mqttClient.setMaxTopicLength(FACTORY_MQTT_MAX_TOPIC_LENGTH); // hardcode. We don't take this from the settings anymore. - _mqttClient.connect(); + return _mqttClient.connect(); // } else { // emsesp::EMSESP::logger().info("Error configuring MQTT client"); } + return false; } void MqttSettings::read(MqttSettings & settings, JsonObject & root) { diff --git a/lib/framework/MqttSettingsService.h b/lib/framework/MqttSettingsService.h index d013853b5..1db25c0d4 100644 --- a/lib/framework/MqttSettingsService.h +++ b/lib/framework/MqttSettingsService.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include @@ -104,13 +104,13 @@ class MqttSettingsService : public StatefulService { MqttSettingsService(AsyncWebServer * server, FS * fs, SecurityManager * securityManager); ~MqttSettingsService(); - void begin(); - void loop(); - bool isEnabled(); - bool isConnected(); - const char * getClientId(); - AsyncMqttClientDisconnectReason getDisconnectReason(); - AsyncMqttClient * getMqttClient(); + void begin(); + void loop(); + bool isEnabled(); + bool isConnected(); + const char * getClientId(); + espMqttClientTypes::DisconnectReason getDisconnectReason(); + espMqttClient * getMqttClient(); protected: void onConfigUpdated(); @@ -120,7 +120,7 @@ class MqttSettingsService : public StatefulService { FSPersistence _fsPersistence; // Pointers to hold retained copies of the mqtt client connection strings. - // This is required as AsyncMqttClient holds references to the supplied connection strings. + // This is required as espMqttClient holds references to the supplied connection strings. char * _retainedHost; char * _retainedClientId; char * _retainedUsername; @@ -131,15 +131,15 @@ class MqttSettingsService : public StatefulService { unsigned long _disconnectedAt; // connection status - AsyncMqttClientDisconnectReason _disconnectReason; + espMqttClientTypes::DisconnectReason _disconnectReason; // the MQTT client instance - AsyncMqttClient _mqttClient; + espMqttClient _mqttClient; void WiFiEvent(WiFiEvent_t event, WiFiEventInfo_t info); void onMqttConnect(bool sessionPresent); - void onMqttDisconnect(AsyncMqttClientDisconnectReason reason); - void configureMqtt(); + void onMqttDisconnect(espMqttClientTypes::DisconnectReason reason); + bool configureMqtt(); }; #endif diff --git a/src/command.cpp b/src/command.cpp index 1f5cb1fc6..3bb89fd69 100644 --- a/src/command.cpp +++ b/src/command.cpp @@ -602,6 +602,19 @@ void Command::show_all(uuid::console::Shell & shell) { shell.print(COLOR_RESET); show(shell, EMSdevice::DeviceType::SYSTEM, true); + // show Custom + if (EMSESP::webEntityService.has_commands()) { + shell.print(COLOR_BOLD_ON); + shell.print(COLOR_YELLOW); + shell.printf(" %s: ", EMSdevice::device_type_2_device_name(EMSdevice::DeviceType::CUSTOM)); + shell.println(COLOR_RESET); + shell.printf(" info: %slists all values %s*", COLOR_BRIGHT_CYAN, COLOR_BRIGHT_RED); + shell.println(COLOR_RESET); + shell.printf(" commands: %slists all commands %s*", COLOR_BRIGHT_CYAN, COLOR_BRIGHT_RED); + shell.print(COLOR_RESET); + show(shell, EMSdevice::DeviceType::CUSTOM, true); + } + // show scheduler if (EMSESP::webSchedulerService.has_commands()) { shell.print(COLOR_BOLD_ON); diff --git a/src/devices/thermostat.cpp b/src/devices/thermostat.cpp index 6025ded43..1b00ba870 100644 --- a/src/devices/thermostat.cpp +++ b/src/devices/thermostat.cpp @@ -136,6 +136,8 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i summer_typeids = {0x02AF, 0x02B0, 0x02B1, 0x02B2, 0x02B3, 0x02B4, 0x02B5, 0x02B6}; curve_typeids = {0x029B, 0x029C, 0x029D, 0x029E, 0x029F, 0x02A0, 0x02A1, 0x02A2}; summer2_typeids = {0x0471, 0x0472, 0x0473, 0x0474, 0x0475, 0x0476, 0x0477, 0x0478}; + hp_typeids = {0x0467, 0x0468, 0x0469, 0x046A}; + hpmode_typeids = {0x0291, 0x0292, 0x0293, 0x0294}; for (uint8_t i = 0; i < monitor_typeids.size(); i++) { register_telegram_type(monitor_typeids[i], "RC300Monitor", false, MAKE_PF_CB(process_RC300Monitor)); register_telegram_type(set_typeids[i], "RC300Set", false, MAKE_PF_CB(process_RC300Set)); @@ -145,6 +147,8 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i } for (uint8_t i = 0; i < set2_typeids.size(); i++) { register_telegram_type(set2_typeids[i], "RC300Set2", false, MAKE_PF_CB(process_RC300Set2)); + register_telegram_type(hp_typeids[i], "HPSet", false, MAKE_PF_CB(process_HPSet)); + register_telegram_type(hpmode_typeids[i], "HPMode", true, MAKE_PF_CB(process_HPMode)); } register_telegram_type(0x2F5, "RC300WWmode", true, MAKE_PF_CB(process_RC300WWmode)); register_telegram_type(0x31B, "RC300WWtemp", true, MAKE_PF_CB(process_RC300WWtemp)); @@ -306,6 +310,25 @@ std::shared_ptr Thermostat::heating_circuit(std::sha } } + // not found, search heatpump message types + if (hc_num == 0) { + for (uint8_t i = 0; i < hp_typeids.size(); i++) { + if (hp_typeids[i] == telegram->type_id) { + hc_num = i + 1; + break; + } + } + } + + if (hc_num == 0) { + for (uint8_t i = 0; i < hpmode_typeids.size(); i++) { + if (hpmode_typeids[i] == telegram->type_id) { + hc_num = i + 1; + break; + } + } + } + // not found, search device-id types for remote thermostats if (hc_num == 0 && telegram->src >= 0x18 && telegram->src <= 0x1F) { hc_num = telegram->src - 0x17; @@ -383,6 +406,9 @@ std::shared_ptr Thermostat::heating_circuit(std::sha if (summer2_typeids.size()) { toggle_fetch(summer2_typeids[hc_num - 1], toggle_); } + if (hp_typeids.size()) { + toggle_fetch(hp_typeids[hc_num - 1], toggle_); + } return new_hc; // return back point to new HC object } @@ -993,6 +1019,7 @@ void Thermostat::process_RC300Set(std::shared_ptr telegram) { has_update(telegram, hc->reducetemp, 9); has_update(telegram, hc->noreducetemp, 12); has_update(telegram, hc->remoteseltemp, 17); // see https://github.com/emsesp/EMS-ESP32/issues/590 + has_update(telegram, hc->cooling, 28); } // types 0x2AF ff @@ -1128,6 +1155,26 @@ void Thermostat::process_RC300Floordry(std::shared_ptr telegram) has_update(telegram, floordrytemp_, 1); } +// 0x291 ff. HP mode +void Thermostat::process_HPMode(std::shared_ptr telegram) { + std::shared_ptr hc = heating_circuit(telegram); + if (hc == nullptr) { + return; + } + has_update(telegram, hc->hpmode, 0); +} + +// 0x467 ff HP settings +void Thermostat::process_HPSet(std::shared_ptr telegram) { + std::shared_ptr hc = heating_circuit(telegram); + if (hc == nullptr) { + return; + } + has_update(telegram, hc->dewoffset, 0); // 7-35°C + has_update(telegram, hc->roomtempdiff, 3); // 1-10K + has_update(telegram, hc->hpminflowtemp, 4); // 2-10K +} + // type 0x41 - data from the RC30 thermostat(0x10) - 14 bytes long // RC30Monitor(0x41), data: 80 20 00 AC 00 00 00 02 00 05 09 00 AC 00 void Thermostat::process_RC30Monitor(std::shared_ptr telegram) { @@ -1447,6 +1494,62 @@ void Thermostat::process_RCErrorMessage(std::shared_ptr telegram * */ +// hp mode RC300 +bool Thermostat::set_roomtempdiff(const char * value, const int8_t id) { + uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id; + std::shared_ptr hc = heating_circuit(hc_num); + if (hc == nullptr) { + return false; + } + int v; + if (Helpers::value2number(value, v)) { + write_command(hp_typeids[hc->hc()], 3, v, hp_typeids[hc->hc()]); + return true; + } + return false; +} +bool Thermostat::set_dewoffset(const char * value, const int8_t id) { + uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id; + std::shared_ptr hc = heating_circuit(hc_num); + if (hc == nullptr) { + return false; + } + int v; + if (Helpers::value2number(value, v)) { + write_command(hp_typeids[hc->hc()], 4, v, hp_typeids[hc->hc()]); + return true; + } + return false; +} + +bool Thermostat::set_hpminflowtemp(const char * value, const int8_t id) { + uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id; + std::shared_ptr hc = heating_circuit(hc_num); + if (hc == nullptr) { + return false; + } + int v; + if (Helpers::value2temperature(value, v)) { + write_command(hp_typeids[hc->hc()], 0, v, hp_typeids[hc->hc()]); + return true; + } + return false; +} + +bool Thermostat::set_hpmode(const char * value, const int8_t id) { + uint8_t hc_num = (id == -1) ? AUTO_HEATING_CIRCUIT : id; + std::shared_ptr hc = heating_circuit(hc_num); + if (hc == nullptr) { + return false; + } + uint8_t v; + if (!Helpers::value2enum(value, v, FL_(enum_hpmode))) { + return false; + } + write_command(hpmode_typeids[hc->hc()], 0, v, hpmode_typeids[hc->hc()]); + return true; +} + // 0xBB Hybrid pump bool Thermostat::set_hybridStrategy(const char * value, const int8_t id) { uint8_t v; @@ -1868,6 +1971,20 @@ bool Thermostat::set_wwprio(const char * value, const int8_t id) { return true; } +// set cooling +bool Thermostat::set_cooling(const char * value, const int8_t id) { + std::shared_ptr hc = heating_circuit((id == -1) ? AUTO_HEATING_CIRCUIT : id); + if (hc == nullptr) { + return false; + } + + bool b; + if (!Helpers::value2bool(value, b)) { + return false; + } + write_command(set_typeids[hc->hc()], 28, b ? 0x01 : 0x00, set_typeids[hc->hc()]); + return true; +} // sets the thermostat ww circulation working mode, where mode is a string bool Thermostat::set_wwcircmode(const char * value, const int8_t id) { @@ -4076,6 +4193,13 @@ void Thermostat::register_device_values_hc(std::shared_ptrnoreducetemp, DeviceValueType::INT, FL_(noreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_noreducetemp)); register_device_value(tag, &hc->reducetemp, DeviceValueType::INT, FL_(reducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_reducetemp)); register_device_value(tag, &hc->wwprio, DeviceValueType::BOOL, FL_(wwprio), DeviceValueUOM::NONE, MAKE_CF_CB(set_wwprio)); + register_device_value(tag, &hc->cooling, DeviceValueType::BOOL, FL_(hpcooling), DeviceValueUOM::NONE, MAKE_CF_CB(set_cooling)); + + register_device_value(tag, &hc->hpmode, DeviceValueType::ENUM, FL_(enum_hpmode), FL_(hpmode), DeviceValueUOM::NONE, MAKE_CF_CB(set_hpmode)); + register_device_value(tag, &hc->dewoffset, DeviceValueType::UINT, FL_(dewoffset), DeviceValueUOM::K, MAKE_CF_CB(set_dewoffset)); + register_device_value(tag, &hc->roomtempdiff, DeviceValueType::UINT, FL_(roomtempdiff), DeviceValueUOM::K, MAKE_CF_CB(set_roomtempdiff)); + register_device_value(tag, &hc->hpminflowtemp, DeviceValueType::UINT, FL_(hpminflowtemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_hpminflowtemp)); + break; case EMS_DEVICE_FLAG_CRF: register_device_value(tag, &hc->mode, DeviceValueType::ENUM, FL_(enum_mode5), FL_(mode), DeviceValueUOM::NONE); @@ -4242,7 +4366,7 @@ void Thermostat::register_device_values_hc(std::shared_ptrnoreducetemp, DeviceValueType::INT, FL_(noreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_noreducetemp), -30, 10); + register_device_value(tag, &hc->noreducetemp, DeviceValueType::INT, FL_(noreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_noreducetemp), -31, 10); register_device_value(tag, &hc->reducetemp, DeviceValueType::INT, FL_(reducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_reducetemp), -20, 10); register_device_value(tag, &hc->vacreducetemp, DeviceValueType::INT, FL_(vacreducetemp), DeviceValueUOM::DEGREES, MAKE_CF_CB(set_vacreducetemp), -20, 10); register_device_value( diff --git a/src/devices/thermostat.h b/src/devices/thermostat.h index a73abd26b..6196b41b9 100644 --- a/src/devices/thermostat.h +++ b/src/devices/thermostat.h @@ -89,6 +89,12 @@ class Thermostat : public EMSdevice { uint16_t reduceminutes; // remaining minutes to night->day // FW100 temperature uint8_t roomsensor; // 1-intern, 2-extern, 3-autoselect the lower value + // hp + uint8_t dewoffset; + uint8_t roomtempdiff; + uint8_t hpminflowtemp; + uint8_t hpmode; + uint8_t cooling; uint8_t hc_num() const { return hc_num_; @@ -170,6 +176,8 @@ class Thermostat : public EMSdevice { std::vector summer_typeids; std::vector summer2_typeids; std::vector curve_typeids; + std::vector hp_typeids; + std::vector hpmode_typeids; // standard for all thermostats char status_[20]; // online or offline @@ -392,6 +400,8 @@ class Thermostat : public EMSdevice { void process_RemoteTemp(std::shared_ptr telegram); void process_RemoteHumidity(std::shared_ptr telegram); void process_RemoteCorrection(std::shared_ptr telegram); + void process_HPSet(std::shared_ptr telegram); + void process_HPMode(std::shared_ptr telegram); // internal helper functions bool set_mode_n(const uint8_t mode, const uint8_t hc_num); @@ -551,6 +561,12 @@ class Thermostat : public EMSdevice { bool set_pvEnableWw(const char * value, const int8_t id); bool set_pvRaiseHeat(const char * value, const int8_t id); bool set_pvLowerCool(const char * value, const int8_t id); + + bool set_roomtempdiff(const char * value, const int8_t id); + bool set_dewoffset(const char * value, const int8_t id); + bool set_hpminflowtemp(const char * value, const int8_t id); + bool set_hpmode(const char * value, const int8_t id); + bool set_cooling(const char * value, const int8_t id); }; } // namespace emsesp diff --git a/src/devices/ventilation.cpp b/src/devices/ventilation.cpp index 18d2d1579..0c81519ef 100644 --- a/src/devices/ventilation.cpp +++ b/src/devices/ventilation.cpp @@ -29,6 +29,7 @@ Ventilation::Ventilation(uint8_t device_type, uint8_t device_id, uint8_t product register_telegram_type(0x585, "Blowerspeed", false, MAKE_PF_CB(process_BlowerMessage)); register_telegram_type(0x583, "VentilationMonitor", false, MAKE_PF_CB(process_MonitorMessage)); register_telegram_type(0x5D9, "Airquality", false, MAKE_PF_CB(process_VOCMessage)); + register_telegram_type(0x587, "Bypass", false, MAKE_PF_CB(process_BypassMessage)); // register_telegram_type(0x5, "VentilationSet", true, MAKE_PF_CB(process_SetMessage)); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, @@ -43,8 +44,9 @@ Ventilation::Ventilation(uint8_t device_type, uint8_t device_id, uint8_t product register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &ventInSpeed_, DeviceValueType::UINT, FL_(ventInSpeed), DeviceValueUOM::PERCENT); register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &ventOutSpeed_, DeviceValueType::UINT, FL_(ventOutSpeed), DeviceValueUOM::PERCENT); register_device_value( - DeviceValueTAG::TAG_DEVICE_DATA, &mode_, DeviceValueType::ENUM, FL_(enum_ventMode), FL_(ventInSpeed), DeviceValueUOM::NONE, MAKE_CF_CB(set_ventMode)); - register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &voc_, DeviceValueType::USHORT, DeviceValueNumOp::DV_NUMOP_DIV10, FL_(airquality), DeviceValueUOM::NONE); + DeviceValueTAG::TAG_DEVICE_DATA, &mode_, DeviceValueType::ENUM, FL_(enum_ventMode), FL_(ventMode), DeviceValueUOM::NONE, MAKE_CF_CB(set_ventMode)); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &voc_, DeviceValueType::USHORT, FL_(airquality), DeviceValueUOM::NONE); + register_device_value(DeviceValueTAG::TAG_DEVICE_DATA, &bypass_, DeviceValueType::BOOL, FL_(bypass), DeviceValueUOM::NONE, MAKE_CF_CB(set_bypass)); } // message @@ -81,6 +83,11 @@ void Ventilation::process_ModeMessage(std::shared_ptr telegram) has_enumupdate(telegram, mode_, 0, -1); } +// message 0x0587, data: 01 00 +void Ventilation::process_BypassMessage(std::shared_ptr telegram) { + has_update(telegram, bypass_, 1); +} + bool Ventilation::set_ventMode(const char * value, const int8_t id) { uint8_t v; if (!Helpers::value2enum(value, v, FL_(enum_ventMode))) { @@ -99,4 +106,13 @@ bool Ventilation::set_filter(const char * value, const int8_t id) { return true; } +bool Ventilation::set_bypass(const char * value, const int8_t id) { + bool b; + if (!Helpers::value2bool(value, b)) { + return false; + } + write_command(0x55C, 1, b ? 1 : 0, 0x587); + return true; +} + } // namespace emsesp diff --git a/src/devices/ventilation.h b/src/devices/ventilation.h index a48285374..88b24d7ff 100644 --- a/src/devices/ventilation.h +++ b/src/devices/ventilation.h @@ -34,7 +34,7 @@ class Ventilation : public EMSdevice { int16_t inEx_; int16_t outEx_; uint16_t voc_; - // uint8_t bypass_; + uint8_t bypass_; // uint16_t filterRemain_; uint8_t ventInSpeed_; uint8_t ventOutSpeed_; @@ -45,8 +45,10 @@ class Ventilation : public EMSdevice { void process_ModeMessage(std::shared_ptr telegram); // 0x56B void process_BlowerMessage(std::shared_ptr telegram); // 0x56B void process_VOCMessage(std::shared_ptr telegram); // 0x56B + void process_BypassMessage(std::shared_ptr telegram); // 0x56B bool set_ventMode(const char * value, const int8_t id); + bool set_bypass(const char * value, const int8_t id); bool set_filter(const char * value, const int8_t id); diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index a781e7f9a..30b8580d8 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -1616,7 +1616,7 @@ bool EMSdevice::generate_values(JsonObject & output, const uint8_t tag_filter, c : (dv.uom == DeviceValueUOM::DEGREES) ? 2 : (dv.uom == DeviceValueUOM::DEGREES_R) ? 1 : 0; - char val[10]; + char val[10] = {'\0'}; if (dv.type == DeviceValueType::INT) { json[name] = serialized(Helpers::render_value(val, *(int8_t *)(dv.value_p), dv.numeric_operator, fahrenheit)); } else if (dv.type == DeviceValueType::UINT) { @@ -1645,7 +1645,7 @@ bool EMSdevice::generate_values(JsonObject & output, const uint8_t tag_filter, c Helpers::translated_word(FL_(minutes))); json[name] = time_s; } else { - json[name] = time_value; + json[name] = serialized(Helpers::render_value(val, time_value, 1)); } } @@ -1657,18 +1657,16 @@ bool EMSdevice::generate_values(JsonObject & output, const uint8_t tag_filter, c // check for value outside min/max range and adapt the limits to avoid HA complains // Should this also check for api output? if ((output_target == OUTPUT_TARGET::MQTT) && (dv.min != 0 || dv.max != 0)) { - if (json[name].is() || json[name].is()) { - int v = json[name]; - if (fahrenheit) { - v = (v - (32 * (fahrenheit - 1))) / 1.8; // reset to °C - } - if (v < dv.min) { - dv.min = v; - dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED); - } else if (v > dv.max) { - dv.max = v; - dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED); - } + int v = Helpers::atoint(val); + if (fahrenheit) { + v = (v - (32 * (fahrenheit - 1))) / 1.8; // reset to °C + } + if (v < dv.min) { + dv.min = v; + dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED); + } else if (v > dv.max) { + dv.max = v; + dv.remove_state(DeviceValueState::DV_HA_CONFIG_CREATED); } } } @@ -1689,30 +1687,33 @@ void EMSdevice::mqtt_ha_entity_config_create() { for (auto & dv : devicevalues_) { if (!strcmp(dv.short_name, FL_(haclimate)[0]) && !dv.has_state(DeviceValueState::DV_API_MQTT_EXCLUDE) && dv.has_state(DeviceValueState::DV_ACTIVE)) { if (*(int8_t *)(dv.value_p) == 1 && (!dv.has_state(DeviceValueState::DV_HA_CONFIG_CREATED) || dv.has_state(DeviceValueState::DV_HA_CLIMATE_NO_RT))) { - dv.remove_state(DeviceValueState::DV_HA_CLIMATE_NO_RT); - dv.add_state(DeviceValueState::DV_HA_CONFIG_CREATED); - Mqtt::publish_ha_climate_config(dv.tag, true, false, dv.min, dv.max); // roomTemp + if (Mqtt::publish_ha_climate_config(dv.tag, true, false, dv.min, dv.max)) { // roomTemp + dv.remove_state(DeviceValueState::DV_HA_CLIMATE_NO_RT); + dv.add_state(DeviceValueState::DV_HA_CONFIG_CREATED); + } } else if (*(int8_t *)(dv.value_p) == 0 && (!dv.has_state(DeviceValueState::DV_HA_CONFIG_CREATED) || !dv.has_state(DeviceValueState::DV_HA_CLIMATE_NO_RT))) { - dv.add_state(DeviceValueState::DV_HA_CLIMATE_NO_RT); - dv.add_state(DeviceValueState::DV_HA_CONFIG_CREATED); - Mqtt::publish_ha_climate_config(dv.tag, false, false, dv.min, dv.max); // no roomTemp + if (Mqtt::publish_ha_climate_config(dv.tag, false, false, dv.min, dv.max)) { // no roomTemp + dv.add_state(DeviceValueState::DV_HA_CLIMATE_NO_RT); + dv.add_state(DeviceValueState::DV_HA_CONFIG_CREATED); + } } } if (!dv.has_state(DeviceValueState::DV_HA_CONFIG_CREATED) && (dv.type != DeviceValueType::CMD) && dv.has_state(DeviceValueState::DV_ACTIVE) && !dv.has_state(DeviceValueState::DV_API_MQTT_EXCLUDE)) { // create_device_config is only done once for the EMS device. It can added to any entity, so we take the first - Mqtt::publish_ha_sensor_config(dv, name(), brand_to_char(), false, create_device_config); - dv.add_state(DeviceValueState::DV_HA_CONFIG_CREATED); - create_device_config = false; // only create the main config once - } - + if (Mqtt::publish_ha_sensor_config(dv, name(), brand_to_char(), false, create_device_config)) { + dv.add_state(DeviceValueState::DV_HA_CONFIG_CREATED); + create_device_config = false; // only create the main config once + } #ifndef EMSESP_STANDALONE - if (ESP.getFreeHeap() < (65 * 1024)) { - break; - } + // always create minimum one config + if (ESP.getMaxAllocHeap() < (6 * 1024) || (!emsesp::EMSESP::system_.PSram() && ESP.getFreeHeap() < (65 * 1024))) { + break; + } #endif + } } ha_config_done(!create_device_config); diff --git a/src/emsesp.cpp b/src/emsesp.cpp index f36b13740..5b7213f94 100644 --- a/src/emsesp.cpp +++ b/src/emsesp.cpp @@ -493,7 +493,7 @@ void EMSESP::publish_all_loop() { } // wait for free queue before sending next message, HA-messages are also queued - if (!Mqtt::is_empty()) { + if (Mqtt::publish_queued() > 0) { return; } @@ -597,6 +597,7 @@ void EMSESP::publish_other_values() { publish_device_values(EMSdevice::DeviceType::SWITCH); publish_device_values(EMSdevice::DeviceType::HEATPUMP); publish_device_values(EMSdevice::DeviceType::HEATSOURCE); + publish_device_values(EMSdevice::DeviceType::VENTILATION); // other devices without values yet // publish_device_values(EMSdevice::DeviceType::GATEWAY); // publish_device_values(EMSdevice::DeviceType::CONNECT); @@ -1297,6 +1298,9 @@ void EMSESP::incoming_telegram(uint8_t * data, const uint8_t length) { LOG_ERROR("Last Tx write rejected by host"); txservice_.send_poll(); // close the bus } + } else if (tx_state == Telegram::Operation::TX_READ && length == 1) { + EMSbus::tx_state(Telegram::Operation::TX_READ); // reset Tx wait state + return; } else if (tx_state == Telegram::Operation::TX_READ) { // got a telegram with data in it. See if the src/dest matches that from the last one we sent and continue to process it uint8_t src = data[0]; diff --git a/src/locale_common.h b/src/locale_common.h index afab14406..3e373dab1 100644 --- a/src/locale_common.h +++ b/src/locale_common.h @@ -292,6 +292,7 @@ MAKE_ENUM(enum_summermode, FL_(summer), FL_(auto), FL_(winter)) MAKE_ENUM(enum_hpoperatingmode, FL_(off), FL_(auto), FL_(heating), FL_(cooling)) MAKE_ENUM(enum_summer, FL_(winter), FL_(summer)) MAKE_ENUM(enum_operatingstate, FL_(heating), FL_(off), FL_(cooling)) +MAKE_ENUM(enum_hpmode, FL_(heating), FL_(cooling), FL_(heatandcool)) MAKE_ENUM(enum_mode, FL_(manual), FL_(auto)) // RC100, RC300, RC310 MAKE_ENUM(enum_mode2, FL_(off), FL_(manual), FL_(auto)) // RC20, RC30 diff --git a/src/locale_translations.h b/src/locale_translations.h index baa571cdd..ae6a5144b 100644 --- a/src/locale_translations.h +++ b/src/locale_translations.h @@ -28,244 +28,246 @@ #define EMSESP_LOCALE_NO "no" #define EMSESP_LOCALE_FR "fr" #define EMSESP_LOCALE_TR "tr" +#define EMSESP_LOCALE_IT "it" -// IMPORTANT! translations are in the order: en, de, nl, sv, pl, no, fr, tr +// IMPORTANT! translations are in the order: en, de, nl, sv, pl, no, fr, tr, it // // if there is no translation, it will default to en // // device types, as display in Web and Console -MAKE_WORD_TRANSLATION(boiler_device, "Boiler", "Kessel", "Boiler", "Värmepanna", "Kocioł", "Varmekjele", "", "Kazan") // TODO translate -MAKE_WORD_TRANSLATION(thermostat_device, "Thermostat", "Thermostat", "Thermostaat", "Termostat", "Termostat", "Termostat", "", "Termostat") // TODO translate -MAKE_WORD_TRANSLATION(heatpump_device, "Heat Pump", "Wärmepumpe", "Warmtepomp", "Värmepump", "Pompa ciepła", "Varmepumpe", "", "Isı Pompası") // TODO translate -MAKE_WORD_TRANSLATION(solar_device, "Solar Module", "Solarmodul", "Solar Module", "Solmodul", "Moduł solarny", "Solmodul", "", "Güneş Enerjisi Cihazı") // TODO translate -MAKE_WORD_TRANSLATION(connect_device, "Connect Module", "Verbindungsmodul", "Connect Module", "Uppkopplingsmodul", "Moduł przyłączeń", "Sammenkoblingsmodul", "", "Güneş Enerjisi Cihazı") // TODO translate -MAKE_WORD_TRANSLATION(mixer_device, "Mixer Module", "Mischermodul", "Mixer Module", "Blandningsmodul", "Moduł mieszacza", "Miksermodul", "", "Karışım Cihazı") // TODO translate -MAKE_WORD_TRANSLATION(controller_device, "Controller Module", "Kontrollmodul", "Controller Module", "Styrmodul", "Moduł sterujący", "Styremodul", "", "Kontrol Ünitesi") // TODO translate -MAKE_WORD_TRANSLATION(switch_device, "Switch Module", "Schaltmodul", "Switch Module", "Relämodul", "Moduł przełączający", "Switch modul", "", "Anahtar") // TODO translate -MAKE_WORD_TRANSLATION(gateway_device, "Gateway Module", "Gateway Modul", "Gateway Module", "Gateway", "Moduł IP", "Gateway", "", "Ağ Geçidi") // TODO translate -MAKE_WORD_TRANSLATION(alert_device, "Alert Module", "Alarmmodul", "Alert Module", "Larmmodul", "Moduł alarmowy", "Alarmmodul", "", "Alarm Cihazı") // TODO translate -MAKE_WORD_TRANSLATION(pump_device, "Pump Module", "Pumpenmodul", "Pump Module", "Pumpmodul", "Moduł pompy", "Pumpemodul", "", "Pompa") // TODO translate -MAKE_WORD_TRANSLATION(heatsource_device, "Heatsource", "Heizquelle", "Heatsource", "Värmekälla", "Źródło ciepła", "Varmekilde", "", "Isı Kaynağı") // TODO translate -MAKE_WORD_TRANSLATION(sensors_device, "Sensors", "Sensoren", "Sensoren", "Sensorer", "Czujniki", "Sensorer", "Capteurs", "Sensör Cihazı") -MAKE_WORD_TRANSLATION(unknown_device, "Unknown", "Unbekannt", "Onbekend", "Okänt", "Nieznane urządzenie", "Ukjent", "Inconnu", "") // TODO translate -MAKE_WORD_TRANSLATION(custom_device, "Custom", "Nutzerdefiniert", "", "", "Niestandardowe", "", "", "") // TODO translate -MAKE_WORD_TRANSLATION(custom_device_name, "User defined entities", "Nutzer deklarierte Entitäten", "", "", "Encje zdefiniowane przez użytkownika", "", "", "") // TODO translate -MAKE_WORD_TRANSLATION(ventilation_device, "Ventilation", "Lüftung", "", "", "", "", "", "") // TODO translate +MAKE_WORD_TRANSLATION(boiler_device, "Boiler", "Kessel", "Boiler", "Värmepanna", "Kocioł", "Varmekjele", "", "Kazan", "Caldaia") // TODO translate +MAKE_WORD_TRANSLATION(thermostat_device, "Thermostat", "Thermostat", "Thermostaat", "Termostat", "Termostat", "Termostat", "", "Termostat", "Termostato") // TODO translate +MAKE_WORD_TRANSLATION(heatpump_device, "Heat Pump", "Wärmepumpe", "Warmtepomp", "Värmepump", "Pompa ciepła", "Varmepumpe", "", "Isı Pompası", "Pompa di Calore") // TODO translate +MAKE_WORD_TRANSLATION(solar_device, "Solar Module", "Solarmodul", "Solar Module", "Solmodul", "Moduł solarny", "Solmodul", "", "Güneş Enerjisi Cihazı", "Modulo Solare") // TODO translate +MAKE_WORD_TRANSLATION(connect_device, "Connect Module", "Verbindungsmodul", "Connect Module", "Uppkopplingsmodul", "Moduł przyłączeń", "Sammenkoblingsmodul", "", "Güneş Enerjisi Cihazı", "Modulo connessione") // TODO translate +MAKE_WORD_TRANSLATION(mixer_device, "Mixer Module", "Mischermodul", "Mixer Module", "Blandningsmodul", "Moduł mieszacza", "Miksermodul", "", "Karışım Cihazı", "Modulo Miscela") // TODO translate +MAKE_WORD_TRANSLATION(controller_device, "Controller Module", "Kontrollmodul", "Controller Module", "Styrmodul", "Moduł sterujący", "Styremodul", "", "Kontrol Ünitesi", "Modulo Controllo") // TODO translate +MAKE_WORD_TRANSLATION(switch_device, "Switch Module", "Schaltmodul", "Switch Module", "Relämodul", "Moduł przełączający", "Switch modul", "", "Anahtar", "Modulo Switch") // TODO translate +MAKE_WORD_TRANSLATION(gateway_device, "Gateway Module", "Gateway Modul", "Gateway Module", "Gateway", "Moduł IP", "Gateway", "", "Ağ Geçidi", "Modulo Gateway") // TODO translate +MAKE_WORD_TRANSLATION(alert_device, "Alert Module", "Alarmmodul", "Alert Module", "Larmmodul", "Moduł alarmowy", "Alarmmodul", "", "Alarm Cihazı", "Module Avviso") // TODO translate +MAKE_WORD_TRANSLATION(pump_device, "Pump Module", "Pumpenmodul", "Pump Module", "Pumpmodul", "Moduł pompy", "Pumpemodul", "", "Pompa", "Module Pompa") // TODO translate +MAKE_WORD_TRANSLATION(heatsource_device, "Heatsource", "Heizquelle", "Heatsource", "Värmekälla", "Źródło ciepła", "Varmekilde", "", "Isı Kaynağı", "Fonte di calore") // TODO translate +MAKE_WORD_TRANSLATION(sensors_device, "Sensors", "Sensoren", "Sensoren", "Sensorer", "Czujniki", "Sensorer", "Capteurs", "Sensör Cihazı", "Sensori") +MAKE_WORD_TRANSLATION(unknown_device, "Unknown", "Unbekannt", "Onbekend", "Okänt", "Nieznane urządzenie", "Ukjent", "Inconnu", "", "Sconosciuto") // TODO translate +MAKE_WORD_TRANSLATION(custom_device, "Custom", "Nutzerdefiniert", "", "", "Niestandardowe", "", "", "", "") // TODO translate +MAKE_WORD_TRANSLATION(custom_device_name, "User defined entities", "Nutzer deklarierte Entitäten", "", "", "Encje zdefiniowane przez użytkownika", "", "", "", "Entità definita da utente") // TODO translate +MAKE_WORD_TRANSLATION(ventilation_device, "Ventilation", "Lüftung", "", "", "", "", "", "", "") // TODO translate // commands // TODO translate -MAKE_WORD_TRANSLATION(info_cmd, "lists all values", "Liste aller Werte", "", "", "wyświetl wszystkie wartości", "Viser alle verdier", "", "Tüm değerleri listele") // TODO translate -MAKE_WORD_TRANSLATION(commands_cmd, "lists all commands", "Liste aller Kommandos", "", "", "wyświetl wszystkie komendy", "Viser alle kommandoer", "", "Tüm komutları listele") // TODO translate -MAKE_WORD_TRANSLATION(entities_cmd, "lists all entities", "Liste aller Entitäten", "", "", "wyświetl wszsytkie encje", "Viser alle enheter", "", "Tüm varlıkları listele") // TODO translate -MAKE_WORD_TRANSLATION(send_cmd, "send a telegram", "Sende EMS-Telegramm", "", "", "wyślij telegram", "send et telegram", "", "Bir telegram gönder") // TODO translate -MAKE_WORD_TRANSLATION(setiovalue_cmd, "set io value", "Setze Wertevorgabe", "", "", "ustaw wartość", "sett en io verdi", "", "Giriş/Çıkış değerlerini ayarla") // TODO translate -MAKE_WORD_TRANSLATION(changeloglevel_cmd, "change log level", "Ändere Sysloglevel", "", "", "zmień poziom log-u", "endre loggnivå", "", "Kayıt seviyesini değiştir") // TODO translate -MAKE_WORD_TRANSLATION(fetch_cmd, "refresh all EMS values", "Lese alle EMS-Werte neu", "", "", "odśwież wszystkie wartości EMS", "oppfrisk alle EMS verdier", "", "Bütün EMS değerlerini yenile") // TODO translate -MAKE_WORD_TRANSLATION(restart_cmd, "restart EMS-ESP", "Neustart", "", "", "uruchom ponownie EMS-ESP", "restart EMS-ESP", "redémarrer EMS-ESP", "EMS-ESPyi yeniden başlat") // TODO translate -MAKE_WORD_TRANSLATION(watch_cmd, "watch incoming telegrams", "Watch auf eingehende Telegramme", "", "", "obserwuj przyczodzące telegramy", "se innkommende telegrammer", "", "Gelen telegramları ") // TODO translate -MAKE_WORD_TRANSLATION(publish_cmd, "publish all to MQTT", "Publiziere MQTT", "", "", "opublikuj wszystko na MQTT", "Publiser alt til MQTT", "", "Hepsini MQTTye gönder") // TODO translate -MAKE_WORD_TRANSLATION(system_info_cmd, "show system status", "Zeige System-Status", "", "", "pokaż status systemu", "vis system status", "", "Sistem Durumunu Göster") // TODO translate -MAKE_WORD_TRANSLATION(schedule_cmd, "enable schedule item", "Aktiviere Zeitplan", "", "", "aktywuj wybrany harmonogram", "", "", "") // TODO translate -MAKE_WORD_TRANSLATION(entity_cmd, "set custom value on ems", "Sende eigene Entitäten zu EMS", "", "", "wyślij własną wartość na EMS", "", "", "") // TODO translate +MAKE_WORD_TRANSLATION(info_cmd, "lists all values", "Liste aller Werte", "", "", "wyświetl wszystkie wartości", "Viser alle verdier", "", "Tüm değerleri listele", "elenca tutti i valori") // TODO translate +MAKE_WORD_TRANSLATION(commands_cmd, "lists all commands", "Liste aller Kommandos", "", "", "wyświetl wszystkie komendy", "Viser alle kommandoer", "", "Tüm komutları listele", "elencaa tutti i comandi") // TODO translate +MAKE_WORD_TRANSLATION(entities_cmd, "lists all entities", "Liste aller Entitäten", "", "", "wyświetl wszsytkie encje", "Viser alle enheter", "", "Tüm varlıkları listele", "elenca tutte le entità") // TODO translate +MAKE_WORD_TRANSLATION(send_cmd, "send a telegram", "Sende EMS-Telegramm", "", "", "wyślij telegram", "send et telegram", "", "Bir telegram gönder", "invia un telegramma") // TODO translate +MAKE_WORD_TRANSLATION(setiovalue_cmd, "set io value", "Setze Wertevorgabe", "", "", "ustaw wartość", "sett en io verdi", "", "Giriş/Çıkış değerlerini ayarla", "imposta valore io") // TODO translate +MAKE_WORD_TRANSLATION(changeloglevel_cmd, "change log level", "Ändere Sysloglevel", "", "", "zmień poziom log-u", "endre loggnivå", "", "Kayıt seviyesini değiştir", "cambia livello registrazione") // TODO translate +MAKE_WORD_TRANSLATION(fetch_cmd, "refresh all EMS values", "Lese alle EMS-Werte neu", "", "", "odśwież wszystkie wartości EMS", "oppfrisk alle EMS verdier", "", "Bütün EMS değerlerini yenile", "aggiornare tutti i valori EMS") // TODO translate +MAKE_WORD_TRANSLATION(restart_cmd, "restart EMS-ESP", "Neustart", "", "", "uruchom ponownie EMS-ESP", "restart EMS-ESP", "redémarrer EMS-ESP", "EMS-ESPyi yeniden başlat", "riavvia EMS-ESP") // TODO translate +MAKE_WORD_TRANSLATION(watch_cmd, "watch incoming telegrams", "Watch auf eingehende Telegramme", "", "", "obserwuj przyczodzące telegramy", "se innkommende telegrammer", "", "Gelen telegramları ", "guardare i telegrammi in arrivo") // TODO translate +MAKE_WORD_TRANSLATION(publish_cmd, "publish all to MQTT", "Publiziere MQTT", "", "", "opublikuj wszystko na MQTT", "Publiser alt til MQTT", "", "Hepsini MQTTye gönder", "pubblica tutto su MQTT") // TODO translate +MAKE_WORD_TRANSLATION(system_info_cmd, "show system status", "Zeige System-Status", "", "", "pokaż status systemu", "vis system status", "", "Sistem Durumunu Göster", "visualizza stati di sistema") // TODO translate +MAKE_WORD_TRANSLATION(schedule_cmd, "enable schedule item", "Aktiviere Zeitplan", "", "", "aktywuj wybrany harmonogram", "", "", "", "abilitare l'elemento programmato") // TODO translate +MAKE_WORD_TRANSLATION(entity_cmd, "set custom value on ems", "Sende eigene Entitäten zu EMS", "", "", "wyślij własną wartość na EMS", "", "", "", "imposta valori personalizzati su EMS") // TODO translate // tags -MAKE_WORD_TRANSLATION(tag_boiler_data_ww, "dhw", "WW", "dhw", "VV", "CWU", "dhw", "ecs", "SKS") -MAKE_WORD_TRANSLATION(tag_device_data_ww, "dhw", "WW", "dhw", "VV", "CWU", "dhw", "ecs", "SKS") -MAKE_WORD_TRANSLATION(tag_hc1, "hc1", "HK1", "hc1", "VK1", "OG1", "hc1", "hc1", "ID1") -MAKE_WORD_TRANSLATION(tag_hc2, "hc2", "HK2", "hc2", "VK2", "OG2", "hc2", "hc2", "ID2") -MAKE_WORD_TRANSLATION(tag_hc3, "hc3", "HK3", "hc3", "VK3", "OG3", "hc3", "hc3", "ID3") -MAKE_WORD_TRANSLATION(tag_hc4, "hc4", "HK4", "hc4", "VK4", "OG4", "hc4", "hc4", "ID4") -MAKE_WORD_TRANSLATION(tag_hc5, "hc5", "HK5", "hc5", "VK5", "OG5", "hc5", "hc5", "ID5") -MAKE_WORD_TRANSLATION(tag_hc6, "hc6", "HK6", "hc6", "vk6", "OG6", "hc6", "hc6", "ID6") -MAKE_WORD_TRANSLATION(tag_hc7, "hc7", "HK7", "hc7", "VK7", "OG7", "hc7", "hc7", "ID7") -MAKE_WORD_TRANSLATION(tag_hc8, "hc8", "HK8", "hc8", "VK8", "OG8", "hc8", "hc8", "ID8") -MAKE_WORD_TRANSLATION(tag_wwc1, "wwc1", "WWK1", "wwc1", "VVK1", "CWU1", "wwc1", "wwc1", "SKS1") -MAKE_WORD_TRANSLATION(tag_wwc2, "wwc2", "WWK2", "wwc2", "VVK2", "CWU2", "wwc2", "wwc2", "SKS2") -MAKE_WORD_TRANSLATION(tag_wwc3, "wwc3", "WWK3", "wwc3", "VVK3", "CWU3", "wwc3", "wwc3", "SKS3") -MAKE_WORD_TRANSLATION(tag_wwc4, "wwc4", "WWK4", "wwc4", "VVK4", "CWU4", "wwc4", "wwc4", "SKS4") -MAKE_WORD_TRANSLATION(tag_wwc5, "wwc5", "WWK5", "wwc5", "VVK5", "CWU5", "wwc5", "wwc5", "SKS5") -MAKE_WORD_TRANSLATION(tag_wwc6, "wwc6", "WWK6", "wwc6", "VVK6", "CWU6", "wwc6", "wwc6", "SKS6") -MAKE_WORD_TRANSLATION(tag_wwc7, "wwc7", "WWK7", "wwc7", "VVK7", "CWU7", "wwc7", "wwc7", "SKS7") -MAKE_WORD_TRANSLATION(tag_wwc8, "wwc8", "WWK8", "wwc8", "VVK8", "CWU8", "wwc8", "wwc8", "SKS8") -MAKE_WORD_TRANSLATION(tag_wwc9, "wwc9", "WWK9", "wwc9", "VVK9", "CWU9", "wwc9", "wwc9", "SKS9") -MAKE_WORD_TRANSLATION(tag_wwc10, "wwc10", "WWK10", "wwc10", "VVK10", "CWU10", "wwc10", "wwc10", "SKS10") -MAKE_WORD_TRANSLATION(tag_ahs1, "ahs1", "AHQ1", "ahs1", "AVK1", "AŹC1", "ahs1", "ahs1", "ahs1") -MAKE_WORD_TRANSLATION(tag_hs1, "hs1", "hs1", "hs1", "VK1", "ŹC1", "hs1", "hs1", "hs1") -MAKE_WORD_TRANSLATION(tag_hs2, "hs2", "hs2", "hs2", "VK2", "ŹC2", "hs2", "hs2", "hs2") -MAKE_WORD_TRANSLATION(tag_hs3, "hs3", "hs3", "hs3", "VK3", "ŹC3", "hs3", "hs3", "hs3") -MAKE_WORD_TRANSLATION(tag_hs4, "hs4", "hs4", "hs4", "VK4", "ŹC4", "hs4", "hs4", "hs4") -MAKE_WORD_TRANSLATION(tag_hs5, "hs5", "hs5", "hs5", "VK5", "ŹC5", "hs5", "hs5", "hs5") -MAKE_WORD_TRANSLATION(tag_hs6, "hs6", "hs6", "hs6", "VK6", "ŹC6", "hs6", "hs6", "hs6") -MAKE_WORD_TRANSLATION(tag_hs7, "hs7", "hs7", "hs7", "VK7", "ŹC7", "hs7", "hs7", "hs7") -MAKE_WORD_TRANSLATION(tag_hs8, "hs8", "hs8", "hs8", "VK8", "ŹC8", "hs8", "hs8", "hs8") -MAKE_WORD_TRANSLATION(tag_hs9, "hs9", "hs9", "hs9", "VK9", "ŹC9", "hs9", "hs9", "hs9") -MAKE_WORD_TRANSLATION(tag_hs10, "hs10", "hs10", "hs10", "VK10", "ŹC10", "hs10", "hs10", "hs10") -MAKE_WORD_TRANSLATION(tag_hs11, "hs11", "hs11", "hs11", "VK11", "ŹC11", "hs11", "hs11", "hs11") -MAKE_WORD_TRANSLATION(tag_hs12, "hs12", "hs12", "hs12", "VK12", "ŹC12", "hs12", "hs12", "hs12") -MAKE_WORD_TRANSLATION(tag_hs13, "hs13", "hs13", "hs13", "VK13", "ŹC13", "hs13", "hs13", "hs13") -MAKE_WORD_TRANSLATION(tag_hs14, "hs14", "hs14", "hs14", "VK14", "ŹC14", "hs14", "hs14", "hs14") -MAKE_WORD_TRANSLATION(tag_hs15, "hs15", "hs15", "hs15", "VK15", "ŹC15", "hs15", "hs15", "hs15") -MAKE_WORD_TRANSLATION(tag_hs16, "hs16", "hs16", "hs16", "VK16", "ŹC16", "hs16", "hs16", "hs16") +MAKE_WORD_TRANSLATION(tag_boiler_data_ww, "dhw", "WW", "dhw", "VV", "CWU", "dhw", "ecs", "SKS", "dhw") +MAKE_WORD_TRANSLATION(tag_device_data_ww, "dhw", "WW", "dhw", "VV", "CWU", "dhw", "ecs", "SKS", "dhw") +MAKE_WORD_TRANSLATION(tag_hc1, "hc1", "HK1", "hc1", "VK1", "OG1", "hc1", "hc1", "ID1", "hc1") +MAKE_WORD_TRANSLATION(tag_hc2, "hc2", "HK2", "hc2", "VK2", "OG2", "hc2", "hc2", "ID2", "hc2") +MAKE_WORD_TRANSLATION(tag_hc3, "hc3", "HK3", "hc3", "VK3", "OG3", "hc3", "hc3", "ID3", "hc3") +MAKE_WORD_TRANSLATION(tag_hc4, "hc4", "HK4", "hc4", "VK4", "OG4", "hc4", "hc4", "ID4", "hc4") +MAKE_WORD_TRANSLATION(tag_hc5, "hc5", "HK5", "hc5", "VK5", "OG5", "hc5", "hc5", "ID5", "hc5") +MAKE_WORD_TRANSLATION(tag_hc6, "hc6", "HK6", "hc6", "vk6", "OG6", "hc6", "hc6", "ID6", "hc6") +MAKE_WORD_TRANSLATION(tag_hc7, "hc7", "HK7", "hc7", "VK7", "OG7", "hc7", "hc7", "ID7", "hc7") +MAKE_WORD_TRANSLATION(tag_hc8, "hc8", "HK8", "hc8", "VK8", "OG8", "hc8", "hc8", "ID8", "hc8") +MAKE_WORD_TRANSLATION(tag_wwc1, "wwc1", "WWK1", "wwc1", "VVK1", "CWU1", "wwc1", "wwc1", "SKS1", "wwc1") +MAKE_WORD_TRANSLATION(tag_wwc2, "wwc2", "WWK2", "wwc2", "VVK2", "CWU2", "wwc2", "wwc2", "SKS2", "wwc2") +MAKE_WORD_TRANSLATION(tag_wwc3, "wwc3", "WWK3", "wwc3", "VVK3", "CWU3", "wwc3", "wwc3", "SKS3", "wwc3") +MAKE_WORD_TRANSLATION(tag_wwc4, "wwc4", "WWK4", "wwc4", "VVK4", "CWU4", "wwc4", "wwc4", "SKS4", "wwc4") +MAKE_WORD_TRANSLATION(tag_wwc5, "wwc5", "WWK5", "wwc5", "VVK5", "CWU5", "wwc5", "wwc5", "SKS5", "wwc5") +MAKE_WORD_TRANSLATION(tag_wwc6, "wwc6", "WWK6", "wwc6", "VVK6", "CWU6", "wwc6", "wwc6", "SKS6", "wwc6") +MAKE_WORD_TRANSLATION(tag_wwc7, "wwc7", "WWK7", "wwc7", "VVK7", "CWU7", "wwc7", "wwc7", "SKS7", "wwc7") +MAKE_WORD_TRANSLATION(tag_wwc8, "wwc8", "WWK8", "wwc8", "VVK8", "CWU8", "wwc8", "wwc8", "SKS8", "wwc8") +MAKE_WORD_TRANSLATION(tag_wwc9, "wwc9", "WWK9", "wwc9", "VVK9", "CWU9", "wwc9", "wwc9", "SKS9", "wwc9") +MAKE_WORD_TRANSLATION(tag_wwc10, "wwc10", "WWK10", "wwc10", "VVK10", "CWU10", "wwc10", "wwc10", "SKS10", "wwc10") +MAKE_WORD_TRANSLATION(tag_ahs1, "ahs1", "AHQ1", "ahs1", "AVK1", "AŹC1", "ahs1", "ahs1", "ahs1", "ahs1") +MAKE_WORD_TRANSLATION(tag_hs1, "hs1", "hs1", "hs1", "VK1", "ŹC1", "hs1", "hs1", "hs1", "hs1") +MAKE_WORD_TRANSLATION(tag_hs2, "hs2", "hs2", "hs2", "VK2", "ŹC2", "hs2", "hs2", "hs2", "hs2") +MAKE_WORD_TRANSLATION(tag_hs3, "hs3", "hs3", "hs3", "VK3", "ŹC3", "hs3", "hs3", "hs3", "hs3") +MAKE_WORD_TRANSLATION(tag_hs4, "hs4", "hs4", "hs4", "VK4", "ŹC4", "hs4", "hs4", "hs4", "hs4") +MAKE_WORD_TRANSLATION(tag_hs5, "hs5", "hs5", "hs5", "VK5", "ŹC5", "hs5", "hs5", "hs5", "hs5") +MAKE_WORD_TRANSLATION(tag_hs6, "hs6", "hs6", "hs6", "VK6", "ŹC6", "hs6", "hs6", "hs6", "hs6") +MAKE_WORD_TRANSLATION(tag_hs7, "hs7", "hs7", "hs7", "VK7", "ŹC7", "hs7", "hs7", "hs7", "hs7") +MAKE_WORD_TRANSLATION(tag_hs8, "hs8", "hs8", "hs8", "VK8", "ŹC8", "hs8", "hs8", "hs8", "hs8") +MAKE_WORD_TRANSLATION(tag_hs9, "hs9", "hs9", "hs9", "VK9", "ŹC9", "hs9", "hs9", "hs9", "hs9") +MAKE_WORD_TRANSLATION(tag_hs10, "hs10", "hs10", "hs10", "VK10", "ŹC10", "hs10", "hs10", "hs10", "hs10") +MAKE_WORD_TRANSLATION(tag_hs11, "hs11", "hs11", "hs11", "VK11", "ŹC11", "hs11", "hs11", "hs11", "hs11") +MAKE_WORD_TRANSLATION(tag_hs12, "hs12", "hs12", "hs12", "VK12", "ŹC12", "hs12", "hs12", "hs12", "hs12") +MAKE_WORD_TRANSLATION(tag_hs13, "hs13", "hs13", "hs13", "VK13", "ŹC13", "hs13", "hs13", "hs13", "hs13") +MAKE_WORD_TRANSLATION(tag_hs14, "hs14", "hs14", "hs14", "VK14", "ŹC14", "hs14", "hs14", "hs14", "hs14") +MAKE_WORD_TRANSLATION(tag_hs15, "hs15", "hs15", "hs15", "VK15", "ŹC15", "hs15", "hs15", "hs15", "hs15") +MAKE_WORD_TRANSLATION(tag_hs16, "hs16", "hs16", "hs16", "VK16", "ŹC16", "hs16", "hs16", "hs16", "hs16") // General -MAKE_WORD_TRANSLATION(on, "on", "an", "aan", "på", "włączono", "på", "on", "açık") -MAKE_WORD_TRANSLATION(off, "off", "aus", "uit", "av", "wyłączono", "av", "off", "kapalı") -MAKE_WORD_TRANSLATION(ON, "ON", "AN", "AAN", "PÅ", "wł.", "PÅ", "ON", "AÇIK") -MAKE_WORD_TRANSLATION(OFF, "OFF", "AUS", "UIT", "AV", "wył.", "AV", "OFF", "KAPALI") +MAKE_WORD_TRANSLATION(on, "on", "an", "aan", "på", "włączono", "på", "on", "açık", "on") +MAKE_WORD_TRANSLATION(off, "off", "aus", "uit", "av", "wyłączono", "av", "off", "kapalı", "off") +MAKE_WORD_TRANSLATION(ON, "ON", "AN", "AAN", "PÅ", "wł.", "PÅ", "ON", "AÇIK", "ON") +MAKE_WORD_TRANSLATION(OFF, "OFF", "AUS", "UIT", "AV", "wył.", "AV", "OFF", "KAPALI", "OFF") // Unit Of Measurement mapping - maps to DeviceValueUOM_s in emsdevice.cpp // uom - also used with HA see https://github.com/home-assistant/core/blob/d7ac4bd65379e11461c7ce0893d3533d8d8b8cbf/homeassistant/const.py#L384 -MAKE_WORD_TRANSLATION(minutes, "minutes", "Minuten", "Minuten", "Minuter", "minut", "Minutter", "minutes", "dakika") -MAKE_WORD_TRANSLATION(hours, "hours", "Stunden", "Uren", "Timmar", "godzin", "Timer", "heures", "saat") -MAKE_WORD_TRANSLATION(days, "days", "Tage", "Dagen", "Dagar", "dni", "Dager", "jours", "gün") -MAKE_WORD_TRANSLATION(seconds, "seconds", "Sekunden", "Seconden", "Sekunder", "sekund", "Sekunder", "secondes", "saniye") +MAKE_WORD_TRANSLATION(minutes, "minutes", "Minuten", "Minuten", "Minuter", "minut", "Minutter", "minutes", "dakika", "Minuti") +MAKE_WORD_TRANSLATION(hours, "hours", "Stunden", "Uren", "Timmar", "godzin", "Timer", "heures", "saat", "ore") +MAKE_WORD_TRANSLATION(days, "days", "Tage", "Dagen", "Dagar", "dni", "Dager", "jours", "gün", "giorni") +MAKE_WORD_TRANSLATION(seconds, "seconds", "Sekunden", "Seconden", "Sekunder", "sekund", "Sekunder", "secondes", "saniye", "Secondi") + // Enum translations // general -MAKE_WORD_TRANSLATION(day_mo, "mo", "Mo", "Mo", "Må", "poniedziałek", "ma", "lun", "pzt") -MAKE_WORD_TRANSLATION(day_tu, "tu", "Di", "Di", "Ti", "wtorek", "ti", "mar", "sal") -MAKE_WORD_TRANSLATION(day_we, "we", "Mi", "Wo", "On", "środa", "on", "mer", "çar") -MAKE_WORD_TRANSLATION(day_th, "th", "Do", "Do", "To", "czwartek", "to", "jeu", "per") -MAKE_WORD_TRANSLATION(day_fr, "fr", "Fr", "Vr", "Fr", "piątek", "fr", "ven", "cum") -MAKE_WORD_TRANSLATION(day_sa, "sa", "Sa", "Za", "Lö", "sobota", "lø", "sam", "cts") -MAKE_WORD_TRANSLATION(day_su, "su", "So", "Zo", "Sö", "niedziela", "sø", "dim", "paz") -MAKE_WORD_TRANSLATION(all, "all", "Alle", "Alle", "Alla", "codziennie", "alle", "tous", "tüm") -MAKE_WORD_TRANSLATION(own_1, "own 1", "Eigen 1", "Eigen 1", "Egen 1", "własny 1", "egen 1", "propre 1", "kendi 1") -MAKE_WORD_TRANSLATION(family, "family", "Familie", "Familie", "Familj", "rodzina", "familie", "famille", "aile") -MAKE_WORD_TRANSLATION(morning, "morning", "Morgends", "'s ochtends", "Morgon", "zmiana 1", "morgen", "matin", "sabah") -MAKE_WORD_TRANSLATION(evening, "evening", "Abends", "'s avonds", "Kväll", "zmiana 2", "kveld", "soir", "akşam") -MAKE_WORD_TRANSLATION(seniors, "seniors", "Senioren", "Senioren", "Seniorer", "senior", "seniorer", "séniors", "yaşlılar") -MAKE_WORD_TRANSLATION(no, "no", "nein", "nee", "nej", "nie", "nei", "non", "hayır") -MAKE_WORD_TRANSLATION(new, "new", "Neu", "Nieuw", "Ny", "nowy", "ny", "nouveau", "yeni") -MAKE_WORD_TRANSLATION(own_2, "own 2", "Eigen 2", "Eigen 2", "Egen 2", "własny 2", "egen 2", "propre 2", "kendi 2") -MAKE_WORD_TRANSLATION(singles, "singles", "Singles", "Singles", "Singlar", "osoba samotna", "single", "seuls", "") -MAKE_WORD_TRANSLATION(am, "am", "Vormittag", "Ochtend", "Förmiddag", "do południa", "formiddag", "matin", "sabah") -MAKE_WORD_TRANSLATION(pm, "pm", "Nachmittag", "Namiddag", "Eftermiddag", "po południu", "ettermiddag", "après-midi", "akşam") -MAKE_WORD_TRANSLATION(midday, "midday", "Mittag", "Middag", "Middag", "południe", "middag", "midi", "öğlen") -MAKE_WORD_TRANSLATION(unknown, "unknown", "Unbekannt", "Onbekend", "Okänt", "nieznany", "ukjent", "inconnu", "bilinmeyen") -MAKE_WORD_TRANSLATION(flat, "flat", "flach", "vlak", "Platt", "płaski", "flat", "plat", "düz") -MAKE_WORD_TRANSLATION(vacuum, "vacuum", "Vakuum", "vacuum", "Vakuum", "próżnia", "vakum", "vide", "vakum") -MAKE_WORD_TRANSLATION(co2_optimized, "co2 optimized", "CO2 optimiert", "CO2 geoptimaliseerd", "CO2-optimerad", "optymalizacja CO2", "co2 optimalisert", "optimisé en CO2", "CO2 verimli") -MAKE_WORD_TRANSLATION(cost_optimized, "cost optimized", "kostenoptimiert", "kosten geoptimaliseerd", "kostnadsoptimerad", "optymalizacja kosztów", "kostnadsoptimalisert", "optimisé en coût", "maliyet odaklı") -MAKE_WORD_TRANSLATION(outside_temp_switched, "outside temp switched", "Außentemp. gesteuert", "Buitentemp. gestuurd", "Utomhustemp korrigerad", "temperatura zewn. przeł.", "utetemp optimalisert", "contrôle par temp. ext.", "dış hava sıcaklığına bağlı") -MAKE_WORD_TRANSLATION(co2_cost_mix, "co2 cost mix", "Kostenmix", "Kostenmix", "Kostnadsmix", "mieszany koszt CO2", "", "coût mixte CO2", "karışık maliyet") // TODO translate -MAKE_WORD_TRANSLATION(analog, "analog", "analog", "analoog", "analog", "analogowy", "analog", "analogique", "analog") -MAKE_WORD_TRANSLATION(normal, "normal", "normal", "normaal", "normal", "normalny", "normal", "normal", "normal") -MAKE_WORD_TRANSLATION(blocking, "blocking", "Blockierung", "Blokkering", "Blockering", "blokowanie", "blokkering", "bloquant", "engelleme") -MAKE_WORD_TRANSLATION(extern, "extern", "extern", "extern", "extern", "zewnętrzny", "ekstern", "externe", "dış") -MAKE_WORD_TRANSLATION(intern, "intern", "intern", "intern", "intern", "wewnętrzny", "intern", "interne", "iç") -MAKE_WORD_TRANSLATION(lower, "lower", "niedirger", "lager", "lägre", "mniejszy", "nedre", "inférieur", "daha düşük") -MAKE_WORD_TRANSLATION(error, "error", "Fehler", "error", "Fel", "błąd", "feil", "erreur", "Hata") // TODO translate -MAKE_WORD_TRANSLATION(na, "n/a", "n/a", "n/a", "n/a", "nd.", "n/a", "n/c", "mevcut değil") // TODO translate +MAKE_WORD_TRANSLATION(day_mo, "mo", "Mo", "Mo", "Må", "poniedziałek", "ma", "lun", "pzt", "lu") +MAKE_WORD_TRANSLATION(day_tu, "tu", "Di", "Di", "Ti", "wtorek", "ti", "mar", "sal", "ma") +MAKE_WORD_TRANSLATION(day_we, "we", "Mi", "Wo", "On", "środa", "on", "mer", "çar", "me") +MAKE_WORD_TRANSLATION(day_th, "th", "Do", "Do", "To", "czwartek", "to", "jeu", "per", "gio") +MAKE_WORD_TRANSLATION(day_fr, "fr", "Fr", "Vr", "Fr", "piątek", "fr", "ven", "cum", "ve") +MAKE_WORD_TRANSLATION(day_sa, "sa", "Sa", "Za", "Lö", "sobota", "lø", "sam", "cts", "sa") +MAKE_WORD_TRANSLATION(day_su, "su", "So", "Zo", "Sö", "niedziela", "sø", "dim", "paz", "do") +MAKE_WORD_TRANSLATION(all, "all", "Alle", "Alle", "Alla", "codziennie", "alle", "tous", "tüm", "tutti") +MAKE_WORD_TRANSLATION(own_1, "own 1", "Eigen 1", "Eigen 1", "Egen 1", "własny 1", "egen 1", "propre 1", "kendi 1", "proprio 1") +MAKE_WORD_TRANSLATION(family, "family", "Familie", "Familie", "Familj", "rodzina", "familie", "famille", "aile", "famiglia") +MAKE_WORD_TRANSLATION(morning, "morning", "Morgends", "'s ochtends", "Morgon", "zmiana 1", "morgen", "matin", "sabah", "mattina") +MAKE_WORD_TRANSLATION(evening, "evening", "Abends", "'s avonds", "Kväll", "zmiana 2", "kveld", "soir", "akşam", "sera") +MAKE_WORD_TRANSLATION(seniors, "seniors", "Senioren", "Senioren", "Seniorer", "senior", "seniorer", "séniors", "yaşlılar", "vecchi") +MAKE_WORD_TRANSLATION(no, "no", "nein", "nee", "nej", "nie", "nei", "non", "hayır", "no") +MAKE_WORD_TRANSLATION(new, "new", "Neu", "Nieuw", "Ny", "nowy", "ny", "nouveau", "yeni", "nuovo") +MAKE_WORD_TRANSLATION(own_2, "own 2", "Eigen 2", "Eigen 2", "Egen 2", "własny 2", "egen 2", "propre 2", "kendi 2", "proprio 2") +MAKE_WORD_TRANSLATION(singles, "singles", "Singles", "Singles", "Singlar", "osoba samotna", "single", "seuls", "", "singoli") +MAKE_WORD_TRANSLATION(am, "am", "Vormittag", "Ochtend", "Förmiddag", "do południa", "formiddag", "matin", "sabah", "mattina") +MAKE_WORD_TRANSLATION(pm, "pm", "Nachmittag", "Namiddag", "Eftermiddag", "po południu", "ettermiddag", "après-midi", "akşam", "pomeriggio") +MAKE_WORD_TRANSLATION(midday, "midday", "Mittag", "Middag", "Middag", "południe", "middag", "midi", "öğlen", "mezzogiorno") +MAKE_WORD_TRANSLATION(unknown, "unknown", "Unbekannt", "Onbekend", "Okänt", "nieznany", "ukjent", "inconnu", "bilinmeyen", "sconosciuto") +MAKE_WORD_TRANSLATION(flat, "flat", "flach", "vlak", "Platt", "płaski", "flat", "plat", "düz", "piatto") +MAKE_WORD_TRANSLATION(vacuum, "vacuum", "Vakuum", "vacuum", "Vakuum", "próżnia", "vakum", "vide", "vakum", "vacuum") +MAKE_WORD_TRANSLATION(co2_optimized, "co2 optimized", "CO2 optimiert", "CO2 geoptimaliseerd", "CO2-optimerad", "optymalizacja CO2", "co2 optimalisert", "optimisé en CO2", "CO2 verimli", "CO2 ottimizzato") +MAKE_WORD_TRANSLATION(cost_optimized, "cost optimized", "kostenoptimiert", "kosten geoptimaliseerd", "kostnadsoptimerad", "optymalizacja kosztów", "kostnadsoptimalisert", "optimisé en coût", "maliyet odaklı", "costo ottimizzato") +MAKE_WORD_TRANSLATION(outside_temp_switched, "outside temp switched", "Außentemp. gesteuert", "Buitentemp. gestuurd", "Utomhustemp korrigerad", "temperatura zewn. przeł.", "utetemp optimalisert", "contrôle par temp. ext.", "dış hava sıcaklığına bağlı", "temperatura esterna cambiata") +MAKE_WORD_TRANSLATION(co2_cost_mix, "co2 cost mix", "Kostenmix", "Kostenmix", "Kostnadsmix", "mieszany koszt CO2", "", "coût mixte CO2", "karışık maliyet", "co2 cost mix") // TODO translate +MAKE_WORD_TRANSLATION(analog, "analog", "analog", "analoog", "analog", "analogowy", "analog", "analogique", "analog", "analogico") +MAKE_WORD_TRANSLATION(normal, "normal", "normal", "normaal", "normal", "normalny", "normal", "normal", "normal", "normale") +MAKE_WORD_TRANSLATION(blocking, "blocking", "Blockierung", "Blokkering", "Blockering", "blokowanie", "blokkering", "bloquant", "engelleme", "bloccaggio") +MAKE_WORD_TRANSLATION(extern, "extern", "extern", "extern", "extern", "zewnętrzny", "ekstern", "externe", "dış", "eesterno") +MAKE_WORD_TRANSLATION(intern, "intern", "intern", "intern", "intern", "wewnętrzny", "intern", "interne", "iç", "interno") +MAKE_WORD_TRANSLATION(lower, "lower", "niedirger", "lager", "lägre", "mniejszy", "nedre", "inférieur", "daha düşük", "basso") +MAKE_WORD_TRANSLATION(error, "error", "Fehler", "error", "Fel", "błąd", "feil", "erreur", "Hata", "errore") // TODO translate +MAKE_WORD_TRANSLATION(na, "n/a", "n/a", "n/a", "n/a", "nd.", "n/a", "n/c", "mevcut değil", "n/a") // TODO translate // boiler -MAKE_WORD_TRANSLATION(time, "time", "Zeit", "Tijd", "Tid", "godzina", "tid", "heure", "zaman") -MAKE_WORD_TRANSLATION(date, "date", "Datum", "Datum", "Datum", "data", "dato", "date", "tarih") -MAKE_WORD_TRANSLATION(continuous, "continuous", "kontinuierlich", "continue", "kontinuerlig", "ciągły", "kontinuerlig", "continu", "devam eden") -MAKE_WORD_TRANSLATION(3wayvalve, "3-way valve", "3-Wege Ventil", "3-weg klep", "trevägsventil", "zawór 3-drogowy", "treveisventil", "vanne 3 voies" ,"3 yollu vana") -MAKE_WORD_TRANSLATION(chargepump, "chargepump", "Ladepumpe", "laadpomp", "laddpump", "pompa ładująca", "ladepumpe", "pompe de charge", "besleme pompası") -MAKE_WORD_TRANSLATION(hot, "hot", "Heiß", "Heet", "Het", "gorący", "het", "chaud", "sıcak") -MAKE_WORD_TRANSLATION(high_comfort, "high comfort", "gehobener Komfort", "Verhoogd comfort", "Förhöjd komfort", "wysoki komfort", "høy komfort", "comfort", "komfor") -MAKE_WORD_TRANSLATION(eco, "eco", "Eco", "Eco", "Eko", "eko", "øko", "éco", "eko") -MAKE_WORD_TRANSLATION(intelligent, "intelligent", "Intelligent", "Intelligent", "Intelligent", "inteligentny", "intelligent", "intelligent", "akıllı") -MAKE_WORD_TRANSLATION(flow, "flow", "Durchfluss", "Volumestroom", "Flöde", "przepływ", "strømme", "débit", "akım") -MAKE_WORD_TRANSLATION(manual, "manual", "Manuell", "Hamdmatig", "Manuell", "ręczny", "manuell", "manuel", "manuel") -MAKE_WORD_TRANSLATION(buffer, "buffer", "Speicher", "Buffer", "Buffert", "bufor", "buffer", "buffer", "tampon") -MAKE_WORD_TRANSLATION(bufferedflow, "buffered flow", "Durchlaufspeicher", "Doorstroombuffer", "Buffertflöde", "przepływ buforowany", "bufret strømning", "", "tampon akım") // TODO translate -MAKE_WORD_TRANSLATION(layeredbuffer, "layered buffer", "Schichtspeicher", "Gelaagde buffer", "Lagrad buffert", "bufor warstwowy", "lagdelt buffer", "", "katmanlı akım") // TODO translate -MAKE_WORD_TRANSLATION(maintenance, "maintenance", "Wartung", "Onderhoud", "Underhåll", "przegląd", "vedlikehold", "maintenance", "bakım") -MAKE_WORD_TRANSLATION(heating, "heating", "Heizen", "Verwarmen", "Uppvärmning", "ogrzewanie", "oppvarming", "chauffage", "ısıtma") -MAKE_WORD_TRANSLATION(cooling, "cooling", "Kühlen", "Koelen", "Kyler", "chłodzenie", "kjøling", "refroidissement", "soğuma") -MAKE_WORD_TRANSLATION(disinfecting, "disinfecting", "Desinfizieren", "Desinfecteren", "Desinficerar", "dezynfekcja termiczna", "desinfisering", "désinfection", "dezenfeksiyon") -MAKE_WORD_TRANSLATION(no_heat, "no heat", "keine Wärme", "Geen warmte", "Ingen värme", "brak ciepła", "ingen varme", "pas de chauffage", "ısınma yok") -MAKE_WORD_TRANSLATION(heatrequest, "heat request", "Wärmeanforderung", "Verwarmignsverzoek", "Värmeförfrågan", "zapotrzebowanie na ciepło", "varmeforespørsel", "demande de chauffage", "ısınma ihtiyacı") -MAKE_WORD_TRANSLATION(valve, "valve", "Ventil", "Klep", "Ventil", "zawór", "ventil", "valve", "vana") -MAKE_WORD_TRANSLATION(proportional, "proportional", "", "", "", "proporcjonalny", "proposjonal", "", "") // TODO translate -MAKE_WORD_TRANSLATION(deltaP1, "deltaP-1", "", "", "", "", "deltaP-1", "", "") // TODO translate -MAKE_WORD_TRANSLATION(deltaP2, "deltaP-2", "", "", "", "", "deltaP-2", "", "") // TODO translate -MAKE_WORD_TRANSLATION(deltaP3, "deltaP-3", "", "", "", "", "deltaP-3", "", "") // TODO translate -MAKE_WORD_TRANSLATION(deltaP4, "deltaP-4", "", "", "", "", "deltaP-4", "", "") // TODO translate +MAKE_WORD_TRANSLATION(time, "time", "Zeit", "Tijd", "Tid", "godzina", "tid", "heure", "zaman", "ora") +MAKE_WORD_TRANSLATION(date, "date", "Datum", "Datum", "Datum", "data", "dato", "date", "tarih", "data") +MAKE_WORD_TRANSLATION(continuous, "continuous", "kontinuierlich", "continue", "kontinuerlig", "ciągły", "kontinuerlig", "continu", "devam eden", "continuo") +MAKE_WORD_TRANSLATION(3wayvalve, "3-way valve", "3-Wege Ventil", "3-weg klep", "trevägsventil", "zawór 3-drogowy", "treveisventil", "vanne 3 voies" ,"3 yollu vana", "valvola 3 vie") +MAKE_WORD_TRANSLATION(chargepump, "chargepump", "Ladepumpe", "laadpomp", "laddpump", "pompa ładująca", "ladepumpe", "pompe de charge", "besleme pompası", "pompa di carica") +MAKE_WORD_TRANSLATION(hot, "hot", "Heiß", "Heet", "Het", "gorący", "het", "chaud", "sıcak", "caldo") +MAKE_WORD_TRANSLATION(high_comfort, "high comfort", "gehobener Komfort", "Verhoogd comfort", "Förhöjd komfort", "wysoki komfort", "høy komfort", "comfort", "komfor", "comfort alto") +MAKE_WORD_TRANSLATION(eco, "eco", "Eco", "Eco", "Eko", "eko", "øko", "éco", "eko", "Eco") +MAKE_WORD_TRANSLATION(intelligent, "intelligent", "Intelligent", "Intelligent", "Intelligent", "inteligentny", "intelligent", "intelligent", "akıllı", "intelligente") +MAKE_WORD_TRANSLATION(flow, "flow", "Durchfluss", "Volumestroom", "Flöde", "przepływ", "strømme", "débit", "akım", "flusso") +MAKE_WORD_TRANSLATION(manual, "manual", "Manuell", "Hamdmatig", "Manuell", "ręczny", "manuell", "manuel", "manuel", "manuale") +MAKE_WORD_TRANSLATION(buffer, "buffer", "Speicher", "Buffer", "Buffert", "bufor", "buffer", "buffer", "tampon", "Buffer") +MAKE_WORD_TRANSLATION(bufferedflow, "buffered flow", "Durchlaufspeicher", "Doorstroombuffer", "Buffertflöde", "przepływ buforowany", "bufret strømning", "", "tampon akım", "memoria flusso") // TODO translate +MAKE_WORD_TRANSLATION(layeredbuffer, "layered buffer", "Schichtspeicher", "Gelaagde buffer", "Lagrad buffert", "bufor warstwowy", "lagdelt buffer", "", "katmanlı akım", "strato memoria") // TODO translate +MAKE_WORD_TRANSLATION(maintenance, "maintenance", "Wartung", "Onderhoud", "Underhåll", "przegląd", "vedlikehold", "maintenance", "bakım", "servizio") +MAKE_WORD_TRANSLATION(heating, "heating", "Heizen", "Verwarmen", "Uppvärmning", "ogrzewanie", "oppvarming", "chauffage", "ısıtma", "riscaldamento") +MAKE_WORD_TRANSLATION(cooling, "cooling", "Kühlen", "Koelen", "Kyler", "chłodzenie", "kjøling", "refroidissement", "soğuma", "raffreddamento") +MAKE_WORD_TRANSLATION(heatandcool, "heating&cooling", "Heizen&Kühlen", "Verwarmen&Koelen", "Uppvärmning&Kyler","","","","","") // TODO translate +MAKE_WORD_TRANSLATION(disinfecting, "disinfecting", "Desinfizieren", "Desinfecteren", "Desinficerar", "dezynfekcja termiczna", "desinfisering", "désinfection", "dezenfeksiyon", "disinfezione") +MAKE_WORD_TRANSLATION(no_heat, "no heat", "keine Wärme", "Geen warmte", "Ingen värme", "brak ciepła", "ingen varme", "pas de chauffage", "ısınma yok", "nessun calore") +MAKE_WORD_TRANSLATION(heatrequest, "heat request", "Wärmeanforderung", "Verwarmignsverzoek", "Värmeförfrågan", "zapotrzebowanie na ciepło", "varmeforespørsel", "demande de chauffage", "ısınma ihtiyacı", "richiesta calore") +MAKE_WORD_TRANSLATION(valve, "valve", "Ventil", "Klep", "Ventil", "zawór", "ventil", "valve", "vana", "valvola") +MAKE_WORD_TRANSLATION(proportional, "proportional", "", "", "", "proporcjonalny", "proposjonal", "", "", "proporzionale") // TODO translate +MAKE_WORD_TRANSLATION(deltaP1, "deltaP-1", "", "", "", "", "deltaP-1", "", "", "deltaP-1") // TODO translate +MAKE_WORD_TRANSLATION(deltaP2, "deltaP-2", "", "", "", "", "deltaP-2", "", "", "deltaP-2") // TODO translate +MAKE_WORD_TRANSLATION(deltaP3, "deltaP-3", "", "", "", "", "deltaP-3", "", "", "deltaP-3") // TODO translate +MAKE_WORD_TRANSLATION(deltaP4, "deltaP-4", "", "", "", "", "deltaP-4", "", "", "deltaP-4") // TODO translate // heatpump -MAKE_WORD_TRANSLATION(none, "none", "keine", "geen", "ingen", "brak", "ingen", "aucun", "hiçbiri") -MAKE_WORD_TRANSLATION(hot_water, "hot water", "Warmwasser", "warm water", "varmvatten", "c.w.u.", "varmtvann", "eau chaude", "sıcak su") -MAKE_WORD_TRANSLATION(pool, "pool", "Pool", "zwembad", "pool", "basen", "basseng", "piscine", "havuz") -MAKE_WORD_TRANSLATION(outside_temp_alt, "outside temperature alt.", "Außentemp. alternativ", "", "Alternativ utomhustemp.", "temp. zewn. alternat.", "alternativ utendørstemp.", "température extérieure alternative", "alternatif dış sıcaklık") // TODO translate -MAKE_WORD_TRANSLATION(outside_temp_par, "outside temperature parallel", "Außentemp. parallel", "", "Parallell utomhustemp.", "temp. zewn. równoległa", "parallell utendørstemp.", "température extérieure parallèle", "paralel dış sıcaklık") // TODO translate -MAKE_WORD_TRANSLATION(hp_prefered, "heatpump prefered", "Wärmepumpe bevorzugt", "", "Värmepump föredraget", "preferowana pompa ciepła", "varmepumpe prioritert", "pompe à chaleur préférée", "tercih edilen pompa") // TODO translate -MAKE_WORD_TRANSLATION(boiler_only, "boiler only", "nur Kessel", "", "Värmepanna enbart", "tylko kocioł", "kun kjele", "chaudière uniquement", "sadece kazan") // TODO translate -MAKE_WORD_TRANSLATION(reduced_output, "reduced output", "Reduzierte Leistung", "", "Reducerad produktion", "zmniejszona wydajność", "redusert ytelse", "sortie réduite", "düşürülmüş çıkış") // TODO translate -MAKE_WORD_TRANSLATION(switchoff, "switch off hp", "WP ausschalten", "", "Värmepump avstängd", "wyłącz pompę ciepła", "slå av varmepumpe", "éteindre la PAC", "ısı pompasını kapat") // TODO translate -MAKE_WORD_TRANSLATION(perm, "perm. reduced", "perm. reduziert", "", "Permanent reducerad", "stale zmniejszona wydajność", "permanent redusert", "réduction permanente", "sürekli azaltılmış") // TODO translate +MAKE_WORD_TRANSLATION(none, "none", "keine", "geen", "ingen", "brak", "ingen", "aucun", "hiçbiri", "nessuno") +MAKE_WORD_TRANSLATION(hot_water, "hot water", "Warmwasser", "warm water", "varmvatten", "c.w.u.", "varmtvann", "eau chaude", "sıcak su", "acqua calda") +MAKE_WORD_TRANSLATION(pool, "pool", "Pool", "zwembad", "pool", "basen", "basseng", "piscine", "havuz", "piscina") +MAKE_WORD_TRANSLATION(outside_temp_alt, "outside temperature alt.", "Außentemp. alternativ", "", "Alternativ utomhustemp.", "temp. zewn. alternat.", "alternativ utendørstemp.", "température extérieure alternative", "alternatif dış sıcaklık", "temperatura esterna alternativa") // TODO translate +MAKE_WORD_TRANSLATION(outside_temp_par, "outside temperature parallel", "Außentemp. parallel", "", "Parallell utomhustemp.", "temp. zewn. równoległa", "parallell utendørstemp.", "température extérieure parallèle", "paralel dış sıcaklık", "temperatura esterna parallela") // TODO translate +MAKE_WORD_TRANSLATION(hp_prefered, "heatpump prefered", "Wärmepumpe bevorzugt", "", "Värmepump föredraget", "preferowana pompa ciepła", "varmepumpe prioritert", "pompe à chaleur préférée", "tercih edilen pompa", "pompa di calore preferita") // TODO translate +MAKE_WORD_TRANSLATION(boiler_only, "boiler only", "nur Kessel", "", "Värmepanna enbart", "tylko kocioł", "kun kjele", "chaudière uniquement", "sadece kazan", "solo caldaia") // TODO translate +MAKE_WORD_TRANSLATION(reduced_output, "reduced output", "Reduzierte Leistung", "", "Reducerad produktion", "zmniejszona wydajność", "redusert ytelse", "sortie réduite", "düşürülmüş çıkış", "riduzione uscita") // TODO translate +MAKE_WORD_TRANSLATION(switchoff, "switch off hp", "WP ausschalten", "", "Värmepump avstängd", "wyłącz pompę ciepła", "slå av varmepumpe", "éteindre la PAC", "ısı pompasını kapat", "spegnimento pompa calore") // TODO translate +MAKE_WORD_TRANSLATION(perm, "perm. reduced", "perm. reduziert", "", "Permanent reducerad", "stale zmniejszona wydajność", "permanent redusert", "réduction permanente", "sürekli azaltılmış", "riduzione permanente") // TODO translate // thermostat -MAKE_WORD_TRANSLATION(seltemp, "selTemp", "Solltemperatur", "Doeltemperatuur", "Börtemperatur", "temperatura zadana", "innstilt temperatur", "consigne température", "ayarlanmış sıcaklık") -MAKE_WORD_TRANSLATION(roomtemp, "roomTemp", "Raumtemperatur", "Kamertemperatuur", "Rumstemperatur", "temperatura w pomieszczeniu", "romstemperatur", "température de la pièce", "oda sıcaklığı") -MAKE_WORD_TRANSLATION(own_prog, "own prog", "Eigenprog.", "Eigen prog.", "Egen prog.", "program własny", "eget prog.", "programme propre", "isteğe göre ayarlanmış program") -MAKE_WORD_TRANSLATION(std_prog, "std prog", "Standardprog.", "Standaard prog.", "Standardprog.", "program standardowy", "standardprog.", "programme standard", "sandart pogram") -MAKE_WORD_TRANSLATION(light, "light", "Leicht", "Licht", "Lätt", "lekki", "lett", "léger", "düşük") -MAKE_WORD_TRANSLATION(medium, "medium", "Mittel", "Middel", "Medel", "średni", "medium", "medium", "orta") -MAKE_WORD_TRANSLATION(heavy, "heavy", "Schwer", "Zwaar", "Tung", "ciężki", "tung", "lourd", "yüksek") -MAKE_WORD_TRANSLATION(start, "start", "Start", "Start", "Start", "start", "start", "début", "başlat") -MAKE_WORD_TRANSLATION(heat, "heat", "Heizen", "Verwarmen", "Värme", "ciepło", "varmer", "chaleur", "ısıtma") -MAKE_WORD_TRANSLATION(hold, "hold", "Halten", "Pauzeren", "Paus", "pauza", "pause", "pause", "durdur") -MAKE_WORD_TRANSLATION(cool, "cool", "Kühlen", "Koelen", "Kyla", "zimno", "kjøler", "froid", "soğutma") -MAKE_WORD_TRANSLATION(end, "end", "Ende", "Einde", "Slut", "koniec", "slutt", "fin", "bitti") -MAKE_WORD_TRANSLATION(german, "german", "Deutsch", "Duits", "Tyska", "niemiecki", "tysk", "allemand", "Almanca") -MAKE_WORD_TRANSLATION(dutch, "dutch", "Niederländisch", "Nederlands", "Nederländska", "niderlandzki", "nederlandsk", "néerlandais", "Flemenkçe") -MAKE_WORD_TRANSLATION(french, "french", "Französisch", "Frans", "Franska", "francuski", "fransk", "français", "Fransızca") -MAKE_WORD_TRANSLATION(italian, "italian", "Italienisch", "Italiaans", "Italienska", "włoski", "italiensk", "italien", "İtalyanca") - -MAKE_WORD_TRANSLATION(high, "high", "hoch", "hoog", "Hög", "wysoki", "høy", "haut") // TODO translate -MAKE_WORD_TRANSLATION(low, "low", "niedrig", "laag", "Låg", "niski", "lav", "bas", "düşük") -MAKE_WORD_TRANSLATION(radiator, "radiator", "Heizkörper", "Radiator", "Radiator", "grzejniki", "radiator", "radiateur", "radyatör") -MAKE_WORD_TRANSLATION(convector, "convector", "Konvektor", "Convector", "Konvektor", "konwektory", "konvektor", "convecteur", "convector") -MAKE_WORD_TRANSLATION(floor, "floor", "Fussboden", "Vloer", "Golv", "podłoga", "gulv", "sol", "yer") -MAKE_WORD_TRANSLATION(summer, "summer", "Sommer", "Zomer", "Sommar", "lato", "sommer", "été", "yaz") -MAKE_WORD_TRANSLATION(winter, "winter", "Winter", "Winter", "Vinter", "zima", "vinter", "hiver", "kış") -MAKE_WORD_TRANSLATION(outdoor, "outdoor", "Außen", "Buiten", "Utomhus", "temp. zewnętrzna", "utendørs", "extérieur", "dış") -MAKE_WORD_TRANSLATION(room, "room", "Raum", "Kamer", "Rum", "temp. w pomieszczeniu", "", "pièce", "oda") // TODO translate -MAKE_WORD_TRANSLATION(room_outdoor, "room outdoor", "Raum+Außen", "Kamer+Buiten", "Rum+Ute", "temp. w pom. i zewn.", "rom utendørs", "pièce extérieure", "oda ve dış") -MAKE_WORD_TRANSLATION(power, "power", "Leistung", "Vermogen", "Effekt", "moc", "effekt", "puissance", "güç") -MAKE_WORD_TRANSLATION(constant, "constant", "konstant", "constant", "Konstant", "stały", "konstant", "constant", "sabit") -MAKE_WORD_TRANSLATION(simple, "simple", "einfach", "simpel", "enkel", "prosty", "enkel", "simple", "basit") -MAKE_WORD_TRANSLATION(optimized, "optimized", "optimiert", "geoptimaliseerd", "optimerad", "zoptymalizowany", "optimalisert", "optimisé", "optimize") -MAKE_WORD_TRANSLATION(nofrost, "nofrost", "Frostschutz", "Vorstbescherming", "Frostskydd", "ochrona przed zamarzaniem", "frostsikring", "protection gel", "Donma koruması") -MAKE_WORD_TRANSLATION(defrost, "defrost", "Abtauen", "ontdooien", "avfrostning", "rozmrażać", "tine", "dégivrage", "buz çözücü") -MAKE_WORD_TRANSLATION(comfort, "comfort", "Komfort", "Comfort", "Komfort", "komfort", "komfort", "comfort", "konfor") -MAKE_WORD_TRANSLATION(night, "night", "Nacht", "Nacht", "Natt", "noc", "natt", "nuit", "gece") -MAKE_WORD_TRANSLATION(day, "day", "Tag", "Dag", "Dag", "dzień", "dag", "jour", "gün") -MAKE_WORD_TRANSLATION(holiday, "holiday", "Urlaub", "Vakantie", "Helgdag", "urlop?", "ferie", "vacances", "tatil") -MAKE_WORD_TRANSLATION(reduce, "reduce", "reduziert", "gereduceerd", "Reducera", "zredukowany", "redusere", "réduit", "düşür") -MAKE_WORD_TRANSLATION(noreduce, "no reduce", "unreduziert", "niet gerduceerd", "oreducerad", "bez redukcji", "ingen reduksjon", "pas de réduction", "düşürme") -MAKE_WORD_TRANSLATION(offset, "offset", "Anhebung", "offset", "Förskutning", "przesunięcie", "kompensasjon", "offset", "kompansasyon") -MAKE_WORD_TRANSLATION(design, "design", "Auslegung", "Ontwero", "Design", "projekt", "design", "design", "tasarım") -MAKE_WORD_TRANSLATION(minflow, "min flow", "min. Durchfluss", "Min. Doorstroom", "Min flöde", "minimalny przepływ", "min strømming", "flux min", "minimum akış") -MAKE_WORD_TRANSLATION(maxflow, "max flow", "max. Durchfluss", "Max. Doorstroom", "Max flöde", "maksymalny przepływ", "maks strømming", "flux max", "maksimum akış") -MAKE_WORD_TRANSLATION(fast, "fast", "schnell", "snel", "snabb", "szybkie", "hurtig", "rapide", "hızlı") -MAKE_WORD_TRANSLATION(slow, "slow", "langsam", "langzaam", "långsam", "powolne", "langsom", "lent", "yavaş") -MAKE_WORD_TRANSLATION(internal_temperature, "internal temperature", "Interne Temperatur", "Interne Temperatuur", "Interntemperatur", "temperatura wewnętrzna", "interntemperatur", "température interne", "oda sıcaklığı") -MAKE_WORD_TRANSLATION(internal_setpoint, "internal setpoint", "Interner Sollwert", "Interne Streeftemperatuur", "Internt börvärde", "nastawa wewnętrzna", "internt settpunkt", "consigne interne", "istenen oda sıcaklığı") -MAKE_WORD_TRANSLATION(external_temperature, "external temperature", "Externe Temperatur", "Externe Temperatuur", "Extern temperatur", "temperatura zewnętrzna", "ekstern temperatur", "température externe") -MAKE_WORD_TRANSLATION(burner_temperature, "burner temperature", "Brennertemperatur", "Brander Temperuur", "Brännartemperatur", "temperatura palnika", "brennertemperatur", "température du brûleur", "kazan sıcaklığı") -MAKE_WORD_TRANSLATION(ww_temperature, "ww temperature", "Wassertemperatur", "Watertemperatuur", "Vattentemperatur", "temperatura c.w.u.", "vanntemperatur", "température de l'eau", "Kullanım suyu sıcaklığı") -MAKE_WORD_TRANSLATION(smoke_temperature, "smoke temperature", "Abgastemperatur", "Buitentemperatuur", "Rökgastemperatur", "temperatura dymu", "røykgasstemperatur", "température des gaz d'échappement", "baca gazı sıcaklığı") -MAKE_WORD_TRANSLATION(weather_compensated, "weather compensated", "Wetter kompensiert", "Weer gecompenseerd", "Väderkompenserad", "skompensow. pogodą", "værkompensert", "compensation par l'extérieur", "hava durumuna göre dengelenmiş") -MAKE_WORD_TRANSLATION(outside_basepoint, "outside basepoint", "Basispunkt Außentemp.", "Buiten basispunt", "Utomhus baspunkt", "temp. zewn. z pkt. pocz.", "utendørs basispunkt", "point de base temp. ext.", "dış hava sıcaklığı taban noktası") -MAKE_WORD_TRANSLATION(functioning_mode, "functioning mode", "Funktionsweise", "Functiemodus", "Driftläge", "tryb pracy", "driftsmodus", "mode de fonctionnement", "işletme konumu") +MAKE_WORD_TRANSLATION(seltemp, "selTemp", "Solltemperatur", "Doeltemperatuur", "Börtemperatur", "temperatura zadana", "innstilt temperatur", "consigne température", "ayarlanmış sıcaklık", "temperatura di consegna") +MAKE_WORD_TRANSLATION(roomtemp, "roomTemp", "Raumtemperatur", "Kamertemperatuur", "Rumstemperatur", "temperatura w pomieszczeniu", "romstemperatur", "température de la pièce", "oda sıcaklığı", "temperatura camera") +MAKE_WORD_TRANSLATION(own_prog, "own prog", "Eigenprog.", "Eigen prog.", "Egen prog.", "program własny", "eget prog.", "programme propre", "isteğe göre ayarlanmış program", "proprio prog.") +MAKE_WORD_TRANSLATION(std_prog, "std prog", "Standardprog.", "Standaard prog.", "Standardprog.", "program standardowy", "standardprog.", "programme standard", "sandart pogram", "programma standard") +MAKE_WORD_TRANSLATION(light, "light", "Leicht", "Licht", "Lätt", "lekki", "lett", "léger", "düşük", "luce") +MAKE_WORD_TRANSLATION(medium, "medium", "Mittel", "Middel", "Medel", "średni", "medium", "medium", "orta", "medio") +MAKE_WORD_TRANSLATION(heavy, "heavy", "Schwer", "Zwaar", "Tung", "ciężki", "tung", "lourd", "yüksek", "pesante") +MAKE_WORD_TRANSLATION(start, "start", "Start", "Start", "Start", "start", "start", "début", "başlat", "avvia") +MAKE_WORD_TRANSLATION(heat, "heat", "Heizen", "Verwarmen", "Värme", "ciepło", "varmer", "chaleur", "ısıtma", "caldo") +MAKE_WORD_TRANSLATION(hold, "hold", "Halten", "Pauzeren", "Paus", "pauza", "pause", "pause", "durdur", "pausa") +MAKE_WORD_TRANSLATION(cool, "cool", "Kühlen", "Koelen", "Kyla", "zimno", "kjøler", "froid", "soğutma", "freddo") +MAKE_WORD_TRANSLATION(end, "end", "Ende", "Einde", "Slut", "koniec", "slutt", "fin", "bitti", "fine") +MAKE_WORD_TRANSLATION(german, "german", "Deutsch", "Duits", "Tyska", "niemiecki", "tysk", "allemand", "Almanca", "Tedesco") +MAKE_WORD_TRANSLATION(dutch, "dutch", "Niederländisch", "Nederlands", "Nederländska", "niderlandzki", "nederlandsk", "néerlandais", "Flemenkçe", "Olandese") +MAKE_WORD_TRANSLATION(french, "french", "Französisch", "Frans", "Franska", "francuski", "fransk", "français", "Fransızca", "Francese") +MAKE_WORD_TRANSLATION(italian, "italian", "Italienisch", "Italiaans", "Italienska", "włoski", "italiensk", "italien", "İtalyanca", "Italiano") +MAKE_WORD_TRANSLATION(high, "high", "hoch", "hoog", "Hög", "wysoki", "høy", "haut", "", "alto") // TODO translate +MAKE_WORD_TRANSLATION(low, "low", "niedrig", "laag", "Låg", "niski", "lav", "bas", "düşük", "basso") +MAKE_WORD_TRANSLATION(radiator, "radiator", "Heizkörper", "Radiator", "Radiator", "grzejniki", "radiator", "radiateur", "radyatör", "radiatore") +MAKE_WORD_TRANSLATION(convector, "convector", "Konvektor", "Convector", "Konvektor", "konwektory", "konvektor", "convecteur", "convector", "convettore") +MAKE_WORD_TRANSLATION(floor, "floor", "Fussboden", "Vloer", "Golv", "podłoga", "gulv", "sol", "yer", "pavimento") +MAKE_WORD_TRANSLATION(summer, "summer", "Sommer", "Zomer", "Sommar", "lato", "sommer", "été", "yaz", "estate") +MAKE_WORD_TRANSLATION(winter, "winter", "Winter", "Winter", "Vinter", "zima", "vinter", "hiver", "kış", "inverno") +MAKE_WORD_TRANSLATION(outdoor, "outdoor", "Außen", "Buiten", "Utomhus", "temp. zewnętrzna", "utendørs", "extérieur", "dış", "esterno") +MAKE_WORD_TRANSLATION(room, "room", "Raum", "Kamer", "Rum", "temp. w pomieszczeniu", "", "pièce", "oda", "camera") // TODO translate +MAKE_WORD_TRANSLATION(room_outdoor, "room outdoor", "Raum+Außen", "Kamer+Buiten", "Rum+Ute", "temp. w pom. i zewn.", "rom utendørs", "pièce extérieure", "oda ve dış", "camera esterna") +MAKE_WORD_TRANSLATION(power, "power", "Leistung", "Vermogen", "Effekt", "moc", "effekt", "puissance", "güç", "potenza") +MAKE_WORD_TRANSLATION(constant, "constant", "konstant", "constant", "Konstant", "stały", "konstant", "constant", "sabit", "costante") +MAKE_WORD_TRANSLATION(simple, "simple", "einfach", "simpel", "enkel", "prosty", "enkel", "simple", "basit", "semplice") +MAKE_WORD_TRANSLATION(optimized, "optimized", "optimiert", "geoptimaliseerd", "optimerad", "zoptymalizowany", "optimalisert", "optimisé", "optimize", "ottimizzato") +MAKE_WORD_TRANSLATION(nofrost, "nofrost", "Frostschutz", "Vorstbescherming", "Frostskydd", "ochrona przed zamarzaniem", "frostsikring", "protection gel", "Donma koruması", "protezione gelo") +MAKE_WORD_TRANSLATION(defrost, "defrost", "Abtauen", "ontdooien", "avfrostning", "rozmrażać", "tine", "dégivrage", "buz çözücü", "scongelamento") +MAKE_WORD_TRANSLATION(comfort, "comfort", "Komfort", "Comfort", "Komfort", "komfort", "komfort", "comfort", "konfor", "comfort") +MAKE_WORD_TRANSLATION(night, "night", "Nacht", "Nacht", "Natt", "noc", "natt", "nuit", "gece", "notte") +MAKE_WORD_TRANSLATION(day, "day", "Tag", "Dag", "Dag", "dzień", "dag", "jour", "gün", "giorno") +MAKE_WORD_TRANSLATION(holiday, "holiday", "Urlaub", "Vakantie", "Helgdag", "urlop?", "ferie", "vacances", "tatil", "vacanza") +MAKE_WORD_TRANSLATION(reduce, "reduce", "reduziert", "gereduceerd", "Reducera", "zredukowany", "redusere", "réduit", "düşür", "riduzione") +MAKE_WORD_TRANSLATION(noreduce, "no reduce", "unreduziert", "niet gerduceerd", "oreducerad", "bez redukcji", "ingen reduksjon", "pas de réduction", "düşürme", "non ridurre") +MAKE_WORD_TRANSLATION(offset, "offset", "Anhebung", "offset", "Förskutning", "przesunięcie", "kompensasjon", "offset", "kompansasyon", "offset") +MAKE_WORD_TRANSLATION(design, "design", "Auslegung", "Ontwero", "Design", "projekt", "design", "design", "tasarım", "disegno") +MAKE_WORD_TRANSLATION(minflow, "min flow", "min. Durchfluss", "Min. Doorstroom", "Min flöde", "minimalny przepływ", "min strømming", "flux min", "minimum akış", "flusso minimo") +MAKE_WORD_TRANSLATION(maxflow, "max flow", "max. Durchfluss", "Max. Doorstroom", "Max flöde", "maksymalny przepływ", "maks strømming", "flux max", "maksimum akış", "flusso massimo") +MAKE_WORD_TRANSLATION(fast, "fast", "schnell", "snel", "snabb", "szybkie", "hurtig", "rapide", "hızlı", "veloce") +MAKE_WORD_TRANSLATION(slow, "slow", "langsam", "langzaam", "långsam", "powolne", "langsom", "lent", "yavaş", "lento") +MAKE_WORD_TRANSLATION(internal_temperature, "internal temperature", "Interne Temperatur", "Interne Temperatuur", "Interntemperatur", "temperatura wewnętrzna", "interntemperatur", "température interne", "oda sıcaklığı", "temperatura interna") +MAKE_WORD_TRANSLATION(internal_setpoint, "internal setpoint", "Interner Sollwert", "Interne Streeftemperatuur", "Internt börvärde", "nastawa wewnętrzna", "internt settpunkt", "consigne interne", "istenen oda sıcaklığı", "setpoint interno") +MAKE_WORD_TRANSLATION(external_temperature, "external temperature", "Externe Temperatur", "Externe Temperatuur", "Extern temperatur", "temperatura zewnętrzna", "ekstern temperatur", "température externe","", "temperatura esterna") // TODO translate +MAKE_WORD_TRANSLATION(burner_temperature, "burner temperature", "Brennertemperatur", "Brander Temperuur", "Brännartemperatur", "temperatura palnika", "brennertemperatur", "température du brûleur", "kazan sıcaklığı", "temperatura bruciatore") +MAKE_WORD_TRANSLATION(ww_temperature, "ww temperature", "Wassertemperatur", "Watertemperatuur", "Vattentemperatur", "temperatura c.w.u.", "vanntemperatur", "température de l'eau", "Kullanım suyu sıcaklığı", "temperatura acqua") +MAKE_WORD_TRANSLATION(smoke_temperature, "smoke temperature", "Abgastemperatur", "Buitentemperatuur", "Rökgastemperatur", "temperatura dymu", "røykgasstemperatur", "température des gaz d'échappement", "baca gazı sıcaklığı", "temperatura fumo") +MAKE_WORD_TRANSLATION(weather_compensated, "weather compensated", "Wetter kompensiert", "Weer gecompenseerd", "Väderkompenserad", "skompensow. pogodą", "værkompensert", "compensation par l'extérieur", "hava durumuna göre dengelenmiş", "acqua compensata") +MAKE_WORD_TRANSLATION(outside_basepoint, "outside basepoint", "Basispunkt Außentemp.", "Buiten basispunt", "Utomhus baspunkt", "temp. zewn. z pkt. pocz.", "utendørs basispunkt", "point de base temp. ext.", "dış hava sıcaklığı taban noktası", "basepoint esterno") +MAKE_WORD_TRANSLATION(functioning_mode, "functioning mode", "Funktionsweise", "Functiemodus", "Driftläge", "tryb pracy", "driftsmodus", "mode de fonctionnement", "işletme konumu", "modalità di funzionamento") // mixer -MAKE_WORD_TRANSLATION(stopped, "stopped", "gestoppt", "gestopt", "stoppad", "zatrzymany", "stoppet", "arrêté", "durdu") -MAKE_WORD_TRANSLATION(opening, "opening", "öffnen", "openen", "öppnar", "otwieranie", "åpner", "ouverture", "açılıyor") -MAKE_WORD_TRANSLATION(closing, "closing", "schließen", "sluiten", "stänger", "zamykanie", "stenger", "fermeture", "kapanıyor") -MAKE_WORD_TRANSLATION(open, "open", "offen", "Open", "Öppen", "otwórz", "åpen", "ouvert", "açık") -MAKE_WORD_TRANSLATION(close, "close", "geschlossen", "Gesloten", "Stängd", "zamknij", "stengt", "fermé", "kapalı") +MAKE_WORD_TRANSLATION(stopped, "stopped", "gestoppt", "gestopt", "stoppad", "zatrzymany", "stoppet", "arrêté", "durdu", "fermato") +MAKE_WORD_TRANSLATION(opening, "opening", "öffnen", "openen", "öppnar", "otwieranie", "åpner", "ouverture", "açılıyor", "aperto") +MAKE_WORD_TRANSLATION(closing, "closing", "schließen", "sluiten", "stänger", "zamykanie", "stenger", "fermeture", "kapanıyor", "chiuso") +MAKE_WORD_TRANSLATION(open, "open", "offen", "Open", "Öppen", "otwórz", "åpen", "ouvert", "açık", "aprire") +MAKE_WORD_TRANSLATION(close, "close", "geschlossen", "Gesloten", "Stängd", "zamknij", "stengt", "fermé", "kapalı", "chiudere") // solar ww -MAKE_WORD_TRANSLATION(cyl1, "cyl 1", "Zyl_1", "Cil 1", "Cyl 1", "cyl 1", "cyl 1", "cyl 1", "cly 1") -MAKE_WORD_TRANSLATION(cyl2, "cyl 2", "Zyl_2", "Cil 2", "Cyl 2", "cyl 2", "cyl 2", "cyl 2", "cly 1") +MAKE_WORD_TRANSLATION(cyl1, "cyl 1", "Zyl_1", "Cil 1", "Cyl 1", "cyl 1", "cyl 1", "cyl 1", "cly 1", "Cil 1") +MAKE_WORD_TRANSLATION(cyl2, "cyl 2", "Zyl_2", "Cil 2", "Cyl 2", "cyl 2", "cyl 2", "cyl 2", "cly 1", "Cil 2") // ventilation MAKE_WORD_TRANSLATION(demand, "demand", "Bedarf") @@ -275,225 +277,225 @@ MAKE_WORD_TRANSLATION(partymode, "party", "Party") MAKE_WORD_TRANSLATION(fireplace, "fireplace", "Kamin") // MQTT Discovery - this is special device entity for 'climate' -MAKE_TRANSLATION(haclimate, "haclimate", "Discovery current room temperature", "Discovery Temperatur", "", "", "termostat w HA", "HA Avlest temp", "", "") // TODO translate +MAKE_TRANSLATION(haclimate, "haclimate", "Discovery current room temperature", "Discovery Temperatur", "", "", "termostat w HA", "HA Avlest temp", "", "", "verifica temperatura ambiente attuale") // TODO translate // Entity translations // Boiler -MAKE_TRANSLATION(wwtapactivated, "wwtapactivated", "turn on/off", "Durchlauferhitzer aktiv", "zet aan/uit", "på/av", "system przygotowywania", "Varmtvann active", "ecs activée", "") -MAKE_TRANSLATION(reset, "reset", "Reset", "Reset", "Reset", "Nollställ", "kasowanie komunikatu", "nullstill", "reset", "") -MAKE_TRANSLATION(oilPreHeat, "oilpreheat", "oil preheating", "Ölvorwärmung", "Olie voorverwarming", "Förvärmning olja", "podgrzewanie oleju", "oljeforvarming", "préchauffage de l'huile", "") -MAKE_TRANSLATION(heatingActive, "heatingactive", "heating active", "Heizen aktiv", "Verwarming actief", "Uppvärmning aktiv", "c.o. aktywne", "oppvarming aktiv", "chauffage actif", "") -MAKE_TRANSLATION(tapwaterActive, "tapwateractive", "tapwater active", "Warmwasser aktiv", "Warm water actief", "Varmvatten aktiv", "c.w.u. aktywne", "varmtvann aktiv", "eau chaude active", "") -MAKE_TRANSLATION(selFlowTemp, "selflowtemp", "selected flow temperature", "Sollwert Vorlauftemperatur", "Ingestelde aanvoertemperatuur", "Börvärde Flödestemperatur", "wybrana temperatura zasilania", "valgt turtemperatur", "température de flux selectionnée", "") -MAKE_TRANSLATION(selBurnPow, "selburnpow", "burner selected max power", "Sollwert Brennerleistung", "Ingestelde maximale brandervermogen", "Brännare vald maxeffekt", "wybrana moc źródła ciepła", "settpunkt brennerkapasitet", "puissance max du brûleur selectionnée", "") -MAKE_TRANSLATION(absBurnPow, "absburnpow", "burner current power (absolute)", "Brennerleistung (absolut)", "Brandervermogen (abs)", "Värmepanna aktuell effekt (abs)", "aktualna moc źródła ciepła (absolutna)", "brennereffekt", "puissance du brûleur actuelle (abs)", "") -MAKE_TRANSLATION(heatingPumpMod, "heatingpumpmod", "heating pump modulation", "Heizungspumpe 1 Modulation", "Modulatie verwarmingspomp", "Modulering Värmepump", "wysterowanie pompy c.o.", "varmepumpemodulering", "modulation de la pompe à chaleur", "") -MAKE_TRANSLATION(outdoorTemp, "outdoortemp", "outside temperature", "Aussentemperatur", "Buitentemperatuur", "Utomhustemperatur", "temperatura zewnętrzna", "utetemperatur", "température extérieure", "") -MAKE_TRANSLATION(curFlowTemp, "curflowtemp", "current flow temperature", "aktuelle Vorlauftemperatur", "Huidige aanvoertemperatuur", "Flödestemperatur", "temperatura zasilania", "aktuell strømmetemperatur", "température actuelle du flux", "") -MAKE_TRANSLATION(retTemp, "rettemp", "return temperature", "Rücklauftemperatur", "Retourtemperatuur", "Returtemperatur", "temperatura powrotu", "returtemperatur", "température de retour", "") -MAKE_TRANSLATION(switchTemp, "switchtemp", "mixing switch temperature", "Mischer Schalttemperatur", "Mixer temperatuur", "Blandartemperatur", "temperatura przełączania mieszacza", "Blandertemperatur", "température de bascule du mélangeur", "") -MAKE_TRANSLATION(sysPress, "syspress", "system pressure", "Systemdruck", "Systeemdruk", "Systemtryck", "ciśnienie w systemie", "systemtrykk", "pression du système", "") -MAKE_TRANSLATION(boilTemp, "boiltemp", "actual boiler temperature", "Kesseltemperatur", "Keteltemperatuur", "Temperatur Värmepanna", "temperatura zasobnika", "varmepumpetemp.", "température de la chaudière", "") -MAKE_TRANSLATION(exhaustTemp, "exhausttemp", "exhaust temperature", "Abgastemperatur", "Uitlaattemperatuur", "Avgastemperatur", "temperatura spalin", "røykgasstemp", "température des gaz d'échappement", "") -MAKE_TRANSLATION(burnGas, "burngas", "gas", "Gas", "Gas", "Gas", "gaz", "gass", "gaz", "") -MAKE_TRANSLATION(burnGas2, "burngas2", "gas stage 2", "Gas Stufe 2", "gas fase 2", "Gas Fas 2", "gaz 2 stopień", "gass fase 2", "gaz état 2", "") -MAKE_TRANSLATION(flameCurr, "flamecurr", "flame current", "Flammenstrom", "Vlammenstroom", "Lågström", "prąd palnika", "flammetemp", "courrant de flamme", "") -MAKE_TRANSLATION(heatingPump, "heatingpump", "heating pump", "Heizungspumpe", "Verwarmingspomp", "Värmepump", "pompa ciepła", "varmepumpe", "pompe à chaleur", "") -MAKE_TRANSLATION(fanWork, "fanwork", "fan", "Gebläse", "Ventilator", "Fläkt", "wentylator", "vifte", "ventilateur", "") -MAKE_TRANSLATION(ignWork, "ignwork", "ignition", "Zündung", "Ontsteking", "Tändning", "zapłon", "tenning", "ignition", "") -MAKE_TRANSLATION(heatingActivated, "heatingactivated", "heating activated", "Heizen aktiviert", "Verwarmen geactiveerd", "Uppvärmning aktiv", "system c.o.", "oppvarming aktivert", "chauffage activé", "") -MAKE_TRANSLATION(heatingTemp, "heatingtemp", "heating temperature", "Heizungstemperatur", "Verwarmingstemperatuur", "Uppvärmningstemperatur", "temperatura grzania", "oppvarmingstemperatur", "température de chauffage", "") -MAKE_TRANSLATION(pumpModMax, "pumpmodmax", "boiler pump max power", "Kesselpumpen Maximalleistung", "Ketelpomp max vermogen", "Värmepannepump max effekt", "maksymalna moc pompy zasobnika", "varmepumpe maks effekt", "puissance max pompe à chaleur", "") -MAKE_TRANSLATION(pumpModMin, "pumpmodmin", "boiler pump min power", "Kesselpumpen Minmalleistung", "Ketelpomp min vermogen", "Värmepannepump min effekt", "minimalna moc pompy zasobnika", "varmepumpe min effekt", "puissance min pompe à chaleur", "") -MAKE_TRANSLATION(pumpDelay, "pumpdelay", "pump delay", "Pumpennachlaufzeit", "Pomp nalooptijd", "Pumpfördröjning", "opóźnienie pompy", "pumpeforsinkelse", "délai d'attente pompe", "") -MAKE_TRANSLATION(burnMinPeriod, "burnminperiod", "burner min period", "Antipendelzeit", "Antipendeltijd", "Värmepanna Min Period", "minimalny czas pracy palnika", "varmekjele min periode", "délai d'attente du brûleur", "") -MAKE_TRANSLATION(burnMinPower, "burnminpower", "burner min power", "minimale Brennerleistung", "Minimaal brandervermogen", "Värmepanna Min Effekt", "minimalna moc źródła ciepła", "varmekjele min effekt", "puissance min brûleur", "") -MAKE_TRANSLATION(burnMaxPower, "burnmaxpower", "burner max power", "maximale Brennerleistung", "Maximaal brandervermogen", "Värmepanna Max Effekt", "maksymalna moc źródła ciepła", "varmekjele maks effekt", "puissance max brûleur", "") -MAKE_TRANSLATION(boilHystOn, "boilhyston", "hysteresis on temperature", "Einschaltdifferenz", "ketel aan hysterese verschil", "Hysteres aktiveringstemperatur", "histereza załączania", "hysterese på temperatur", "hysteresis température d'allumage", "") -MAKE_TRANSLATION(boilHystOff, "boilhystoff", "hysteresis off temperature", "Ausschaltdifferenz", "ketel uit hysterese verschil", "Hysteres inaktiveringstemperatur", "histereza wyłączania", "hysterese av temperatur", "hysteresis température d'extinction", "") -MAKE_TRANSLATION(boil2HystOn, "boil2hyston", "hysteresis stage 2 on temperature", "Einschaltdifferenz Stufe 2", "ketel aan hysterese verschil 2", "Hysteres aktiveringstemperatur 2", "histereza załączania stopnia 2", "", "hysteresis état 2 température d'allumage", "") // TODO translate -MAKE_TRANSLATION(boil2HystOff, "boil2hystoff", "hysteresis stage 2 off temperature", "Ausschaltdifferenz Stufe 2", "ketel uit hysterese verschil 2", "Hysteres inaktiveringstemperatur 2", "histereza wyłączania stopnia 2", "hysterese inaktiveringstemperatur 2", "hysteresis état 2 température d'extinction", "") // TODO translate -MAKE_TRANSLATION(setFlowTemp, "setflowtemp", "set flow temperature", "Sollwert Vorlauftemperatur", "Ingestelde aanvoertemperatuur", "Börvärde Flödestemperatur", "zadana temperatura zasilania", "innstilt turtemperatur", "température du flux définie", "") -MAKE_TRANSLATION(setBurnPow, "setburnpow", "burner set power", "Sollwert Brennerleistung", "Ingesteld brandervermogen", "Värmepanna vald Effekt", "zadana moc palnika", "varmekjele valgt effekt", "puissance du brûleur définie", "") -MAKE_TRANSLATION(curBurnPow, "curburnpow", "burner current power", "Brennerleistung", "Brandervermogen", "Värmepanna aktuell effekt", "aktualna moc źródła ciepła", "brennereffekt", "puissance du brûleur actuelle", "") -MAKE_TRANSLATION(burnStarts, "burnstarts", "burner starts", "Brenner Starts", "Aantal brander starts", "Värmepanna antal starter", "liczba uruchomień palnika", "antall varmepumpe starter", "démarrages du brûleur", "") -MAKE_TRANSLATION(burnWorkMin, "burnworkmin", "total burner operating time", "Brenner Laufzeit", "Totale branderlooptijd", "Värmepanna aktiva timmar", "łączny czas pracy palnika", "brennersteg tid i min", "durée de fonctionnement totale du brûleur", "") -MAKE_TRANSLATION(burn2WorkMin, "burn2workmin", "burner stage 2 operating time", "Brenner Stufe 2 Laufzeit", "Totale looptijd brander fase 2", "Värmepanna steg 2 aktiva timmar", "łączny czas pracy palnika 2 stopnia", "brennersteg2 tid i min", "durée de fonctionnement totale du brûleur état 2", "") -MAKE_TRANSLATION(heatWorkMin, "heatworkmin", "total heat operating time", "Heizung Laufzeit", "Totale looptijd verwarming", "Uppvärmning aktiva timmar", "łączny czas grzania", "varmetid i min", "durée de fonctionnement du chauffage", "") -MAKE_TRANSLATION(heatStarts, "heatstarts", "burner starts heating", "Brenner Starts Heizung", "Aantal brander starts verwarming", "Uppvärmning antal starter", "liczba uruchomień palnika na ogrzewanie", "antall oppvarmninger", "démarrages du chauffage", "") // TODO translate -MAKE_TRANSLATION(UBAuptime, "ubauptime", "total UBA operating time", "Anlagen-Gesamtlaufzeit", "totale looptijd branderautomaat (UBA)", "Total Tid", "łączny czas pracy układu sterowania", "totaltid", "durée de fonctionnement totale de l'appareil (UBA)", "") -MAKE_TRANSLATION(lastCode, "lastcode", "last error code", "Letzter Fehler", "Laatste foutcode", "Senaste Felkod", "ostatni błąd", "siste feilkode", "dernier code d'erreur", "") -MAKE_TRANSLATION(serviceCode, "servicecode", "service code", "Statusmeldung", "Statuscode", "Servicekod", "kod serwisowy", "servicekode", "code de service", "") -MAKE_TRANSLATION(serviceCodeNumber, "servicecodenumber", "service code number", "Statusmeldungsnummer", "Status codenummer", "Servicekod", "numer kodu serwisowego", "servicekodenummer", "numéro du code de service", "") -MAKE_TRANSLATION(maintenanceMessage, "maintenancemessage", "maintenance message", "Wartungsmeldung", "Onderhoudsmelding", "Servicemeddelande", "komunikat przeglądu", "vedlikeholdsmelding", "message de maintenance", "") -MAKE_TRANSLATION(maintenanceDate, "maintenancedate", "next maintenance date", "Wartungsdatum", "Onderhoudsdatum", "Datum nästa Service", "termin następnego przeglądu", "vedlikeholdsdato", "prochaine date de maintenance", "") -MAKE_TRANSLATION(maintenanceType, "maintenance", "maintenance scheduled", "Wartungsplan", "Onderhoud gepland", "Underhall schemlagt", "rodzaj przeglądu", "vedlikeholdstype", "maintenance prévue", "") -MAKE_TRANSLATION(maintenanceTime, "maintenancetime", "time to next maintenance", "Wartung in", "Onderhoud in", "Tid till nästa underhall", "czas do kolejnego przeglądu", "vedlikeholdstid", "durée avant la prochaine maintenance", "") -MAKE_TRANSLATION(emergencyOps, "emergencyops", "emergency operation", "Notoperation", "Noodoperatie", "Nöddrift", "praca w trybie awaryjnym", "nøddrift", "opération d'urgence", "") -MAKE_TRANSLATION(emergencyTemp, "emergencytemp", "emergency temperature", "Nottemperatur", "Noodtemperatuur", "Nöddrift temperatur", "temperatura w trybie awaryjnym", "nødtemperatur", "température d'urgence", "") -MAKE_TRANSLATION(pumpMode, "pumpmode", "boiler pump mode", "Kesselpumpen Modus", "", "", "tryb pracy pompy kotła", "pumpemodus", "", "") // TODO translate +MAKE_TRANSLATION(wwtapactivated, "wwtapactivated", "turn on/off", "Durchlauferhitzer aktiv", "zet aan/uit", "på/av", "system przygotowywania", "Varmtvann active", "ecs activée", "", "commuta on/off") +MAKE_TRANSLATION(reset, "reset", "Reset", "Reset", "Reset", "Nollställ", "kasowanie komunikatu", "nullstill", "reset", "", "Reset") +MAKE_TRANSLATION(oilPreHeat, "oilpreheat", "oil preheating", "Ölvorwärmung", "Olie voorverwarming", "Förvärmning olja", "podgrzewanie oleju", "oljeforvarming", "préchauffage de l'huile", "", "preriscaldamento olio") +MAKE_TRANSLATION(heatingActive, "heatingactive", "heating active", "Heizen aktiv", "Verwarming actief", "Uppvärmning aktiv", "c.o. aktywne", "oppvarming aktiv", "chauffage actif", "", "riscaldamento attivo") +MAKE_TRANSLATION(tapwaterActive, "tapwateractive", "tapwater active", "Warmwasser aktiv", "Warm water actief", "Varmvatten aktiv", "c.w.u. aktywne", "varmtvann aktiv", "eau chaude active", "", "acqua calda attiva") +MAKE_TRANSLATION(selFlowTemp, "selflowtemp", "selected flow temperature", "Sollwert Vorlauftemperatur", "Ingestelde aanvoertemperatuur", "Börvärde Flödestemperatur", "wybrana temperatura zasilania", "valgt turtemperatur", "température de flux selectionnée", "", "flusso temperatura selezionato") +MAKE_TRANSLATION(selBurnPow, "selburnpow", "burner selected max power", "Sollwert Brennerleistung", "Ingestelde maximale brandervermogen", "Brännare vald maxeffekt", "wybrana moc źródła ciepła", "settpunkt brennerkapasitet", "puissance max du brûleur selectionnée", "", "Setpoint potenza bruciatore") +MAKE_TRANSLATION(absBurnPow, "absburnpow", "burner current power (absolute)", "Brennerleistung (absolut)", "Brandervermogen (abs)", "Värmepanna aktuell effekt (abs)", "aktualna moc źródła ciepła (absolutna)", "brennereffekt", "puissance du brûleur actuelle (abs)", "", "potenza attuale del bruciatore (assoluta)") +MAKE_TRANSLATION(heatingPumpMod, "heatingpumpmod", "heating pump modulation", "Heizungspumpe 1 Modulation", "Modulatie verwarmingspomp", "Modulering Värmepump", "wysterowanie pompy c.o.", "varmepumpemodulering", "modulation de la pompe à chaleur", "", "modulazione pompa di calore") +MAKE_TRANSLATION(outdoorTemp, "outdoortemp", "outside temperature", "Aussentemperatur", "Buitentemperatuur", "Utomhustemperatur", "temperatura zewnętrzna", "utetemperatur", "température extérieure", "", "tempertura esterna") +MAKE_TRANSLATION(curFlowTemp, "curflowtemp", "current flow temperature", "aktuelle Vorlauftemperatur", "Huidige aanvoertemperatuur", "Flödestemperatur", "temperatura zasilania", "aktuell strømmetemperatur", "température actuelle du flux", "", "temperatura di mandata attuale") +MAKE_TRANSLATION(retTemp, "rettemp", "return temperature", "Rücklauftemperatur", "Retourtemperatuur", "Returtemperatur", "temperatura powrotu", "returtemperatur", "température de retour", "", "temperatura di ritorno attuale") +MAKE_TRANSLATION(switchTemp, "switchtemp", "mixing switch temperature", "Mischer Schalttemperatur", "Mixer temperatuur", "Blandartemperatur", "temperatura przełączania mieszacza", "Blandertemperatur", "température de bascule du mélangeur", "", "Temperatura di commutazione del miscelatore") +MAKE_TRANSLATION(sysPress, "syspress", "system pressure", "Systemdruck", "Systeemdruk", "Systemtryck", "ciśnienie w systemie", "systemtrykk", "pression du système", "", "pressione sistema") +MAKE_TRANSLATION(boilTemp, "boiltemp", "actual boiler temperature", "Kesseltemperatur", "Keteltemperatuur", "Temperatur Värmepanna", "temperatura zasobnika", "varmepumpetemp.", "température de la chaudière", "", "temperatura attuale caldaia") +MAKE_TRANSLATION(exhaustTemp, "exhausttemp", "exhaust temperature", "Abgastemperatur", "Uitlaattemperatuur", "Avgastemperatur", "temperatura spalin", "røykgasstemp", "température des gaz d'échappement", "", "temperatura di scarico") +MAKE_TRANSLATION(burnGas, "burngas", "gas", "Gas", "Gas", "Gas", "gaz", "gass", "gaz", "", "Gas") +MAKE_TRANSLATION(burnGas2, "burngas2", "gas stage 2", "Gas Stufe 2", "gas fase 2", "Gas Fas 2", "gaz 2 stopień", "gass fase 2", "gaz état 2", "", "gas fase 2") +MAKE_TRANSLATION(flameCurr, "flamecurr", "flame current", "Flammenstrom", "Vlammenstroom", "Lågström", "prąd palnika", "flammetemp", "courrant de flamme", "", "corrente di fiamma") +MAKE_TRANSLATION(heatingPump, "heatingpump", "heating pump", "Heizungspumpe", "Verwarmingspomp", "Värmepump", "pompa ciepła", "varmepumpe", "pompe à chaleur", "", "pompa di calore") +MAKE_TRANSLATION(fanWork, "fanwork", "fan", "Gebläse", "Ventilator", "Fläkt", "wentylator", "vifte", "ventilateur", "", "Ventilatore") +MAKE_TRANSLATION(ignWork, "ignwork", "ignition", "Zündung", "Ontsteking", "Tändning", "zapłon", "tenning", "ignition", "", "accensione") +MAKE_TRANSLATION(heatingActivated, "heatingactivated", "heating activated", "Heizen aktiviert", "Verwarmen geactiveerd", "Uppvärmning aktiv", "system c.o.", "oppvarming aktivert", "chauffage activé", "", "riscaldamento attivato") +MAKE_TRANSLATION(heatingTemp, "heatingtemp", "heating temperature", "Heizungstemperatur", "Verwarmingstemperatuur", "Uppvärmningstemperatur", "temperatura grzania", "oppvarmingstemperatur", "température de chauffage", "", "temperatura riscaldamento") +MAKE_TRANSLATION(pumpModMax, "pumpmodmax", "boiler pump max power", "Kesselpumpen Maximalleistung", "Ketelpomp max vermogen", "Värmepannepump max effekt", "maksymalna moc pompy zasobnika", "varmepumpe maks effekt", "puissance max pompe à chaleur", "", "max potenza pompa caldaia") +MAKE_TRANSLATION(pumpModMin, "pumpmodmin", "boiler pump min power", "Kesselpumpen Minmalleistung", "Ketelpomp min vermogen", "Värmepannepump min effekt", "minimalna moc pompy zasobnika", "varmepumpe min effekt", "puissance min pompe à chaleur", "", "min potenza pompa caldaia") +MAKE_TRANSLATION(pumpDelay, "pumpdelay", "pump delay", "Pumpennachlaufzeit", "Pomp nalooptijd", "Pumpfördröjning", "opóźnienie pompy", "pumpeforsinkelse", "délai d'attente pompe", "", "ritardo pompa") +MAKE_TRANSLATION(burnMinPeriod, "burnminperiod", "burner min period", "Antipendelzeit", "Antipendeltijd", "Värmepanna Min Period", "minimalny czas pracy palnika", "varmekjele min periode", "délai d'attente du brûleur", "", "periodo minimo del bruciatore") +MAKE_TRANSLATION(burnMinPower, "burnminpower", "burner min power", "minimale Brennerleistung", "Minimaal brandervermogen", "Värmepanna Min Effekt", "minimalna moc źródła ciepła", "varmekjele min effekt", "puissance min brûleur", "", "potenza minima bruciatore") +MAKE_TRANSLATION(burnMaxPower, "burnmaxpower", "burner max power", "maximale Brennerleistung", "Maximaal brandervermogen", "Värmepanna Max Effekt", "maksymalna moc źródła ciepła", "varmekjele maks effekt", "puissance max brûleur", "", "potenza massima bruciatore") +MAKE_TRANSLATION(boilHystOn, "boilhyston", "hysteresis on temperature", "Einschaltdifferenz", "ketel aan hysterese verschil", "Hysteres aktiveringstemperatur", "histereza załączania", "hysterese på temperatur", "hysteresis température d'allumage", "", "isteresi sulla temperatura") +MAKE_TRANSLATION(boilHystOff, "boilhystoff", "hysteresis off temperature", "Ausschaltdifferenz", "ketel uit hysterese verschil", "Hysteres inaktiveringstemperatur", "histereza wyłączania", "hysterese av temperatur", "hysteresis température d'extinction", "", "isteresi fuori temperatura") +MAKE_TRANSLATION(boil2HystOn, "boil2hyston", "hysteresis stage 2 on temperature", "Einschaltdifferenz Stufe 2", "ketel aan hysterese verschil 2", "Hysteres aktiveringstemperatur 2", "histereza załączania stopnia 2", "", "hysteresis état 2 température d'allumage", "", "stadio di isteresi 2 sulla temperatura") // TODO translate +MAKE_TRANSLATION(boil2HystOff, "boil2hystoff", "hysteresis stage 2 off temperature", "Ausschaltdifferenz Stufe 2", "ketel uit hysterese verschil 2", "Hysteres inaktiveringstemperatur 2", "histereza wyłączania stopnia 2", "hysterese inaktiveringstemperatur 2", "hysteresis état 2 température d'extinction", "", "isteresi stadio 2 fuori temperatura") // TODO translate +MAKE_TRANSLATION(setFlowTemp, "setflowtemp", "set flow temperature", "Sollwert Vorlauftemperatur", "Ingestelde aanvoertemperatuur", "Börvärde Flödestemperatur", "zadana temperatura zasilania", "innstilt turtemperatur", "température du flux définie", "", "impostare temperatura di mandata") +MAKE_TRANSLATION(setBurnPow, "setburnpow", "burner set power", "Sollwert Brennerleistung", "Ingesteld brandervermogen", "Värmepanna vald Effekt", "zadana moc palnika", "varmekjele valgt effekt", "puissance du brûleur définie", "", "impostare potenza bruciatore") +MAKE_TRANSLATION(curBurnPow, "curburnpow", "burner current power", "Brennerleistung", "Brandervermogen", "Värmepanna aktuell effekt", "aktualna moc źródła ciepła", "brennereffekt", "puissance du brûleur actuelle", "", "potenza attuale bruciatore") +MAKE_TRANSLATION(burnStarts, "burnstarts", "burner starts", "Brenner Starts", "Aantal brander starts", "Värmepanna antal starter", "liczba uruchomień palnika", "antall varmepumpe starter", "démarrages du brûleur", "", "avvii bruciatore") +MAKE_TRANSLATION(burnWorkMin, "burnworkmin", "total burner operating time", "Brenner Laufzeit", "Totale branderlooptijd", "Värmepanna aktiva timmar", "łączny czas pracy palnika", "brennersteg tid i min", "durée de fonctionnement totale du brûleur", "", "tempo totale di funzionamento del bruciatore") +MAKE_TRANSLATION(burn2WorkMin, "burn2workmin", "burner stage 2 operating time", "Brenner Stufe 2 Laufzeit", "Totale looptijd brander fase 2", "Värmepanna steg 2 aktiva timmar", "łączny czas pracy palnika 2 stopnia", "brennersteg2 tid i min", "durée de fonctionnement totale du brûleur état 2", "", "tempo di funzionamento del bruciatore 2° stadio") +MAKE_TRANSLATION(heatWorkMin, "heatworkmin", "total heat operating time", "Heizung Laufzeit", "Totale looptijd verwarming", "Uppvärmning aktiva timmar", "łączny czas grzania", "varmetid i min", "durée de fonctionnement du chauffage", "", "tempo totale di funzionamento in riscaldamento") +MAKE_TRANSLATION(heatStarts, "heatstarts", "burner starts heating", "Brenner Starts Heizung", "Aantal brander starts verwarming", "Uppvärmning antal starter", "liczba uruchomień palnika na ogrzewanie", "antall oppvarmninger", "démarrages du chauffage", "", "preriscaldamento bruciatore") // TODO translate +MAKE_TRANSLATION(UBAuptime, "ubauptime", "total UBA operating time", "Anlagen-Gesamtlaufzeit", "totale looptijd branderautomaat (UBA)", "Total Tid", "łączny czas pracy układu sterowania", "totaltid", "durée de fonctionnement totale de l'appareil (UBA)", "", "Tempo di funzionamento totale del sistema") +MAKE_TRANSLATION(lastCode, "lastcode", "last error code", "Letzter Fehler", "Laatste foutcode", "Senaste Felkod", "ostatni błąd", "siste feilkode", "dernier code d'erreur", "", "ultimo codice errore") +MAKE_TRANSLATION(serviceCode, "servicecode", "service code", "Statusmeldung", "Statuscode", "Servicekod", "kod serwisowy", "servicekode", "code de service", "", "codice messaggio di stato") +MAKE_TRANSLATION(serviceCodeNumber, "servicecodenumber", "service code number", "Statusmeldungsnummer", "Status codenummer", "Servicekod", "numer kodu serwisowego", "servicekodenummer", "numéro du code de service", "", "numero del messaggio di stato") +MAKE_TRANSLATION(maintenanceMessage, "maintenancemessage", "maintenance message", "Wartungsmeldung", "Onderhoudsmelding", "Servicemeddelande", "komunikat przeglądu", "vedlikeholdsmelding", "message de maintenance", "", "messaggio di manutenzione") +MAKE_TRANSLATION(maintenanceDate, "maintenancedate", "next maintenance date", "Wartungsdatum", "Onderhoudsdatum", "Datum nästa Service", "termin następnego przeglądu", "vedlikeholdsdato", "prochaine date de maintenance", "", "prossima data di manutenzione") +MAKE_TRANSLATION(maintenanceType, "maintenance", "maintenance scheduled", "Wartungsplan", "Onderhoud gepland", "Underhall schemlagt", "rodzaj przeglądu", "vedlikeholdstype", "maintenance prévue", "", "manutenzione programmata") +MAKE_TRANSLATION(maintenanceTime, "maintenancetime", "time to next maintenance", "Wartung in", "Onderhoud in", "Tid till nästa underhall", "czas do kolejnego przeglądu", "vedlikeholdstid", "durée avant la prochaine maintenance", "", "tempo alla prossima manutenzione") +MAKE_TRANSLATION(emergencyOps, "emergencyops", "emergency operation", "Notoperation", "Noodoperatie", "Nöddrift", "praca w trybie awaryjnym", "nøddrift", "opération d'urgence", "", "operazione di emergenza") +MAKE_TRANSLATION(emergencyTemp, "emergencytemp", "emergency temperature", "Nottemperatur", "Noodtemperatuur", "Nöddrift temperatur", "temperatura w trybie awaryjnym", "nødtemperatur", "température d'urgence", "", "temperatura di emergenza") +MAKE_TRANSLATION(pumpMode, "pumpmode", "boiler pump mode", "Kesselpumpen Modus", "", "", "tryb pracy pompy kotła", "pumpemodus", "", "", "modalità pompa caldaia") // TODO translate // heatpump/compress specific -MAKE_TRANSLATION(upTimeControl, "uptimecontrol", "total operating time heat", "Betriebszeit Heizen gesamt", "Totale bedrijfstijd", "Total tid uppvärmning", "łączny czas generowania ciepła", "total driftstid", "durée totale de fonctionnement chauffage", "") // TODO translate -MAKE_TRANSLATION(upTimeCompHeating, "uptimecompheating", "operating time compressor heating", "Betriebszeit Kompressor heizen", "Bedrijfstijd compressor verwarmingsbedrijf", "Total tid kompressor uppvärmning", "łączny czas ogrzewania (sprężarka)", "totaltid kompressor", "durée de fonctionnement compresseur chauffage", "") // TODO translate -MAKE_TRANSLATION(upTimeCompCooling, "uptimecompcooling", "operating time compressor cooling", "Betriebszeit Kompressor kühlen", "Bedrijfstijd compressor koelbedrijf", "Total tid kompressor kyla", "łączny czas chłodzenia (sprężarka)", "Total tid kompressor kjøling", "durée de fonctionnement compresseur refroidissement", "") -MAKE_TRANSLATION(upTimeCompWw, "uptimecompww", "operating time compressor dhw", "Betriebszeit Kompressor", "Bedrijfstijd compressor warmwaterbedrijf", "Total tid kompressor varmvatten", "łączny czas grzania c.w.u. (sprężarka)", "Total tid kompressor varmtvann", "durée de fonctionnement compresseur ecs", "") -MAKE_TRANSLATION(upTimeCompPool, "uptimecomppool", "operating time compressor pool", "Betriebszeit Kompressor Pool", "Bedrijfstijd compressor voor zwembadbedrijf", "Total tid kompressor pool", "łączny czas podgrzewania basenu (sprężarka)", "Total tid kompressor basseng", "durée de fonctionnement compresseur piscine", "") -MAKE_TRANSLATION(totalCompStarts, "totalcompstarts", "total compressor control starts", "Kompressor Starts gesamt", "Totaal compressorstarts", "Kompressorstarter Totalt", "liczba załączeń sprężarki", "kompressorstarter totalt", "nombre démarrages total contrôle compresseur", "") -MAKE_TRANSLATION(heatingStarts, "heatingstarts", "heating control starts", "Heizen Starts", "Starts verwarmingsbedrijf", "Kompressorstarter Uppvärmning", "liczba załączeń ogrzewania", "kompressorstarter oppvarming", "démarrages contrôle chauffage", "") -MAKE_TRANSLATION(coolingStarts, "coolingstarts", "cooling control starts", "Kühlen Starts", "Starts koelbedrijf", "Kompressorstarter Kyla", "liczba załączeń chłodzenia", "kompressorstarter kjøling", "démarrages contrôle refroidissement", "") -MAKE_TRANSLATION(poolStarts, "poolstarts", "pool control starts", "Pool Starts", "Starts zwembadbedrijf", "Kompressorstarter Pool", "liczba załączeń podgrzewania basenu", "kompressorstarter basseng", "démarrages contrôle piscine", "") -MAKE_TRANSLATION(nrgConsTotal, "nrgconstotal", "total energy consumption", "Energieverbrauch gesamt", "Energieverbrauch gesamt", "Energiförbrukning totalt", "energia pobrana (sumarycznie)", "energiforbruk totalt", "consommation totale énergie", "") -MAKE_TRANSLATION(nrgConsCompTotal, "nrgconscomptotal", "total energy consumption compressor", "Energieverbrauch Kompressor gesamt", "Energieverbruik compressor totaal", "Energiförbrukning kompressor", "energia pobrana przez sprężarkę", "energiforbruk kompressor", "consommation totale énergie compresseur", "") -MAKE_TRANSLATION(nrgConsCompHeating, "nrgconscompheating", "energy consumption compressor heating", "Energieverbrauch Kompressor heizen", "Energieverbruik compressor verwarmingsbedrijf", "Energiförbrukning uppvärmning", "energia pobrana przez sprężarkę na ogrzewanie", "energiforbruk oppvarming", "consommation énergie compresseur chauffage", "") -MAKE_TRANSLATION(nrgConsCompWw, "nrgconscompww", "energy consumption compressor dhw", "Energieverbrauch Kompressor", "Energieverbruik compressor warmwaterbedrijf", "Energiförbrukning varmvatten", "energia pobrana przez sprężarkę na c.w.u.", "energiforbruk varmvann", "consommation énergie compresseur ecs", "") -MAKE_TRANSLATION(nrgConsCompCooling, "nrgconscompcooling", "energy consumption compressor cooling", "Energieverbrauch Kompressor kühlen", "Energieverbruik compressor koelbedrijf", "Energiförbrukning kyla", "energia pobrana przez sprężarkę na chłodzenie", "energiforbruk kjøling", "consommation énergie compresseur refroidissement", "") -MAKE_TRANSLATION(nrgConsCompPool, "nrgconscomppool", "energy consumption compressor pool", "Energieverbrauch Kompressor Pool", "Energiebedrijf compressor zwembadbedrijf", "Energiförbrukning pool", "energia pobrana przez sprężarkę na podgrzewanie basenu", "energiforbruk basseng", "consommation énergie compresseur piscine", "") -MAKE_TRANSLATION(nrgSuppTotal, "nrgsupptotal", "total energy supplied", "gesamte Energieabgabe", "Totaal opgewekte energie", "Genererad energi", "energia oddana (sumarycznie)", "tilført energi", "énergie totale fournie", "") -MAKE_TRANSLATION(nrgSuppHeating, "nrgsuppheating", "total energy supplied heating", "gesamte Energieabgabe heizen", "Opgewekte energie verwarmingsbedrijf", "Genererad energi Uppvärmning", "energia oddana na ogrzewanie", "tilført energi oppvarming", "énergie totale fournie chauffage", "") -MAKE_TRANSLATION(nrgSuppWw, "nrgsuppww", "total energy warm supplied dhw", "gesamte Energieabgabe", "Opgewekte energie warmwaterbedrijf", "Genererad energi Varmvatten", "energia oddana na c.w.u.", "tilført energi varmvann", "énergie chaude totale fournie ecs", "") -MAKE_TRANSLATION(nrgSuppCooling, "nrgsuppcooling", "total energy supplied cooling", "gesamte Energieabgabe kühlen", "Opgewekte energie koelbedrijf", "Genererad energi Kyla", "energia oddana na chłodzenie", "Tillført energi kjøling", "énergie totale fournie refroidissement", "") -MAKE_TRANSLATION(nrgSuppPool, "nrgsupppool", "total energy supplied pool", "gesamte Energieabgabe Pool", "Opgewekte energie zwembadbedrijf", "Genererad energi Pool", "energia oddana na podgrzewanie basenu", "tilført energi basseng", "énergie totale fournie piscine", "") -MAKE_TRANSLATION(auxElecHeatNrgConsTotal, "auxelecheatnrgconstotal", "total aux elec. heater energy consumption", "Energieverbrauch el. Zusatzheizung", "Totaal energieverbruik electrisch verwarmingselement", "Energiförbrukning Eltillkott", "energia pobrana przez grzałki", "energiforbruk varmekolbe", "consommation totale énergie electrique auxiliaire chauffage", "") -MAKE_TRANSLATION(auxElecHeatNrgConsHeating, "auxelecheatnrgconsheating", "aux elec. heater energy consumption heating", "Energieverbrauch el. Zusatzheizung Heizen", "Energieverbruik electrisch verwarmingselement voor verwarmingsbedrijf", "Energiförbrukning Eltillskott Uppvärmning", "energia pobrana przez grzałki na ogrzewanie", "energiforbruk varmekolbe oppvarming", "consommation énergie electrique auxiliaire chauffage", "") -MAKE_TRANSLATION(auxElecHeatNrgConsWW, "auxelecheatnrgconsww", "aux elec. heater energy consumption dhw", "Energieverbrauch el. Zusatzheizung", "Energieverbruik electrisch verwarmingselement voor warmwaterbedrijf", "Energiförbrukning Eltillskott Varmvatten", "energia pobrana przez grzałki na c.w.u.", "energiförbruk varmekolbe varmvann", "consommation énergie electrique auxiliaire chauffage ecs", "") -MAKE_TRANSLATION(auxElecHeatNrgConsPool, "auxelecheatnrgconspool", "aux elec. heater energy consumption pool", "Energieverbrauch el. Zusatzheizung Pool", "Energieverbruik electrisch verwarmingselement voor zwembadbedrijf", "Energiförbrukning Eltillskott Pool", "energia pobrana przez grzałki na podgrzewanie basenu", "energiforbruk el. tilleggsvarme basseng", "consommation énergie electrique auxiliaire chauffage piscine", "") +MAKE_TRANSLATION(upTimeControl, "uptimecontrol", "total operating time heat", "Betriebszeit Heizen gesamt", "Totale bedrijfstijd", "Total tid uppvärmning", "łączny czas generowania ciepła", "total driftstid", "durée totale de fonctionnement chauffage", "", "Tempo di funzionamento totale riscaldamento") // TODO translate +MAKE_TRANSLATION(upTimeCompHeating, "uptimecompheating", "operating time compressor heating", "Betriebszeit Kompressor heizen", "Bedrijfstijd compressor verwarmingsbedrijf", "Total tid kompressor uppvärmning", "łączny czas ogrzewania (sprężarka)", "totaltid kompressor", "durée de fonctionnement compresseur chauffage", "", "tempo di funzionamento del compressore riscaldamento") // TODO translate +MAKE_TRANSLATION(upTimeCompCooling, "uptimecompcooling", "operating time compressor cooling", "Betriebszeit Kompressor kühlen", "Bedrijfstijd compressor koelbedrijf", "Total tid kompressor kyla", "łączny czas chłodzenia (sprężarka)", "Total tid kompressor kjøling", "durée de fonctionnement compresseur refroidissement", "", "tempo di funzionamento del compressore raffreddamento") +MAKE_TRANSLATION(upTimeCompWw, "uptimecompww", "operating time compressor dhw", "Betriebszeit Kompressor", "Bedrijfstijd compressor warmwaterbedrijf", "Total tid kompressor varmvatten", "łączny czas grzania c.w.u. (sprężarka)", "Total tid kompressor varmtvann", "durée de fonctionnement compresseur ecs", "", "tempo di funzionamento del compressore") +MAKE_TRANSLATION(upTimeCompPool, "uptimecomppool", "operating time compressor pool", "Betriebszeit Kompressor Pool", "Bedrijfstijd compressor voor zwembadbedrijf", "Total tid kompressor pool", "łączny czas podgrzewania basenu (sprężarka)", "Total tid kompressor basseng", "durée de fonctionnement compresseur piscine", "", "tempo di funzionamento del compressore piscina") +MAKE_TRANSLATION(totalCompStarts, "totalcompstarts", "total compressor control starts", "Kompressor Starts gesamt", "Totaal compressorstarts", "Kompressorstarter Totalt", "liczba załączeń sprężarki", "kompressorstarter totalt", "nombre démarrages total contrôle compresseur", "", "avvii totali del compressore") +MAKE_TRANSLATION(heatingStarts, "heatingstarts", "heating control starts", "Heizen Starts", "Starts verwarmingsbedrijf", "Kompressorstarter Uppvärmning", "liczba załączeń ogrzewania", "kompressorstarter oppvarming", "démarrages contrôle chauffage", "", "avvii riscaldamento") +MAKE_TRANSLATION(coolingStarts, "coolingstarts", "cooling control starts", "Kühlen Starts", "Starts koelbedrijf", "Kompressorstarter Kyla", "liczba załączeń chłodzenia", "kompressorstarter kjøling", "démarrages contrôle refroidissement", "", "avvii raffreddamento") +MAKE_TRANSLATION(poolStarts, "poolstarts", "pool control starts", "Pool Starts", "Starts zwembadbedrijf", "Kompressorstarter Pool", "liczba załączeń podgrzewania basenu", "kompressorstarter basseng", "démarrages contrôle piscine", "", "avvio controllato piscina") +MAKE_TRANSLATION(nrgConsTotal, "nrgconstotal", "total energy consumption", "Energieverbrauch gesamt", "Energieverbrauch gesamt", "Energiförbrukning totalt", "energia pobrana (sumarycznie)", "energiforbruk totalt", "consommation totale énergie", "", "totale energia consumata") +MAKE_TRANSLATION(nrgConsCompTotal, "nrgconscomptotal", "total energy consumption compressor", "Energieverbrauch Kompressor gesamt", "Energieverbruik compressor totaal", "Energiförbrukning kompressor", "energia pobrana przez sprężarkę", "energiforbruk kompressor", "consommation totale énergie compresseur", "", "totale energia consumata compressore") +MAKE_TRANSLATION(nrgConsCompHeating, "nrgconscompheating", "energy consumption compressor heating", "Energieverbrauch Kompressor heizen", "Energieverbruik compressor verwarmingsbedrijf", "Energiförbrukning uppvärmning", "energia pobrana przez sprężarkę na ogrzewanie", "energiforbruk oppvarming", "consommation énergie compresseur chauffage", "", "consumo energia compressore riscaldamento") +MAKE_TRANSLATION(nrgConsCompWw, "nrgconscompww", "energy consumption compressor dhw", "Energieverbrauch Kompressor", "Energieverbruik compressor warmwaterbedrijf", "Energiförbrukning varmvatten", "energia pobrana przez sprężarkę na c.w.u.", "energiforbruk varmvann", "consommation énergie compresseur ecs", "", "consumo energia compressore ACS") +MAKE_TRANSLATION(nrgConsCompCooling, "nrgconscompcooling", "energy consumption compressor cooling", "Energieverbrauch Kompressor kühlen", "Energieverbruik compressor koelbedrijf", "Energiförbrukning kyla", "energia pobrana przez sprężarkę na chłodzenie", "energiforbruk kjøling", "consommation énergie compresseur refroidissement", "", "consumo energia compressore raffreddamento") +MAKE_TRANSLATION(nrgConsCompPool, "nrgconscomppool", "energy consumption compressor pool", "Energieverbrauch Kompressor Pool", "Energiebedrijf compressor zwembadbedrijf", "Energiförbrukning pool", "energia pobrana przez sprężarkę na podgrzewanie basenu", "energiforbruk basseng", "consommation énergie compresseur piscine", "", "consumo energia compressore piscina") +MAKE_TRANSLATION(nrgSuppTotal, "nrgsupptotal", "total energy supplied", "gesamte Energieabgabe", "Totaal opgewekte energie", "Genererad energi", "energia oddana (sumarycznie)", "tilført energi", "énergie totale fournie", "", "totale energia fornita") +MAKE_TRANSLATION(nrgSuppHeating, "nrgsuppheating", "total energy supplied heating", "gesamte Energieabgabe heizen", "Opgewekte energie verwarmingsbedrijf", "Genererad energi Uppvärmning", "energia oddana na ogrzewanie", "tilført energi oppvarming", "énergie totale fournie chauffage", "", "energia totale fornita - riscaldamento") +MAKE_TRANSLATION(nrgSuppWw, "nrgsuppww", "total energy warm supplied dhw", "gesamte Energieabgabe", "Opgewekte energie warmwaterbedrijf", "Genererad energi Varmvatten", "energia oddana na c.w.u.", "tilført energi varmvann", "énergie chaude totale fournie ecs", "", "totale energia calorica fornita ACS") +MAKE_TRANSLATION(nrgSuppCooling, "nrgsuppcooling", "total energy supplied cooling", "gesamte Energieabgabe kühlen", "Opgewekte energie koelbedrijf", "Genererad energi Kyla", "energia oddana na chłodzenie", "Tillført energi kjøling", "énergie totale fournie refroidissement", "", "energia totale fornita - raffreddamento") +MAKE_TRANSLATION(nrgSuppPool, "nrgsupppool", "total energy supplied pool", "gesamte Energieabgabe Pool", "Opgewekte energie zwembadbedrijf", "Genererad energi Pool", "energia oddana na podgrzewanie basenu", "tilført energi basseng", "énergie totale fournie piscine", "", "totale di energia fornita- piscina") +MAKE_TRANSLATION(auxElecHeatNrgConsTotal, "auxelecheatnrgconstotal", "total aux elec. heater energy consumption", "Energieverbrauch el. Zusatzheizung", "Totaal energieverbruik electrisch verwarmingselement", "Energiförbrukning Eltillkott", "energia pobrana przez grzałki", "energiforbruk varmekolbe", "consommation totale énergie electrique auxiliaire chauffage", "", "consumo energetico riscaldamento elettrico supplementare") +MAKE_TRANSLATION(auxElecHeatNrgConsHeating, "auxelecheatnrgconsheating", "aux elec. heater energy consumption heating", "Energieverbrauch el. Zusatzheizung Heizen", "Energieverbruik electrisch verwarmingselement voor verwarmingsbedrijf", "Energiförbrukning Eltillskott Uppvärmning", "energia pobrana przez grzałki na ogrzewanie", "energiforbruk varmekolbe oppvarming", "consommation énergie electrique auxiliaire chauffage", "", "consumo di energia riscaldamento elettrico ausiliario") +MAKE_TRANSLATION(auxElecHeatNrgConsWW, "auxelecheatnrgconsww", "aux elec. heater energy consumption dhw", "Energieverbrauch el. Zusatzheizung", "Energieverbruik electrisch verwarmingselement voor warmwaterbedrijf", "Energiförbrukning Eltillskott Varmvatten", "energia pobrana przez grzałki na c.w.u.", "energiförbruk varmekolbe varmvann", "consommation énergie electrique auxiliaire chauffage ecs", "", "consumo di energia riscaldamento elettrico ausiliario ACS") +MAKE_TRANSLATION(auxElecHeatNrgConsPool, "auxelecheatnrgconspool", "aux elec. heater energy consumption pool", "Energieverbrauch el. Zusatzheizung Pool", "Energieverbruik electrisch verwarmingselement voor zwembadbedrijf", "Energiförbrukning Eltillskott Pool", "energia pobrana przez grzałki na podgrzewanie basenu", "energiforbruk el. tilleggsvarme basseng", "consommation énergie electrique auxiliaire chauffage piscine", "", "consumo di energia riscaldamento elettrico ausiliario piscina") -MAKE_TRANSLATION(hpCompOn, "hpcompon", "hp compressor", "WP Kompressor", "WP compressor", "VP Kompressor", "sprężarka pompy ciepła", "vp kompressor", "compresseur pompe à chaleur", "") -MAKE_TRANSLATION(hpHeatingOn, "hpheatingon", "hp heating", "WP Heizen", "WP verwarmingsbedrijf", "VP Uppvärmning", "pompa ciepła, ogrzewanie", "vp oppvarmning", "chauffe pompe à chaleur", "") -MAKE_TRANSLATION(hpCoolingOn, "hpcoolingon", "hp cooling", "WP Kühlen", "WP koelbedrijf", "VP Kyla", "pompa ciepła, chłodzenie", "vp kjøling", "refroidissement pompe à chaleur", "") -MAKE_TRANSLATION(hpWwOn, "hpwwon", "hp dhw", "WP Warmwasser", "WP warmwaterbedrijf", "VP Varmvatten", "pompa ciepła, c.w.u.", "vp varmvatten", "eau chaude pompe à chaleur", "") -MAKE_TRANSLATION(hpPoolOn, "hppoolon", "hp pool", "WP Pool", "WP zwembadbedrijf", "VP Pool", "pompa ciepła, podgrzewanie basenu", "vp basseng", "pompe à chaleur piscine", "") -MAKE_TRANSLATION(hpBrinePumpSpd, "hpbrinepumpspd", "brine pump speed", "Solepumpen-Geschw.", "Snelheid pekelpomp", "Hastighet Brine-pump", "wysterowanie pompy glikolu", "hastighet brine-pumpe", "vitesse pompe à saumure", "") -MAKE_TRANSLATION(hpCompSpd, "hpcompspd", "compressor speed", "Kompressor-Geschw.", "Snelheid compressor", "Kompressorhastighet", "wysterowanie sprężarki", "kompressorhastighet", "vitesse du compresseur", "") -MAKE_TRANSLATION(hpCircSpd, "hpcircspd", "circulation pump speed", "Zirkulationspumpen-Geschw.", "Snelheid circulatiepomp", "Hastighet Cirkulationspump", "wysterowanie pompy obiegu grzewczego", "hastighet sirkulationspumpe", "vitesse pompe à circulation", "") -MAKE_TRANSLATION(hpBrineIn, "hpbrinein", "brine in/evaporator", "Sole in/Verdampfer", "pekel in/verdamper", "Brine in (förangare)", "temperatura glikolu na wejściu kolektora (TB0)", "brine in/fordamper", "entrée saumure/évaporateur", "") -MAKE_TRANSLATION(hpBrineOut, "hpbrineout", "brine out/condenser", "Sole aus/Kondensator", "pekel uit/condensor", "Brine ut (kondensor)", "temperatura glikolu na wyjściu kolektora (TB1)", "Brine ut/kondensor", "sortie saumure/condenseur", "") -MAKE_TRANSLATION(hpSwitchValve, "hpswitchvalve", "switch valve", "Schaltventil", "schakelklep", "Växelventil", "zawór przełączający", "skifteventil", "valve de commutation", "") -MAKE_TRANSLATION(hpActivity, "hpactivity", "compressor activity", "Kompressoraktivität", "Compressoractiviteit", "Kompressoraktivitet", "pompa ciepła, aktywność sprężarki", "kompressoraktivitet", "activité du compresseur", "") // TODO translate +MAKE_TRANSLATION(hpCompOn, "hpcompon", "hp compressor", "WP Kompressor", "WP compressor", "VP Kompressor", "sprężarka pompy ciepła", "vp kompressor", "compresseur pompe à chaleur", "", "compressore pompa calore") +MAKE_TRANSLATION(hpHeatingOn, "hpheatingon", "hp heating", "WP Heizen", "WP verwarmingsbedrijf", "VP Uppvärmning", "pompa ciepła, ogrzewanie", "vp oppvarmning", "chauffe pompe à chaleur", "riscaldamento pompa calore") +MAKE_TRANSLATION(hpCoolingOn, "hpcoolingon", "hp cooling", "WP Kühlen", "WP koelbedrijf", "VP Kyla", "pompa ciepła, chłodzenie", "vp kjøling", "refroidissement pompe à chaleur", "raffreddamento pompa calore") +MAKE_TRANSLATION(hpWwOn, "hpwwon", "hp dhw", "WP Warmwasser", "WP warmwaterbedrijf", "VP Varmvatten", "pompa ciepła, c.w.u.", "vp varmvatten", "eau chaude pompe à chaleur", "acqua calda pompa calore") +MAKE_TRANSLATION(hpPoolOn, "hppoolon", "hp pool", "WP Pool", "WP zwembadbedrijf", "VP Pool", "pompa ciepła, podgrzewanie basenu", "vp basseng", "pompe à chaleur piscine", "pompa calore piscina") +MAKE_TRANSLATION(hpBrinePumpSpd, "hpbrinepumpspd", "brine pump speed", "Solepumpen-Geschw.", "Snelheid pekelpomp", "Hastighet Brine-pump", "wysterowanie pompy glikolu", "hastighet brine-pumpe", "vitesse pompe à saumure", "", "velocità pompa sbrinamento") +MAKE_TRANSLATION(hpCompSpd, "hpcompspd", "compressor speed", "Kompressor-Geschw.", "Snelheid compressor", "Kompressorhastighet", "wysterowanie sprężarki", "kompressorhastighet", "vitesse du compresseur", "", "velocità compressore") +MAKE_TRANSLATION(hpCircSpd, "hpcircspd", "circulation pump speed", "Zirkulationspumpen-Geschw.", "Snelheid circulatiepomp", "Hastighet Cirkulationspump", "wysterowanie pompy obiegu grzewczego", "hastighet sirkulationspumpe", "vitesse pompe à circulation", "", "velocità pompa circolazione") +MAKE_TRANSLATION(hpBrineIn, "hpbrinein", "brine in/evaporator", "Sole in/Verdampfer", "pekel in/verdamper", "Brine in (förangare)", "temperatura glikolu na wejściu kolektora (TB0)", "brine in/fordamper", "entrée saumure/évaporateur", "", "salamoia nell evaporatore") +MAKE_TRANSLATION(hpBrineOut, "hpbrineout", "brine out/condenser", "Sole aus/Kondensator", "pekel uit/condensor", "Brine ut (kondensor)", "temperatura glikolu na wyjściu kolektora (TB1)", "Brine ut/kondensor", "sortie saumure/condenseur", "", "salamoia nell uscita evaporatore") +MAKE_TRANSLATION(hpSwitchValve, "hpswitchvalve", "switch valve", "Schaltventil", "schakelklep", "Växelventil", "zawór przełączający", "skifteventil", "valve de commutation", "", "valvola commutazione pompa di calore") +MAKE_TRANSLATION(hpActivity, "hpactivity", "compressor activity", "Kompressoraktivität", "Compressoractiviteit", "Kompressoraktivitet", "pompa ciepła, aktywność sprężarki", "kompressoraktivitet", "activité du compresseur", "attività compressore") // TODO translate -MAKE_TRANSLATION(hpPower, "hppower", "compressor power output", "Kompressorleistung", "Compressorvermogen", "Kompressoreffekt", "moc wyjściowa sprężarki", "kompressoreffekt", "puissance de sortie compresseur", "") -MAKE_TRANSLATION(hpTc0, "hptc0", "heat carrier return (TC0)", "Kältemittel Rücklauf (TC0)", "Koudemiddel retour (TC0)", "Värmebärare Retur (TC0)", "temperatura nośnika ciepła na powrocie (TC0)", "kjølemiddel retur (TC0)", "retour caloporteur (TC0)", "") -MAKE_TRANSLATION(hpTc1, "hptc1", "heat carrier forward (TC1)", "Kältemittel Vorlauf (TC1)", "Koudemiddel aanvoer (TC1)", "Värmebärare Framledning (TC1)", "temperatura nośnika ciepła pierwotna (TC1)", "kjølemiddel tur (TC1)", "avance caloporteur (TC1)", "") -MAKE_TRANSLATION(hpTc3, "hptc3", "condenser temperature (TC3)", "Verflüssigertemperatur (TC3)", "Condensortemperatuur (TC3)", "Kondensortemperatur (TC3)", "temperatura skraplacza/na wyjściu sprężarki (TC3)", "kondensortemperatur (TC3)", "température condensateur (TC3)", "") -MAKE_TRANSLATION(hpTr1, "hptr1", "compressor temperature (TR1)", "Kompessortemperatur (TR1)", "Compressor temperatuur (TR1)", "Kompressor temp (TR1)", "temperatura sprężarki (TR1)", "kompressor temperatur (TR1)", "température compresseur (TR1)", "") -MAKE_TRANSLATION(hpTr3, "hptr3", "refrigerant temperature liquid side (condenser output) (TR3)", "Kältemittel (flüssig) (TR3)", "Temperatuur koudemiddel vloeibare zijde (TR3)", "Köldmedium temperatur (kondensorutlopp) (TR3)", "temperatura skraplacza ogrzew. (TR3)", "kjølemiddeltemperatur på væskesiden (TR3)", "température réfrigérant côté liquide (sortie condensateur) (TR3)", "") -MAKE_TRANSLATION(hpTr4, "hptr4", "evaporator inlet temperature (TR4)", "Verdampfer Eingang (TR4)", "Verdamper ingangstemperatuur (TR4)", "Förångare inloppstemp (TR4)", "temperatura na wejściu parownika (TR4)", "innløpstemperatur for fordamperen (TR4)", "température entrée évaporateur (TR4)", "") -MAKE_TRANSLATION(hpTr5, "hptr5", "compressor inlet temperature (TR5)", "Kompessoreingang (TR5)", "Compressor ingangstemperatuur (TR5)", "Kompressor inloppstemp (TR5)", "temperatura na wejściu sprężarki (TR5)", "kompressor innløpstemp (TR5)", "température entrée compresseur (TR5)", "") -MAKE_TRANSLATION(hpTr6, "hptr6", "compressor outlet temperature (TR6)", "Kompressorausgang (TR6)", "Compressor uitgangstemperatuur (TR6)", "Kompressor utloppstemp (TR6)", "temperatura na wyjściu sprężarki (TR6)", "kompressor utløpstemp (TR6)", "température sortie compresseur (TR6)", "") -MAKE_TRANSLATION(hpTr7, "hptr7", "refrigerant temperature gas side (condenser input) (TR7)", "Kältemittel (gasförmig) (TR7)", "Temperatuur koudemiddel gasvormig (TR7)", "Köldmedium temperatur gassida (kondensorinlopp) (TR7)", "temperatura czynnika chłodniczego po stronie gazu (wejście skraplacza) (TR7)", "kjølemedium temperatur gassida (kondensatorinløp) (TR7)", "température réfrigérant côté gaz (sortie condensateur) (TR7)", "") -MAKE_TRANSLATION(hpTl2, "hptl2", "air inlet temperature (TL2)", "Außenluft-Einlasstemperatur (TL2)", "Temperatuur luchtinlaat (TL2)", "Luftintagstemperatur (TL2)", "temperatura wlotu powietrza (TL2)", "luftinntakstemperatur (TL2)", "température entrée air (TL2)", "") -MAKE_TRANSLATION(hpPl1, "hppl1", "low pressure side temperature (PL1)", "Niederdruckfühler (PL1)", "Temperatuur lage drukzijde (PL1)", "Temperatur Lågtryckssidan (PL1)", "temperatura po stronie niskiego ciśnienia (PL1)", "temperatur lavtrykksiden (PL1)", "température côté basse pression (PL1)", "") -MAKE_TRANSLATION(hpPh1, "hpph1", "high pressure side temperature (PH1)", "Hochdruckfühler (PH1)", "Temperatuur hoge drukzijde (PH1)", "Temperatur Högtryckssidan (PH1)", "temperatura po stronie wysokiego ciśnienia (PH1)", "Temperatur Høytrykksiden (PH1)", "température côté bhauteasse pression (PH1)", "") -MAKE_TRANSLATION(hpTa4, "hpta4", "drain pan temp (TA4)", "Kondensatorwanne (TA4)", "", "", "temperatura ociekacza (TA4)", "kondens temperatur", "", "") // TODO translate +MAKE_TRANSLATION(hpPower, "hppower", "compressor power output", "Kompressorleistung", "Compressorvermogen", "Kompressoreffekt", "moc wyjściowa sprężarki", "kompressoreffekt", "puissance de sortie compresseur", "", "potenza uscita compressore") +MAKE_TRANSLATION(hpTc0, "hptc0", "heat carrier return (TC0)", "Kältemittel Rücklauf (TC0)", "Koudemiddel retour (TC0)", "Värmebärare Retur (TC0)", "temperatura nośnika ciepła na powrocie (TC0)", "kjølemiddel retur (TC0)", "retour caloporteur (TC0)", "", "ritorno del refrigerante (TC0)") +MAKE_TRANSLATION(hpTc1, "hptc1", "heat carrier forward (TC1)", "Kältemittel Vorlauf (TC1)", "Koudemiddel aanvoer (TC1)", "Värmebärare Framledning (TC1)", "temperatura nośnika ciepła pierwotna (TC1)", "kjølemiddel tur (TC1)", "avance caloporteur (TC1)", "", "flusso di refrigerante (TC1)") +MAKE_TRANSLATION(hpTc3, "hptc3", "condenser temperature (TC3)", "Verflüssigertemperatur (TC3)", "Condensortemperatuur (TC3)", "Kondensortemperatur (TC3)", "temperatura skraplacza/na wyjściu sprężarki (TC3)", "kondensortemperatur (TC3)", "température condensateur (TC3)", "", "temperatura condensatore (TC3)") +MAKE_TRANSLATION(hpTr1, "hptr1", "compressor temperature (TR1)", "Kompessortemperatur (TR1)", "Compressor temperatuur (TR1)", "Kompressor temp (TR1)", "temperatura sprężarki (TR1)", "kompressor temperatur (TR1)", "température compresseur (TR1)", "", "temperatura compressore (TR1)") +MAKE_TRANSLATION(hpTr3, "hptr3", "refrigerant temperature liquid side (condenser output) (TR3)", "Kältemittel (flüssig) (TR3)", "Temperatuur koudemiddel vloeibare zijde (TR3)", "Köldmedium temperatur (kondensorutlopp) (TR3)", "temperatura skraplacza ogrzew. (TR3)", "kjølemiddeltemperatur på væskesiden (TR3)", "température réfrigérant côté liquide (sortie condensateur) (TR3)", "", "temperatura refrigerante lato liquido (uscita condensatore) (TR3)") +MAKE_TRANSLATION(hpTr4, "hptr4", "evaporator inlet temperature (TR4)", "Verdampfer Eingang (TR4)", "Verdamper ingangstemperatuur (TR4)", "Förångare inloppstemp (TR4)", "temperatura na wejściu parownika (TR4)", "innløpstemperatur for fordamperen (TR4)", "température entrée évaporateur (TR4)", "", "temperatura di ingresso dell'evaporatore (TR4)") +MAKE_TRANSLATION(hpTr5, "hptr5", "compressor inlet temperature (TR5)", "Kompessoreingang (TR5)", "Compressor ingangstemperatuur (TR5)", "Kompressor inloppstemp (TR5)", "temperatura na wejściu sprężarki (TR5)", "kompressor innløpstemp (TR5)", "température entrée compresseur (TR5)", "", "temperatura di ingresso del compressore (TR5)") +MAKE_TRANSLATION(hpTr6, "hptr6", "compressor outlet temperature (TR6)", "Kompressorausgang (TR6)", "Compressor uitgangstemperatuur (TR6)", "Kompressor utloppstemp (TR6)", "temperatura na wyjściu sprężarki (TR6)", "kompressor utløpstemp (TR6)", "température sortie compresseur (TR6)", "", "temperatura di uscita del compressore (TR6)") +MAKE_TRANSLATION(hpTr7, "hptr7", "refrigerant temperature gas side (condenser input) (TR7)", "Kältemittel (gasförmig) (TR7)", "Temperatuur koudemiddel gasvormig (TR7)", "Köldmedium temperatur gassida (kondensorinlopp) (TR7)", "temperatura czynnika chłodniczego po stronie gazu (wejście skraplacza) (TR7)", "kjølemedium temperatur gassida (kondensatorinløp) (TR7)", "température réfrigérant côté gaz (sortie condensateur) (TR7)", "", "temperatura refrigerante lato gas (ingresso condensatore) (TR7)") +MAKE_TRANSLATION(hpTl2, "hptl2", "air inlet temperature (TL2)", "Außenluft-Einlasstemperatur (TL2)", "Temperatuur luchtinlaat (TL2)", "Luftintagstemperatur (TL2)", "temperatura wlotu powietrza (TL2)", "luftinntakstemperatur (TL2)", "température entrée air (TL2)", "", "temperatura ingresso aria (TL2)") +MAKE_TRANSLATION(hpPl1, "hppl1", "low pressure side temperature (PL1)", "Niederdruckfühler (PL1)", "Temperatuur lage drukzijde (PL1)", "Temperatur Lågtryckssidan (PL1)", "temperatura po stronie niskiego ciśnienia (PL1)", "temperatur lavtrykksiden (PL1)", "température côté basse pression (PL1)", "", "temperatura lato bassa pressione (PL1)") +MAKE_TRANSLATION(hpPh1, "hpph1", "high pressure side temperature (PH1)", "Hochdruckfühler (PH1)", "Temperatuur hoge drukzijde (PH1)", "Temperatur Högtryckssidan (PH1)", "temperatura po stronie wysokiego ciśnienia (PH1)", "Temperatur Høytrykksiden (PH1)", "température côté bhauteasse pression (PH1)", "", "temperatura lato alta pressione (PH1)") +MAKE_TRANSLATION(hpTa4, "hpta4", "drain pan temp (TA4)", "Kondensatorwanne (TA4)", "", "", "temperatura ociekacza (TA4)", "kondens temperatur", "", "", "temperatura condensatore (TA4)") // TODO translate -MAKE_TRANSLATION(hpInput1, "hpin1", "input 1 state", "Eingang 1 Status", "Status input 1", "Status Ingång 1", "stan wejścia 1", "status inggang 1", "état entrée 1", "") -MAKE_TRANSLATION(hpInput2, "hpin2", "input 2 state", "Eingang 2 Status", "Status input 2", "Status Ingång 2", "stan wejścia 2", "status inggang 2", "état entrée 2", "") -MAKE_TRANSLATION(hpInput3, "hpin3", "input 3 state", "Eingang 3 Status", "Status input 3", "Status Ingång 3", "stan wejścia 3", "status inggang 3", "état entrée 3", "") -MAKE_TRANSLATION(hpInput4, "hpin4", "input 4 state", "Eingang 4 Status", "Status input 4", "Status Ingång 4", "stan wejścia 4", "status inggang 4", "état entrée 4", "") -MAKE_TRANSLATION(hpIn1Opt, "hpin1opt", "input 1 options", "Eingang 1 Einstellung", "Instelling input 1", "Inställningar Ingång 1", "opcje wejścia 1", "innstillinger inngang 1", "options entrée 1", "") -MAKE_TRANSLATION(hpIn2Opt, "hpin2opt", "input 2 options", "Eingang 2 Einstellung", "Instelling input 2", "Inställningar Ingång 2", "opcje wejścia 2", "innstillinger inngang 2", "options entrée 2", "") -MAKE_TRANSLATION(hpIn3Opt, "hpin3opt", "input 3 options", "Eingang 3 Einstellung", "Instelling input 3", "Inställningar Ingång 3", "opcje wejścia 3", "innstillinger inngang 3", "options entrée 3", "") -MAKE_TRANSLATION(hpIn4Opt, "hpin4opt", "input 4 options", "Eingang 4 Einstellung", "Instelling input 4", "Inställningar Ingång 4", "opcje wejścia 4", "innstillinger inngang 4", "options entrée 4", "") -MAKE_TRANSLATION(maxHeatComp, "maxheatcomp", "heat limit compressor", "Heizgrenze Kompressor", "heat limit compressor", "heat limit compressor", "ograniczenie mocy sprężarki", "max varmegrense kompressor", "limite chaleur compresseur", "") -MAKE_TRANSLATION(maxHeatHeat, "maxheatheat", "heat limit heating", "Heizgrenze Heizen", "heat limit heating", "heat limit heating", "ograniczenie mocy w trybie ogrzewania", "maks varmegrense oppvarming", "limite chaleur chauffage", "") -MAKE_TRANSLATION(maxHeatDhw, "maxheatdhw", "heat limit dhw", "Heizgrenze Warmwasser", "heat limit dhw", "heat limit dhw", "ograniczenie mocy w trybie c.w.u.", "varmegrense varmtvann", "limite chaleur ecs", "") +MAKE_TRANSLATION(hpInput1, "hpin1", "input 1 state", "Eingang 1 Status", "Status input 1", "Status Ingång 1", "stan wejścia 1", "status inggang 1", "état entrée 1", "", "stato ingresso 1") +MAKE_TRANSLATION(hpInput2, "hpin2", "input 2 state", "Eingang 2 Status", "Status input 2", "Status Ingång 2", "stan wejścia 2", "status inggang 2", "état entrée 2", "", "stato ingresso 2") +MAKE_TRANSLATION(hpInput3, "hpin3", "input 3 state", "Eingang 3 Status", "Status input 3", "Status Ingång 3", "stan wejścia 3", "status inggang 3", "état entrée 3", "", "stato ingresso 3") +MAKE_TRANSLATION(hpInput4, "hpin4", "input 4 state", "Eingang 4 Status", "Status input 4", "Status Ingång 4", "stan wejścia 4", "status inggang 4", "état entrée 4", "", "stato ingresso 4") +MAKE_TRANSLATION(hpIn1Opt, "hpin1opt", "input 1 options", "Eingang 1 Einstellung", "Instelling input 1", "Inställningar Ingång 1", "opcje wejścia 1", "innstillinger inngang 1", "options entrée 1", "", "impostazioni ingresso 1") +MAKE_TRANSLATION(hpIn2Opt, "hpin2opt", "input 2 options", "Eingang 2 Einstellung", "Instelling input 2", "Inställningar Ingång 2", "opcje wejścia 2", "innstillinger inngang 2", "options entrée 2", "", "impostazioni ingresso 2") +MAKE_TRANSLATION(hpIn3Opt, "hpin3opt", "input 3 options", "Eingang 3 Einstellung", "Instelling input 3", "Inställningar Ingång 3", "opcje wejścia 3", "innstillinger inngang 3", "options entrée 3", "", "impostazioni ingresso 3") +MAKE_TRANSLATION(hpIn4Opt, "hpin4opt", "input 4 options", "Eingang 4 Einstellung", "Instelling input 4", "Inställningar Ingång 4", "opcje wejścia 4", "innstillinger inngang 4", "options entrée 4", "", "impostazioni ingresso 4") +MAKE_TRANSLATION(maxHeatComp, "maxheatcomp", "heat limit compressor", "Heizgrenze Kompressor", "heat limit compressor", "heat limit compressor", "ograniczenie mocy sprężarki", "max varmegrense kompressor", "limite chaleur compresseur", "", "limite riscaldamento compressore") +MAKE_TRANSLATION(maxHeatHeat, "maxheatheat", "heat limit heating", "Heizgrenze Heizen", "heat limit heating", "heat limit heating", "ograniczenie mocy w trybie ogrzewania", "maks varmegrense oppvarming", "limite chaleur chauffage", "", "limite calore riscaldamento") +MAKE_TRANSLATION(maxHeatDhw, "maxheatdhw", "heat limit dhw", "Heizgrenze Warmwasser", "heat limit dhw", "heat limit dhw", "ograniczenie mocy w trybie c.w.u.", "varmegrense varmtvann", "limite chaleur ecs", "", "limite calore ACS") -MAKE_TRANSLATION(auxHeaterOff, "auxheateroff", "disable aux heater", "Verbiete Zusatzheizer", "Bijverwarming uitsc", "Blockera eltillskott", "wyłącz dogrzewacz", "deaktiver tilleggsvarme", "Désactiver chauff. d'app", "") // TODO translate -MAKE_TRANSLATION(auxHeaterStatus, "auxheaterstatus", "aux heater status", "Status Zusatzheizer", "Bijverwarming", "Eltillskott Status", "status dogrzewacza", "status el. tillegsvarme", "Chauffage auxiliaire", "") // TODO translate -MAKE_TRANSLATION(auxHeaterOnly, "auxheateronly", "aux heater only", "nur Zusatzheizer","Alleen bijverwarming", "Eltillskott Enbart", "tylko dogrzewacz", "kun el tilleggsvarme", "Que chauffage auxiliaire", "") // TODO translate -MAKE_TRANSLATION(auxHeaterDelay, "auxheaterdelay", "aux heater on delay", "Zusatzheizer verzögert ein", "Bijverw. vertraagd aan", "Eltillskottfördröjning på", "opóźnienie włączenia dogrzewacza", "Tilleggsvarmer forsinket på", "Chauff app tempo marche", "") -MAKE_TRANSLATION(silentMode, "silentmode", "silent mode", "Silentmodus", " Stiller gebruik", "Tyst läge", "tryb cichy", "stille modus", "Fct silencieux", "") // TODO translate -MAKE_TRANSLATION(minTempSilent, "mintempsilent", "min outside temp for silent mode", "Minimale Aussentemperatur Silentmodus", " Stiller gebruik min. buitentemp", "Tyst läge min temp", "minimalna temperatura zewnętrzna dla trybu cichego", "atille modus min temp", "Fct silencieux: Temp. extérieure min.", "") // TODO translate -MAKE_TRANSLATION(tempParMode, "tempparmode", "outside temp parallel mode", "Aussentemperatur Parallelmodus", "Buitentemp. parallelbedr", "Parallelläge Utomhustemp.", "maksymalna temperatura zewnętrzna dla dogrzewacza", "", "Temp. ext. fct parallèle", "") // TODO translate -MAKE_TRANSLATION(auxHeatMixValve, "auxheatmix", "aux heater mixing valve", "Mischer Zusatzheizer", "Bijverwarming menger", "Eltilskott Blandarventil", "mieszacz dogrzewacza", "eltilskudd blandeventil", "Chauffage auxiliaire mélangeur", "") // TODO translate -MAKE_TRANSLATION(hpHystHeat, "hphystheat", "on/off hyst heat", "Schalthysterese Heizen", "Aan/uit-hysteresis in verw. bedrijf", "Hstereses Uppvärm.", "histereza wł./wył. ogrzewania", "På/av hysterese Oppvar.", "Hystérésis Marche en mode chauffage", "") -MAKE_TRANSLATION(hpHystCool, "hphystcool", "on/off hyst cool", "Schalthysterese Kühlen", "Aan/uit-hysteresis in koelbedrijf ", "Hystereses Kyla", "histereza wł./wył. chłodzenia", "hystrese kjøling", "Hystérésis Marche en mode refroidissement", "") // TODO translate -MAKE_TRANSLATION(hpHystPool, "hphystpool", "on/off hyst pool", "Schalthysterese Pool", "an/uit-hysteresis in zwembadbedri", "Hystereses Pool", "histereza wł./wył. podgrzewania basenu", "hystrese basseng", "Hystérésis Marche en mode piscine", "") // TODO translate -MAKE_TRANSLATION(tempDiffHeat, "tempdiffheat", "temp diff TC3/TC0 heat", "Temp.diff. TC3/TC0 Heizen", "Temp.vers. TC3/TC0 verw", "Delta(T) TC3/TC0 Uppvärm.", "różnica temperatur TC3/TC0 w trakcie ogrzewania", "temp. diff. TC3/TC0 oppvarm", "Delta T TC3/TC0 Chauff", "") // TODO translate -MAKE_TRANSLATION(tempDiffCool, "tempdiffcool", "temp diff TC3/TC0 cool", "Temp.diff. TC3/TC0 Kühlen", "Temp.vers. TC3/TC0 koel.", "Delta(T) TC3/TC0 Kyla", "różnica temperatur TC3/TC0 w trakcie chłodzenia", "temp. diff. TC3/TC0 kjøling", "Delta T TC3/TC0 Refroid.", "") // TODO translate -MAKE_TRANSLATION(silentFrom, "silentfrom", "silent mode from", "Silentmodus Start", "", "", "początek trybu cichego", "stillemodus starter", "", "") // TODO translate -MAKE_TRANSLATION(silentTo, "silentto", "silent mode to", "Silentmodus Ende", "", "", "koniec trybu cichego", "komfortmodus av", "", "") // TODO translate +MAKE_TRANSLATION(auxHeaterOff, "auxheateroff", "disable aux heater", "Verbiete Zusatzheizer", "Bijverwarming uitsc", "Blockera eltillskott", "wyłącz dogrzewacz", "deaktiver tilleggsvarme", "Désactiver chauff. d'app", "", "disattivare i riscaldatori addizionali") +MAKE_TRANSLATION(auxHeaterStatus, "auxheaterstatus", "aux heater status", "Status Zusatzheizer", "Bijverwarming", "Eltillskott Status", "status dogrzewacza", "status el. tillegsvarme", "Chauffage auxiliaire", "", "stato riscaldatori addizionali") +MAKE_TRANSLATION(auxHeaterOnly, "auxheateronly", "aux heater only", "nur Zusatzheizer","Alleen bijverwarming", "Eltillskott Enbart", "tylko dogrzewacz", "kun el tilleggsvarme", "Que chauffage auxiliaire", "","solo riscaldatori addizionali") +MAKE_TRANSLATION(auxHeaterDelay, "auxheaterdelay", "aux heater on delay", "Zusatzheizer verzögert ein", "Bijverw. vertraagd aan", "Eltillskottfördröjning på", "opóźnienie włączenia dogrzewacza", "Tilleggsvarmer forsinket på", "Chauff app tempo marche", "", "ritardo riscaldatori addizionali") +MAKE_TRANSLATION(silentMode, "silentmode", "silent mode", "Silentmodus", " Stiller gebruik", "Tyst läge", "tryb cichy", "stille modus", "Fct silencieux", "", "modalità silenziosa") +MAKE_TRANSLATION(minTempSilent, "mintempsilent", "min outside temp for silent mode", "Minimale Aussentemperatur Silentmodus", " Stiller gebruik min. buitentemp", "Tyst läge min temp", "minimalna temperatura zewnętrzna dla trybu cichego", "atille modus min temp", "Fct silencieux: Temp. extérieure min.", "", "modalità silenziosa temperatura esterna minima") +MAKE_TRANSLATION(tempParMode, "tempparmode", "outside temp parallel mode", "Aussentemperatur Parallelmodus", "Buitentemp. parallelbedr", "Parallelläge Utomhustemp.", "maksymalna temperatura zewnętrzna dla dogrzewacza", "", "Temp. ext. fct parallèle", "", "modalità parallela temperatura esterna") // TODO translate +MAKE_TRANSLATION(auxHeatMixValve, "auxheatmix", "aux heater mixing valve", "Mischer Zusatzheizer", "Bijverwarming menger", "Eltilskott Blandarventil", "mieszacz dogrzewacza", "eltilskudd blandeventil", "Chauffage auxiliaire mélangeur", "", "miscela riscaldatori addizionali") +MAKE_TRANSLATION(hpHystHeat, "hphystheat", "on/off hyst heat", "Schalthysterese Heizen", "Aan/uit-hysteresis in verw. bedrijf", "Hstereses Uppvärm.", "histereza wł./wył. ogrzewania", "På/av hysterese Oppvar.", "Hystérésis Marche en mode chauffage", "", "isteresi di commutazione riscaldamento") +MAKE_TRANSLATION(hpHystCool, "hphystcool", "on/off hyst cool", "Schalthysterese Kühlen", "Aan/uit-hysteresis in koelbedrijf ", "Hystereses Kyla", "histereza wł./wył. chłodzenia", "hystrese kjøling", "Hystérésis Marche en mode refroidissement", "", "isteresi di commutazione raffreddamento") +MAKE_TRANSLATION(hpHystPool, "hphystpool", "on/off hyst pool", "Schalthysterese Pool", "an/uit-hysteresis in zwembadbedri", "Hystereses Pool", "histereza wł./wył. podgrzewania basenu", "hystrese basseng", "Hystérésis Marche en mode piscine", "", "isteresi di commutazione piscina") +MAKE_TRANSLATION(tempDiffHeat, "tempdiffheat", "temp diff TC3/TC0 heat", "Temp.diff. TC3/TC0 Heizen", "Temp.vers. TC3/TC0 verw", "Delta(T) TC3/TC0 Uppvärm.", "różnica temperatur TC3/TC0 w trakcie ogrzewania", "temp. diff. TC3/TC0 oppvarm", "Delta T TC3/TC0 Chauff", "", "Delta T riscaldamento TC3/TC0") +MAKE_TRANSLATION(tempDiffCool, "tempdiffcool", "temp diff TC3/TC0 cool", "Temp.diff. TC3/TC0 Kühlen", "Temp.vers. TC3/TC0 koel.", "Delta(T) TC3/TC0 Kyla", "różnica temperatur TC3/TC0 w trakcie chłodzenia", "temp. diff. TC3/TC0 kjøling", "Delta T TC3/TC0 Refroid.", "", "Delta T raffreddamento TC3/TC0") +MAKE_TRANSLATION(silentFrom, "silentfrom", "silent mode from", "Silentmodus Start", "", "", "początek trybu cichego", "stillemodus starter", "", "", "avvio della modalità silenziosa") // TODO translate +MAKE_TRANSLATION(silentTo, "silentto", "silent mode to", "Silentmodus Ende", "", "", "koniec trybu cichego", "komfortmodus av", "", "", "spegnere modalità silenziosa") // TODO translate -MAKE_TRANSLATION(wwComfOffTemp, "wwcomfoff", "comfort switch off", "Komfort Ausschalttemp", "Comfort Uitschakeltemp.", "Komfortläge avstängingstemp.", "temperatura wyłączania w trybie komfort", "eco modus utkoblingstem", "Confort Temp. d'arrêt", "") // TODO translate -MAKE_TRANSLATION(wwEcoOffTemp, "wwecooff", "eco switch off", "ECO Ausschalttemp", "Eco Uitschakeltemp.", "Ekoläge avstängningstemp.", "temperatura wyłączania w trybie eko", "Øko avstengningstemp.", "Eco Temp. d'arrêt", "") // TODO translate -MAKE_TRANSLATION(wwEcoPlusOffTemp, "wwecoplusoff", "eco+ switch off", "ECO+ Ausschalttemp", "Eco+ Uitschakeltemp.", "Eko+ avstängningstemp.", "temperatura wyłączania w trybie eko+", "Øko+ avstengningstemp.", "Eco+ Temp. d'arrêt", "") // TODO translate +MAKE_TRANSLATION(wwComfOffTemp, "wwcomfoff", "comfort switch off", "Komfort Ausschalttemp", "Comfort Uitschakeltemp.", "Komfortläge avstängingstemp.", "temperatura wyłączania w trybie komfort", "eco modus utkoblingstem", "Confort Temp. d'arrêt", "", "spegnimento modalità comfort") // TODO translate +MAKE_TRANSLATION(wwEcoOffTemp, "wwecooff", "eco switch off", "ECO Ausschalttemp", "Eco Uitschakeltemp.", "Ekoläge avstängningstemp.", "temperatura wyłączania w trybie eko", "Øko avstengningstemp.", "Eco Temp. d'arrêt", "", "spegnimento modalità ECO") // TODO translate +MAKE_TRANSLATION(wwEcoPlusOffTemp, "wwecoplusoff", "eco+ switch off", "ECO+ Ausschalttemp", "Eco+ Uitschakeltemp.", "Eko+ avstängningstemp.", "temperatura wyłączania w trybie eko+", "Øko+ avstengningstemp.", "Eco+ Temp. d'arrêt", "", "spegnimento modalità ECO+") // TODO translate -MAKE_TRANSLATION(auxHeatMode, "auxheatrmode", "aux heater mode", "Modus Zusatzheizer", "", "", "tryb pracy dogrzewacza po blokadzie z Zakładu Energetycznego", "tilleggsvarmer modus", "", "") // TODO translate -MAKE_TRANSLATION(auxMaxLimit, "auxmaxlimit", "aux heater max limit", "Zusatzheizer max. Grenze", "", "", "dogrzewacz, maksymalny limit", "tillegsvarme maksgrense", "", "") // TODO translate -MAKE_TRANSLATION(auxLimitStart, "auxlimitstart", "aux heater limit start", "Zusatzheizer Grenze Start", "", "", "dogrzewacz, początek ograniczenia", "tillegsvarme startgrense", "", "") // TODO translate -MAKE_TRANSLATION(manDefrost, "mandefrost", "manual defrost", "Manuelle Enteisung", "", "", "ręczne odladzanie", "manuell avisning", "", "") // TODO translate -MAKE_TRANSLATION(pvCooling, "pvcooling", "Cooling only with PV", "Kühlen nur mit PV", "", "", "chłodzenie tylko z PV", "kjøling med solpanel", "", "") // TODO translate -MAKE_TRANSLATION(hpCircPumpWw, "hpcircpumpww", "circulation pump available during dhw", "", "", "", "pompa cyrkulacji dostępna w trakcie c.w.u.", "sirkulasjonspumpe tilgjengelig under varmtvann", "", "") // TODO translate -MAKE_TRANSLATION(vp_cooling, "vpcooling", "valve/pump cooling", "", "", "", "zawór/pompa chłodzenia", "varmepumpe kjøling", "", "") // TODO translate -MAKE_TRANSLATION(VC0valve, "vc0valve", "VC0 valve", "VC0 Ventil", "", "", "zawór VC0", "vc0 ventil", "", "") // TODO translate -MAKE_TRANSLATION(primePump, "primepump", "primary heatpump", "Hauptpumpe", "", "", "główna pompa ciepła", "primærpumpe", "", "") // TODO translate -MAKE_TRANSLATION(primePumpMod, "primepumpmod", "primary heatpump modulation", "Modulation Hauptpumpe", "", "", "wysterowanie głównej pompy ciepła", "primærpumpelast", "", "") // TODO translate -MAKE_TRANSLATION(hp3wayValve, "hp3way", "3-way valve", "3-Wege-Ventil", "", "", "zawór 3-drogowy pompy ciepła", "3-veisventil", "", "") // TODO translate -MAKE_TRANSLATION(elHeatStep1, "elheatstep1", "el. heater step 1", "El. Heizer Stufe 1", "", "", "dogrzewacz poziom 1", "el-kolbe steg 1", "", "") // TODO translate -MAKE_TRANSLATION(elHeatStep2, "elheatstep2", "el. heater step 2", "El. Heizer Stufe 2", "", "", "dogrzewacz poziom 2", "el-kolbe steg 2", "", "") // TODO translate -MAKE_TRANSLATION(elHeatStep3, "elheatstep3", "el. heater step 3", "El. Heizer Stufe 3", "", "", "dogrzewacz poziom 3", "el-kolbe steg 3", "", "") // TODO translate -MAKE_TRANSLATION(wwAlternatingOper, "wwalternatingop", "alternating operation", "Wechselbetrieb", "", "", "praca naprzemienna", "alternativ drift", "") // TODO translate -MAKE_TRANSLATION(wwAltOpPrioHeat, "wwaltopprioheat", "prioritise heating during dhw", "Heizen bevorzugt vor WW", "", "", "czas na ogrzewanie w trakcie c.w.u", "prioritert oppvarmning", "", "") // TODO translate -MAKE_TRANSLATION(wwAltOpPrioWw, "wwaltopprioww", "prioritise dhw during heating", "WW bevorzugt vor Heizen", "", "", "czas na c.w.u w trakcie ogrzewania", "prioritert varmtvann", "", "") // TODO translate +MAKE_TRANSLATION(auxHeatMode, "auxheatrmode", "aux heater mode", "Modus Zusatzheizer", "", "", "tryb pracy dogrzewacza po blokadzie z Zakładu Energetycznego", "tilleggsvarmer modus", "", "", "modalità riscaldatore addizionale") // TODO translate +MAKE_TRANSLATION(auxMaxLimit, "auxmaxlimit", "aux heater max limit", "Zusatzheizer max. Grenze", "", "", "dogrzewacz, maksymalny limit", "tillegsvarme maksgrense", "", "limite massimo riscaldatore addizionale") // TODO translate +MAKE_TRANSLATION(auxLimitStart, "auxlimitstart", "aux heater limit start", "Zusatzheizer Grenze Start", "", "", "dogrzewacz, początek ograniczenia", "tillegsvarme startgrense", "", "avvio limite massimo riscaldatore addizionale") // TODO translate +MAKE_TRANSLATION(manDefrost, "mandefrost", "manual defrost", "Manuelle Enteisung", "", "", "ręczne odladzanie", "manuell avisning", "", "", "sbrinamento manuale") // TODO translate +MAKE_TRANSLATION(pvCooling, "pvcooling", "Cooling only with PV", "Kühlen nur mit PV", "", "", "chłodzenie tylko z PV", "kjøling med solpanel", "", "", "solo raffrescamento con solare") // TODO translate +MAKE_TRANSLATION(hpCircPumpWw, "hpcircpumpww", "circulation pump available during dhw", "", "", "", "pompa cyrkulacji dostępna w trakcie c.w.u.", "sirkulasjonspumpe tilgjengelig under varmtvann", "", "", "pompa di circolazione disponibile durante ACS") // TODO translate +MAKE_TRANSLATION(vp_cooling, "vpcooling", "valve/pump cooling", "", "", "", "zawór/pompa chłodzenia", "varmepumpe kjøling", "", "", "valvola/pompa raffrescamento") // TODO translate +MAKE_TRANSLATION(VC0valve, "vc0valve", "VC0 valve", "VC0 Ventil", "", "", "zawór VC0", "vc0 ventil", "", "", "valvola VC0") // TODO translate +MAKE_TRANSLATION(primePump, "primepump", "primary heatpump", "Hauptpumpe", "", "", "główna pompa ciepła", "primærpumpe", "", "", "pompa principale riscaldamento") // TODO translate +MAKE_TRANSLATION(primePumpMod, "primepumpmod", "primary heatpump modulation", "Modulation Hauptpumpe", "", "", "wysterowanie głównej pompy ciepła", "primærpumpelast", "", "", "pompa principale modulazione riscaldamento") // TODO translate +MAKE_TRANSLATION(hp3wayValve, "hp3way", "3-way valve", "3-Wege-Ventil", "", "", "zawór 3-drogowy pompy ciepła", "3-veisventil", "", "", "valvola 3-vie") // TODO translate +MAKE_TRANSLATION(elHeatStep1, "elheatstep1", "el. heater step 1", "El. Heizer Stufe 1", "", "", "dogrzewacz poziom 1", "el-kolbe steg 1", "", "", "riscaldatore elettrico livello 1") // TODO translate +MAKE_TRANSLATION(elHeatStep2, "elheatstep2", "el. heater step 2", "El. Heizer Stufe 2", "", "", "dogrzewacz poziom 2", "el-kolbe steg 2", "", "", "riscaldatore elettrico livello 2") // TODO translate +MAKE_TRANSLATION(elHeatStep3, "elheatstep3", "el. heater step 3", "El. Heizer Stufe 3", "", "", "dogrzewacz poziom 3", "el-kolbe steg 3", "", "", "riscaldatore elettrico livello 3") // TODO translate +MAKE_TRANSLATION(wwAlternatingOper, "wwalternatingop", "alternating operation", "Wechselbetrieb", "", "", "praca naprzemienna", "alternativ drift", "", "", "funzionamento alternato") // TODO translate +MAKE_TRANSLATION(wwAltOpPrioHeat, "wwaltopprioheat", "prioritise heating during dhw", "Heizen bevorzugt vor WW", "", "", "czas na ogrzewanie w trakcie c.w.u", "prioritert oppvarmning", "", "", "dare la priorità al riscaldamento durante l'ACS") // TODO translate +MAKE_TRANSLATION(wwAltOpPrioWw, "wwaltopprioww", "prioritise dhw during heating", "WW bevorzugt vor Heizen", "", "", "czas na c.w.u w trakcie ogrzewania", "prioritert varmtvann", "", "", "dare priorità all'acqua calda durante il riscaldamento") // TODO translate // hybrid heatpump -MAKE_TRANSLATION(hybridStrategy, "hybridstrategy", "hybrid control strategy", "Hybrid Strategie", "Hybride strategie", "Hybrid kontrollstrategi", "strategia sterowania hybrydowego", "hybrid kontrollstrategi", "stratégie contrôle hybride", "") -MAKE_TRANSLATION(switchOverTemp, "switchovertemp", "outside switchover temperature", "Außentemperatur für Umschaltung", "Schakeltemperatuur buitentemperatuur", "Utomhus Omställningstemperatur", "zewnętrzna temperatura przełączania", "utendørstemp styring", "basculement par température extérieure", "") -MAKE_TRANSLATION(energyCostRatio, "energycostratio", "energy cost ratio", "Energie/Kosten-Verhältnis", "Energiekostenratio", "Energi/Kostnads-förhållande", "współczynnik energia/koszt", "energi/kostnads forhold", "ratio coût énergie", "") -MAKE_TRANSLATION(fossileFactor, "fossilefactor", "fossile energy factor", "Energiefaktor Fossil", "Energiefactor fossiele brandstof", "Energifaktor fossilenergi", "udział energii z paliw kopalnych", "energifaktor fossilenergi", "facteur énergie fossile", "") -MAKE_TRANSLATION(electricFactor, "electricfactor", "electric energy factor", "Energiefaktor elektrisch", "Energiefactor electrisch", "Elektrisk energifaktor", "udział energii elektrycznej", "elektrisk energifaktor", "facteur énergie électrique", "") -MAKE_TRANSLATION(delayBoiler, "delayboiler", "delay boiler support", "Verzögerungs-Option", "Vertragingsoptie", "Fördröjningsoption", "opcja opóźnienia", "Fördörjningsoption", "option retardement chaudière", "") -MAKE_TRANSLATION(tempDiffBoiler, "tempdiffboiler", "temp diff boiler support", "Temperaturdifferenz-Option", "Verschiltemperatuuroptie", "Temperaturskillnadsoption", "opcja różnicy temperatur", "temperatursforskjell kjele", "option différence température", "") -MAKE_TRANSLATION(lowNoiseMode, "lownoisemode", "low noise mode", "Geräuscharmer Betrieb", "", "Tyst läge", "tryb cichy", "stillemodus", "mode faible bruit", "") // TODO translate -MAKE_TRANSLATION(lowNoiseStart, "lownoisestart", "low noise starttime", "Start geräuscharmer Betrieb", "", "Tyst läge starttid", "początek trybu cichego", "stille modu starttid", "heure démarrage faible bruit", "") // TODO translate -MAKE_TRANSLATION(lowNoiseStop, "lownoisestop", "low noise stoptime", "Stopp geräuscharmer Betrieb", "", "Tyst läge stopptid", "koniec trybu cichego", "stille modus stopptid", "heure arrêt faible bruit", "") // TODO translate -MAKE_TRANSLATION(energyPriceGas, "energypricegas", "energy price gas", "Energiepreis Gas", "", "Gaspris", "cena energii z gazu", "energipris gass", "prix énergie gaz", "") // TODO translate -MAKE_TRANSLATION(energyPriceEl, "energypriceel", "energy price electric", "Energiepreis Eletrizität", "", "Elpris", "cena energii elektrycznej", "strømpris", "prix énergie électrique", "") // TODO translate -MAKE_TRANSLATION(energyPricePV, "energyfeedpv", "feed in PV", "PV Einspeisevergütung", "", "PV Energi", "zasilanie energią PV", "strømpris PV", "alimentation PV", "") // TODO translate -MAKE_TRANSLATION(hybridDHW, "hybriddhw", "hybrid DHW", "Hybrid Warmwasser", "", "Hybridläge varmvatten", "hybrydowa c.w.u.", "hybridmodus varmtvann", "ecs hybride", "", "") // TODO translate -MAKE_TRANSLATION(airPurgeMode, "airpurgemode", "air purge mode", "Luftspülung", "", "Luftreningsläge", "tryb oczyszczania powietrza", "luftsrensningsmodus", "mode purge air", "") // TODO translate -MAKE_TRANSLATION(heatPumpOutput, "heatpumpoutput", "heatpump output", "WP Leistung", "", "Värmepumpseffekt", "moc wyjściowa pompy ciepła", "varmepumpeeffekt", "sortie pompe à chaleur", "") // TODO translate -MAKE_TRANSLATION(coolingCircuit, "coolingcircuit", "cooling circuit", "Kühlkreislauf", "", "Kylkrets", "obwód chłodzący", "kjølekrets", "circuit refroidissement", "") // TODO translate -MAKE_TRANSLATION(compStartMod, "compstartmod", "compressor start modulation", "Kompressor Startleistung", "", "Kompressor startmodulering", "początkowa modulacja sprężarki", "kompressor startmodulering", "modulation démarrage compresseur", "") // TODO translate -MAKE_TRANSLATION(heatDrainPan, "heatdrainpan", "heat drain pan", "Wärmeausgleichsgefäß", "", "Uppvärm. dränering", "zbiornik wyrównawczy ciepła", "oppvarming drenering", "bac récupération chaleur", "") // TODO translate -MAKE_TRANSLATION(heatCable, "heatcable", "heating cable", "Heizband", "heating cable", "värmekabel", "przewód grzejny", "varmekabel", "câble chauffant", "") // TODO translate +MAKE_TRANSLATION(hybridStrategy, "hybridstrategy", "hybrid control strategy", "Hybrid Strategie", "Hybride strategie", "Hybrid kontrollstrategi", "strategia sterowania hybrydowego", "hybrid kontrollstrategi", "stratégie contrôle hybride", "", "strategia comtrollo ibrido") +MAKE_TRANSLATION(switchOverTemp, "switchovertemp", "outside switchover temperature", "Außentemperatur für Umschaltung", "Schakeltemperatuur buitentemperatuur", "Utomhus Omställningstemperatur", "zewnętrzna temperatura przełączania", "utendørstemp styring", "basculement par température extérieure", "", "temperatura esterna per commutazione") +MAKE_TRANSLATION(energyCostRatio, "energycostratio", "energy cost ratio", "Energie/Kosten-Verhältnis", "Energiekostenratio", "Energi/Kostnads-förhållande", "współczynnik energia/koszt", "energi/kostnads forhold", "ratio coût énergie", "", "rapporto energia/costo") +MAKE_TRANSLATION(fossileFactor, "fossilefactor", "fossile energy factor", "Energiefaktor Fossil", "Energiefactor fossiele brandstof", "Energifaktor fossilenergi", "udział energii z paliw kopalnych", "energifaktor fossilenergi", "facteur énergie fossile", "", "fattore energia fossile") +MAKE_TRANSLATION(electricFactor, "electricfactor", "electric energy factor", "Energiefaktor elektrisch", "Energiefactor electrisch", "Elektrisk energifaktor", "udział energii elektrycznej", "elektrisk energifaktor", "facteur énergie électrique", "", "fattore energia elettrica") +MAKE_TRANSLATION(delayBoiler, "delayboiler", "delay boiler support", "Verzögerungs-Option", "Vertragingsoptie", "Fördröjningsoption", "opcja opóźnienia", "Fördörjningsoption", "option retardement chaudière", "", "opzione ritardo caldaia") +MAKE_TRANSLATION(tempDiffBoiler, "tempdiffboiler", "temp diff boiler support", "Temperaturdifferenz-Option", "Verschiltemperatuuroptie", "Temperaturskillnadsoption", "opcja różnicy temperatur", "temperatursforskjell kjele", "option différence température", "", "opzione differenza temperatura") +MAKE_TRANSLATION(lowNoiseMode, "lownoisemode", "low noise mode", "Geräuscharmer Betrieb", "", "Tyst läge", "tryb cichy", "stillemodus", "mode faible bruit", "", "modalità a basso rumore") // TODO translate +MAKE_TRANSLATION(lowNoiseStart, "lownoisestart", "low noise starttime", "Start geräuscharmer Betrieb", "", "Tyst läge starttid", "początek trybu cichego", "stille modu starttid", "heure démarrage faible bruit", "", "ora di avvio a basso rumore") // TODO translate +MAKE_TRANSLATION(lowNoiseStop, "lownoisestop", "low noise stoptime", "Stopp geräuscharmer Betrieb", "", "Tyst läge stopptid", "koniec trybu cichego", "stille modus stopptid", "heure arrêt faible bruit", "", "ora di arresto funzionamento silenzioso") // TODO translate +MAKE_TRANSLATION(energyPriceGas, "energypricegas", "energy price gas", "Energiepreis Gas", "", "Gaspris", "cena energii z gazu", "energipris gass", "prix énergie gaz", "", "prezzo energia gas") // TODO translate +MAKE_TRANSLATION(energyPriceEl, "energypriceel", "energy price electric", "Energiepreis Eletrizität", "", "Elpris", "cena energii elektrycznej", "strømpris", "prix énergie électrique", "", "prezzo energia elettrica") // TODO translate +MAKE_TRANSLATION(energyPricePV, "energyfeedpv", "feed in PV", "PV Einspeisevergütung", "", "PV Energi", "zasilanie energią PV", "strømpris PV", "alimentation PV", "", "energia fotovoltaico") // TODO translate +MAKE_TRANSLATION(hybridDHW, "hybriddhw", "hybrid DHW", "Hybrid Warmwasser", "", "Hybridläge varmvatten", "hybrydowa c.w.u.", "hybridmodus varmtvann", "ecs hybride", "", "ACS ibrida") // TODO translate +MAKE_TRANSLATION(airPurgeMode, "airpurgemode", "air purge mode", "Luftspülung", "", "Luftreningsläge", "tryb oczyszczania powietrza", "luftsrensningsmodus", "mode purge air", "", "modalita spurgo aria") // TODO translate +MAKE_TRANSLATION(heatPumpOutput, "heatpumpoutput", "heatpump output", "WP Leistung", "", "Värmepumpseffekt", "moc wyjściowa pompy ciepła", "varmepumpeeffekt", "sortie pompe à chaleur", "", "prestazione pompa calore") // TODO translate +MAKE_TRANSLATION(coolingCircuit, "coolingcircuit", "cooling circuit", "Kühlkreislauf", "", "Kylkrets", "obwód chłodzący", "kjølekrets", "circuit refroidissement", "", "circuito raffreddante") // TODO translate +MAKE_TRANSLATION(compStartMod, "compstartmod", "compressor start modulation", "Kompressor Startleistung", "", "Kompressor startmodulering", "początkowa modulacja sprężarki", "kompressor startmodulering", "modulation démarrage compresseur", "", "avvio modulazione compressore") // TODO translate +MAKE_TRANSLATION(heatDrainPan, "heatdrainpan", "heat drain pan", "Wärmeausgleichsgefäß", "", "Uppvärm. dränering", "zbiornik wyrównawczy ciepła", "oppvarming drenering", "bac récupération chaleur", "", "serbatoio scarico condensa") // TODO translate +MAKE_TRANSLATION(heatCable, "heatcable", "heating cable", "Heizband", "heating cable", "värmekabel", "przewód grzejny", "varmekabel", "câble chauffant", "", "cavo riscaldante") // TODO translate // alternative heatsource AM200 -MAKE_TRANSLATION(aCylTopTemp, "cyltoptemp", "cylinder top temperature", "Speichertemperatur Oben", "Buffer temperatuur boven", "Cylindertemperatur Toppen", "temperatura na górze cylindra", "beredertemperatur topp", "température haut cylindre", "") -MAKE_TRANSLATION(aCylCenterTemp, "cylcentertemp", "cylinder center temperature", "Speichertemperatur Mitte", "Buffer temperatuur midden", "Cylindertemperatur Mitten", "temperatura na środku cylindra", "beredertemperatur midten", "température centre cylindre", "") -MAKE_TRANSLATION(aCylBottomTemp, "cylbottomtemp", "cylinder bottom temperature", "Speichertemperatur Unten", "Buffer temperatuur onder", "Cylindertemperatur Botten", "temperatura na dole cylindra", "beredertemperatur nederst", "température fond cylindre", "") -MAKE_TRANSLATION(aFlowTemp, "altflowtemp", "alternative hs flow temperature", "Alternativer WE Vorlauftemperatur", "Alternatieve warmtebron aanvoertemperatuur", "Alternativ flödestemp värmekälla", "temperatura zasilania z alternatywnego źródła", "alternativ varmekilde tilførselstemperatur", "température flux hs alternative", "") // TODO translate -MAKE_TRANSLATION(aRetTemp, "altrettemp", "alternative hs return temperature", "Alternativer WE Rücklauftemperatur", "Alternatieve warmtebron retourtemperatuur", "Alternativ returtemp värmekälla", "temperatura powrotu z alternatywnego źródła", "alternativ varmekilde returtemperatur", "température retour hs alternative", "") // TODO translate -MAKE_TRANSLATION(sysFlowTemp, "sysflowtemp", "system flow temperature", "System Vorlauftemperatur", "Systeem aanvoertemperatuur", "Systemflödestemperatur", "temperatura zasilania systemu", "systemturtemperatur", "température flux système", "") -MAKE_TRANSLATION(sysRetTemp, "sysrettemp", "system return temperature", "System Rücklauftemperatur", "Systeem retourtemperatuur", "Systemreturtemperatur", "temperatura powrotu z systemu", "systemreturtemperatur", "température retour système", "") // TODO translate -MAKE_TRANSLATION(valveByPass, "valvebypass", "bypass valve", "Bypass-Ventil", "Bypass klep", "Bypassventil", "zawór obejścia", "bypassventil", "vanne dérivation", "") // TODO translate -MAKE_TRANSLATION(valveBuffer, "valvebuffer", "buffer valve", "Puffer-Ventil", "Bufferklep", "Buffertventil", "zawór bufora", "buffertventil", "vanne tampon", "") -MAKE_TRANSLATION(valveReturn, "valvereturn", "return valve", "Rückfluss-Ventil", "Retourklep", "Returventil", "zawór powrotu", "returventil", "vanne retour") // TODO translate -MAKE_TRANSLATION(aPumpMod, "apumpmod", "alternative hs pump modulation", "Alternativer WE Pumpenmodulation", "Alternatieve warmtebron pomp modulatie", "Alternativ Pumpmodulering Värmekälla", "modulacja pompy alternatywnego źródła ciepła", "alternativ pumpemodulering varmekilde", "modulation alternative pompe hs", "") -MAKE_TRANSLATION(heatSource, "heatsource", "alternative heating active", "Alternativer Wärmeerzeuger aktiv", "Alternatieve warmtebron aktief", "Alternativ Värmekälla aktiv", "aktywne alternatywne źródło ciepła", "alternativ varmekilde aktiv", "chauffage alternatif actif", "") -MAKE_TRANSLATION(aPump, "apump", "alternative hs pump", "Alternativer WE Pumpe", "Alternatieve warmtebron pomp", "Alternativ Pump Värmekälla", "pompy alternatywnego źródła ciepła", "alternativ pumpe varmekilde", "alternative pompe hs", "") -MAKE_TRANSLATION(burner, "burner", "burner", "Brenner", "", "", "palnik", "", "", "") // TODO translate -MAKE_TRANSLATION(heatRequest, "heatrequest", "heat request", "Wärmeanforderung", "", "", "zapotrzebowanie na ciepło", "varmeforespørsel", "", "") // TODO translate -MAKE_TRANSLATION(blockRemain, "blockremain", "remaining blocktime", "verbleibende Blockzeit", "", "", "czas do końca blokady", "gjenstående blokkeringstid", "", "") // TODO translate -MAKE_TRANSLATION(blockRemainWw, "blockremainww", "remaining blocktime dhw", "verbleibende Blockzeit WW", "", "", "czas do końca blokady c.w.u.", "gjenværende blokkeringstid bereder", "", "") // TODO translate -MAKE_TRANSLATION(flueGasTemp, "fluegastemp", "flue gas temperature", "Abgastemperatur", "", "", "temperatura spalin", "røykgasstemperatur", "", "") // TODO translate +MAKE_TRANSLATION(aCylTopTemp, "cyltoptemp", "cylinder top temperature", "Speichertemperatur Oben", "Buffer temperatuur boven", "Cylindertemperatur Toppen", "temperatura na górze cylindra", "beredertemperatur topp", "température haut cylindre", "", "temperatura superiore accumulo") +MAKE_TRANSLATION(aCylCenterTemp, "cylcentertemp", "cylinder center temperature", "Speichertemperatur Mitte", "Buffer temperatuur midden", "Cylindertemperatur Mitten", "temperatura na środku cylindra", "beredertemperatur midten", "température centre cylindre", "", "temperatura centrale accumulo") +MAKE_TRANSLATION(aCylBottomTemp, "cylbottomtemp", "cylinder bottom temperature", "Speichertemperatur Unten", "Buffer temperatuur onder", "Cylindertemperatur Botten", "temperatura na dole cylindra", "beredertemperatur nederst", "température fond cylindre", "", "temperatura inferiore accumulo") +MAKE_TRANSLATION(aFlowTemp, "altflowtemp", "alternative hs flow temperature", "Alternativer WE Vorlauftemperatur", "Alternatieve warmtebron aanvoertemperatuur", "Alternativ flödestemp värmekälla", "temperatura zasilania z alternatywnego źródła", "alternativ varmekilde tilførselstemperatur", "température flux hs alternative", "", "temperatura alternativa mandata hs") +MAKE_TRANSLATION(aRetTemp, "altrettemp", "alternative hs return temperature", "Alternativer WE Rücklauftemperatur", "Alternatieve warmtebron retourtemperatuur", "Alternativ returtemp värmekälla", "temperatura powrotu z alternatywnego źródła", "alternativ varmekilde returtemperatur", "température retour hs alternative", "", "temperatura alternativa ritorno hs") +MAKE_TRANSLATION(sysFlowTemp, "sysflowtemp", "system flow temperature", "System Vorlauftemperatur", "Systeem aanvoertemperatuur", "Systemflödestemperatur", "temperatura zasilania systemu", "systemturtemperatur", "température flux système", "", "temperatura di mandata impianto") +MAKE_TRANSLATION(sysRetTemp, "sysrettemp", "system return temperature", "System Rücklauftemperatur", "Systeem retourtemperatuur", "Systemreturtemperatur", "temperatura powrotu z systemu", "systemreturtemperatur", "température retour système", "", "temperatura di ritorno impianto") +MAKE_TRANSLATION(valveByPass, "valvebypass", "bypass valve", "Bypass-Ventil", "Bypass klep", "Bypassventil", "zawór obejścia", "bypassventil", "vanne dérivation", "", "valvola Bypass") +MAKE_TRANSLATION(valveBuffer, "valvebuffer", "buffer valve", "Puffer-Ventil", "Bufferklep", "Buffertventil", "zawór bufora", "buffertventil", "vanne tampon", "", "valvola tampone") +MAKE_TRANSLATION(valveReturn, "valvereturn", "return valve", "Rückfluss-Ventil", "Retourklep", "Returventil", "zawór powrotu", "returventil", "vanne retour", "", "valvola ritorno") +MAKE_TRANSLATION(aPumpMod, "apumpmod", "alternative hs pump modulation", "Alternativer WE Pumpenmodulation", "Alternatieve warmtebron pomp modulatie", "Alternativ Pumpmodulering Värmekälla", "modulacja pompy alternatywnego źródła ciepła", "alternativ pumpemodulering varmekilde", "modulation alternative pompe hs", "", "pompa modulazione alternativa hs") +MAKE_TRANSLATION(heatSource, "heatsource", "alternative heating active", "Alternativer Wärmeerzeuger aktiv", "Alternatieve warmtebron aktief", "Alternativ Värmekälla aktiv", "aktywne alternatywne źródło ciepła", "alternativ varmekilde aktiv", "chauffage alternatif actif", "", "riscaldamento alternativo attivo") +MAKE_TRANSLATION(aPump, "apump", "alternative hs pump", "Alternativer WE Pumpe", "Alternatieve warmtebron pomp", "Alternativ Pump Värmekälla", "pompy alternatywnego źródła ciepła", "alternativ pumpe varmekilde", "alternative pompe hs", "", "pompa alternativa hs") +MAKE_TRANSLATION(burner, "burner", "burner", "Brenner", "", "", "palnik", "", "", "", "bruciatore") // TODO translate +MAKE_TRANSLATION(heatRequest, "heatrequest", "heat request", "Wärmeanforderung", "", "", "zapotrzebowanie na ciepło", "varmeforespørsel", "", "", "richiesta calore") // TODO translate +MAKE_TRANSLATION(blockRemain, "blockremain", "remaining blocktime", "verbleibende Blockzeit", "", "", "czas do końca blokady", "gjenstående blokkeringstid", "", "", "tempo di blocco rimanente") // TODO translate +MAKE_TRANSLATION(blockRemainWw, "blockremainww", "remaining blocktime dhw", "verbleibende Blockzeit WW", "", "", "czas do końca blokady c.w.u.", "gjenværende blokkeringstid bereder", "", "", "tempo di blocco rimanente ACS") // TODO translate +MAKE_TRANSLATION(flueGasTemp, "fluegastemp", "flue gas temperature", "Abgastemperatur", "", "", "temperatura spalin", "røykgasstemperatur", "", "", "temperatura gas di scarico") // TODO translate -MAKE_TRANSLATION(vr2Config, "vr2config", "vr2 configuration", "VR2 Konfiguration", "VR2 configuratie", "VR2 Konfiguration", "konfiguracja VR2", "vr2 konfigurasjon", "configuration vr2", "") -MAKE_TRANSLATION(ahsActivated, "ahsactivated", "alternate heat source activation", "Alt. Wärmeerzeuger aktiviert", "Altenatieve warmtebron geactiveerd", "Alternativ värmekälla aktivering", "aktywacja alternatywnego źródła ciepła", "alternativ varmekilde aktivering", "activation source chaleur alternative", "") -MAKE_TRANSLATION(aPumpConfig, "apumpconfig", "primary pump config", "Konfig. Hauptpumpe", "Primaire pomp configuratie", "Konfiguration Primärpump", "konfiguracja pompy głównej", "konfiguration primærpumpe", "configuration pompe primaire", "") -MAKE_TRANSLATION(aPumpSignal, "apumpsignal", "output for pr1 pump", "Ausgang Pumpe PR1", "Output voor pomp PR1", "Utgång från pump PR1", "wyjście pompy PR1", "utgang fra pumpe PR1", "sortie pompe pr1", "") -MAKE_TRANSLATION(aPumpMin, "apumpmin", "min output pump pr1", "Minimale Pumpenansteuerung", "Minimale output pomp PR1", "Min Output Pump PR1", "minimalne wysterowanie pompy PR1", "minimal output pumpe PR1", "sortie min pompe pr1", "") -MAKE_TRANSLATION(tempRise, "temprise", "ahs return temp rise", "Rücklauf Temperaturerhöhung", "Verhoging retourtemperatuur", "Förhöjd returtemperatur", "wzrost temperatury powrotu", "forhøyd returtemperatur", "augmentation température retour ahs", "") -MAKE_TRANSLATION(setReturnTemp, "setreturntemp", "set temp return", "Soll-Rücklauftemperatur", "Streeftemperatuur retour", "Vald returtemperatur", "zadana temperatura powrotu", "valgt returtemperatur", "régler température retour", "") -MAKE_TRANSLATION(mixRuntime, "mixruntime", "mixer run time", "Mischer-Laufzeit", "Mixer looptijd", "Blandningsventil drifttid", "czas pracy miksera", "blandingsventil drifttid", "durée fonctionnement mélangeur", "") -MAKE_TRANSLATION(bufBypass, "bufbypass", "buffer bypass config", "Puffer-Bypass Konfig.", "Buffer bypass configuratie", "Konfiguration Buffer bypass", "konfiguracja z obejściem bufora", "konfigurasjon buffer bypass", "configuration contournement buffer", "") -MAKE_TRANSLATION(bufMixRuntime, "bufmixruntime", "bypass mixer run time", "Speicher-Mischer-Laufzeit", "Buffer mixer looptijd", "Blandningsventil Bypass drifttid", "czas pracy mieszacza obejścia", "blandningsventil bypass drifttid", "durée fonctionnement contournement mélangeur", "") -MAKE_TRANSLATION(bufConfig, "bufconfig", "dhw buffer config", "Konfig. Warmwasserspeicher", "Warmwater boiler configuratie", "Konfiguration Varmvattentank", "konfiguracja bufora c.w.u.", "konfigurasjon varmvannstank", "configuration buffer ecs", "") -MAKE_TRANSLATION(blockMode, "blockmode", "config htg. blocking mode", "Konfig. Sperr-Modus", "Configuratie blokeermodus", "Konfiguration Blockeringsläge", "konfiguracja trybu blokady", "konfigurasjon blokkeringsmodus", "config mode blocage htg.", "") -MAKE_TRANSLATION(blockTerm, "blockterm", "config of block terminal", "Konfig. Sperrterminal", "Configuratie blookerterminal", "Konfiguration Blockeringsterminal", "konfiguracja terminala blokującego", "konfigurasjon blokkeringsterminal", "config. du bloque terminal", "") -MAKE_TRANSLATION(blockHyst, "blockhyst", "hyst. for boiler block", "Hysterese Sperrmodus", "Hysterese blokeerterminal", "Hysteres Blockeringsmodul", "tryb blokowania histerezy", "hystrese blokkeringsmodus", "hyst. Blocage chaudière", "") -MAKE_TRANSLATION(releaseWait, "releasewait", "boiler release wait time", "Wartezeit Kessel-Freigabe", "Wachttijd ketel vrijgave", "Väntetid Frisläppning", "czas oczekiwania na zwolnienie kotła", "kjele frigjøringsventetid", "temps attente libération chaudière", "") +MAKE_TRANSLATION(vr2Config, "vr2config", "vr2 configuration", "VR2 Konfiguration", "VR2 configuratie", "VR2 Konfiguration", "konfiguracja VR2", "vr2 konfigurasjon", "configuration vr2", "", "configurazione VR2") +MAKE_TRANSLATION(ahsActivated, "ahsactivated", "alternate heat source activation", "Alt. Wärmeerzeuger aktiviert", "Altenatieve warmtebron geactiveerd", "Alternativ värmekälla aktivering", "aktywacja alternatywnego źródła ciepła", "alternativ varmekilde aktivering", "activation source chaleur alternative", "", "attivazione fonte di calore alternativa") +MAKE_TRANSLATION(aPumpConfig, "apumpconfig", "primary pump config", "Konfig. Hauptpumpe", "Primaire pomp configuratie", "Konfiguration Primärpump", "konfiguracja pompy głównej", "konfiguration primærpumpe", "configuration pompe primaire", "", "configurazione pompa primaria") +MAKE_TRANSLATION(aPumpSignal, "apumpsignal", "output for pr1 pump", "Ausgang Pumpe PR1", "Output voor pomp PR1", "Utgång från pump PR1", "wyjście pompy PR1", "utgang fra pumpe PR1", "sortie pompe pr1", "", "uscita per pompa PR1") +MAKE_TRANSLATION(aPumpMin, "apumpmin", "min output pump pr1", "Minimale Pumpenansteuerung", "Minimale output pomp PR1", "Min Output Pump PR1", "minimalne wysterowanie pompy PR1", "minimal output pumpe PR1", "sortie min pompe pr1", "", "uscita minima pompa PR1") +MAKE_TRANSLATION(tempRise, "temprise", "ahs return temp rise", "Rücklauf Temperaturerhöhung", "Verhoging retourtemperatuur", "Förhöjd returtemperatur", "wzrost temperatury powrotu", "forhøyd returtemperatur", "augmentation température retour ahs", "", "aumento della temperatura di ritorno") +MAKE_TRANSLATION(setReturnTemp, "setreturntemp", "set temp return", "Soll-Rücklauftemperatur", "Streeftemperatuur retour", "Vald returtemperatur", "zadana temperatura powrotu", "valgt returtemperatur", "régler température retour", "", "imposta temperatura di ritorno") +MAKE_TRANSLATION(mixRuntime, "mixruntime", "mixer run time", "Mischer-Laufzeit", "Mixer looptijd", "Blandningsventil drifttid", "czas pracy miksera", "blandingsventil drifttid", "durée fonctionnement mélangeur", "", "tempo di funzionamento del miscelatore") +MAKE_TRANSLATION(bufBypass, "bufbypass", "buffer bypass config", "Puffer-Bypass Konfig.", "Buffer bypass configuratie", "Konfiguration Buffer bypass", "konfiguracja z obejściem bufora", "konfigurasjon buffer bypass", "configuration contournement buffer", "", "configurazione bypass del tampone ") +MAKE_TRANSLATION(bufMixRuntime, "bufmixruntime", "bypass mixer run time", "Speicher-Mischer-Laufzeit", "Buffer mixer looptijd", "Blandningsventil Bypass drifttid", "czas pracy mieszacza obejścia", "blandningsventil bypass drifttid", "durée fonctionnement contournement mélangeur", "", "tempo funzionamento bypass miscelatore") +MAKE_TRANSLATION(bufConfig, "bufconfig", "dhw buffer config", "Konfig. Warmwasserspeicher", "Warmwater boiler configuratie", "Konfiguration Varmvattentank", "konfiguracja bufora c.w.u.", "konfigurasjon varmvannstank", "configuration buffer ecs", "", "configurazione tampone ACS") +MAKE_TRANSLATION(blockMode, "blockmode", "config htg. blocking mode", "Konfig. Sperr-Modus", "Configuratie blokeermodus", "Konfiguration Blockeringsläge", "konfiguracja trybu blokady", "konfigurasjon blokkeringsmodus", "config mode blocage htg.", "", "configurazione modalità di blocco") +MAKE_TRANSLATION(blockTerm, "blockterm", "config of block terminal", "Konfig. Sperrterminal", "Configuratie blookerterminal", "Konfiguration Blockeringsterminal", "konfiguracja terminala blokującego", "konfigurasjon blokkeringsterminal", "config. du bloque terminal", "", "configurazione terminale di blocco") +MAKE_TRANSLATION(blockHyst, "blockhyst", "hyst. for boiler block", "Hysterese Sperrmodus", "Hysterese blokeerterminal", "Hysteres Blockeringsmodul", "tryb blokowania histerezy", "hystrese blokkeringsmodus", "hyst. Blocage chaudière", "", "modalità blocco isteresi") +MAKE_TRANSLATION(releaseWait, "releasewait", "boiler release wait time", "Wartezeit Kessel-Freigabe", "Wachttijd ketel vrijgave", "Väntetid Frisläppning", "czas oczekiwania na zwolnienie kotła", "kjele frigjøringsventetid", "temps attente libération chaudière", "", "tempo di attesa sblocco caldaia") // HIU MAKE_TRANSLATION(netFlowTemp, "netflowtemp", "heat network flow temp") @@ -501,280 +503,285 @@ MAKE_TRANSLATION(cwFlowRate, "cwflowrate", "cold water flow rate") MAKE_TRANSLATION(keepWarmTemp, "keepwarmtemp", "keep warm temperature") // the following are dhw for the boiler and automatically tagged with 'dhw' -MAKE_TRANSLATION(wwSelTemp, "wwseltemp", "selected temperature", "gewählte Temperatur", "Geselecteerd temperatuur", "Vald Temperatur", "temperatura wyższa/komfort", "valgt temperatur", "température sélectionnée", "") -MAKE_TRANSLATION(wwSelTempLow, "wwseltemplow", "selected lower temperature", "untere Solltemperatur", "Onderste streeftemperatuur", "Vald lägstatemperatur", "temperatura niższa/eko", "valgt nedre temperatur", "température basse sélectionnée", "") -MAKE_TRANSLATION(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_TRANSLATION(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_TRANSLATION(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_TRANSLATION(wwSetTemp, "wwsettemp", "set temperature", "Solltemperatur", "Streeftemperatuut", "Börtempertur", "temperatura zadana", "innstilt temperatur", "régler température", "") -MAKE_TRANSLATION(wwType, "wwtype", "type", "Typ", "type", "Typ", "typ", "type", "type", "") -MAKE_TRANSLATION(wwComfort, "wwcomfort", "comfort", "Komfort", "Comfort", "Komfort", "komfort", "komfort", "confort", "") -MAKE_TRANSLATION(wwComfort1, "wwcomfort1", "comfort mode", "Komfort-Modus", "Comfort modus", "Komfortläge", "tryb komfortu", "komfort modus", "mode confort", "") -MAKE_TRANSLATION(wwFlowTempOffset, "wwflowtempoffset", "flow temperature offset", "Vorlauftemperaturanhebung", "Aanvoertemperatuur offset", "Flödestemperatur förskjutning", "korekta temperatury wypływu", "turtemperaturforskyvning", "offset température flux", "") -MAKE_TRANSLATION(wwMaxPower, "wwmaxpower", "max power", "max Leistung", "Maximaal vermogen", "Max Effekt", "moc maksymalna", "maks effekt", "puissance max", "") -MAKE_TRANSLATION(wwCircPump, "wwcircpump", "circulation pump available", "Zirkulationspumpe vorhanden", "Circulatiepomp aanwezig", "Cirkulationspump tillgänglig", "pompa cyrkulacji zainstalowana", "sirkulasjonspumpe tilgjengelig", "pompe circulation disponible", "") -MAKE_TRANSLATION(wwChargeType, "wwchargetype", "charging type", "Speicher-Ladungstyp", "Buffer laadtype", "Laddningstyp", "sposób grzania zasobnika", "varmetype", "type chargement", "") -MAKE_TRANSLATION(wwDisinfectionTemp, "wwdisinfectiontemp", "disinfection temperature", "Desinfektionstemperatur", "Desinfectietemperatuur", "Desinfektionstemperatur", "temperatura dezynfekcji termicznej", "desinfeksjonstemperatur", "température désinfection", "") // TODO translate -MAKE_TRANSLATION(wwCircMode, "wwcircmode", "circulation pump mode", "Zirkulationspumpen-Modus", "Modus circulatiepomp", "Läge Cirkulationspump", "tryb pracy cyrkulacji", "sikulasjonspumpemodus", "mode pompe circulation", "") -MAKE_TRANSLATION(wwCirc, "wwcirc", "circulation active", "Zirkulation aktiv", "Circulatiepomp actief", "Cirkulation aktiv", "pompa cyrkulacji", "sirkulasjon aktiv", "circulation active", "") -MAKE_TRANSLATION(wwCurTemp, "wwcurtemp", "current intern temperature", "aktuelle interne Temperatur", "Huidige interne temperatuur", "Intern Temperatur", "temperatura zasobnika", "gjeldende intern temperatur", "température interne actuelle", "") -MAKE_TRANSLATION(wwCurTemp2, "wwcurtemp2", "current extern temperature", "aktuelle externe Temperatur", "Huidige externe temperatuur", "Extern Temperatur", "temperatura wypływu", "gjeldende ekstern temperaur", "température externe actuelle", "") -MAKE_TRANSLATION(wwCurFlow, "wwcurflow", "current tap water flow", "aktueller Durchfluss", "Hudige warmwater doorstroming", "Aktuellt tappvattenflöde", "aktualny przepływ", "gjeldende tappevannshastighet", "débit actuel eau robinet", "") -MAKE_TRANSLATION(wwStorageTemp1, "wwstoragetemp1", "storage intern temperature", "interne Speichertemperatur", "Interne buffertemperatuur", "Beredare Intern Temperatur", "temperatura wewnątrz zasobnika", "intern temperatur bereder", "température interne stockage", "") -MAKE_TRANSLATION(wwStorageTemp2, "wwstoragetemp2", "storage extern temperature", "externer Speichertemperatur", "Externe buffertemperatuur", "Beredare Extern Tempereatur", "temperatura na wyjściu zasobnika", "ekstern temperatur bereder", "température externe stockage", "") -MAKE_TRANSLATION(wwActivated, "wwactivated", "activated", "aktiviert", "geactiveerd", "Aktiverad", "system przygotowywania c.w.u.", "aktivert", "activé", "") -MAKE_TRANSLATION(wwOneTime, "wwonetime", "one time charging", "Einmalladung", "Buffer eenmalig laden", "Engångsladdning", "jednorazowa dodatkowa ciepła woda", "engangsoppvarming", "charge unique", "") // TODO translate -MAKE_TRANSLATION(wwDisinfecting, "wwdisinfecting", "disinfecting", "Desinfizieren", "Desinfectie", "Desinficerar", "dezynfekcja termiczna", "desinfiserer", "désinfection", "") -MAKE_TRANSLATION(wwCharging, "wwcharging", "charging", "Laden", "Laden", "Värmer", "grzanie", "varmer", "chargement", "") -MAKE_TRANSLATION(wwChargeOptimization, "wwchargeoptimization", "charge optimization", "Ladungsoptimierung", "laadoptimalisatie", "Laddningsoptimering", "optymalizacja grzania", "oppvarmingsoptimalisering", "optimisation charge", "") -MAKE_TRANSLATION(wwRecharging, "wwrecharging", "recharging", "Nachladen", "herladen", "Laddar om", "ponowne grzanie", "varm på nytt", "en recharge", "") -MAKE_TRANSLATION(wwTempOK, "wwtempok", "temperature ok", "Temperatur ok", "Temperatuur OK", "Temperatur OK", "temperatura OK", "temperatur ok!", "température ok", "") -MAKE_TRANSLATION(wwActive, "wwactive", "active", "aktiv", "Actief", "Aktiv", "aktywna", "aktiv", "actif", "") -MAKE_TRANSLATION(ww3wayValve, "ww3wayvalve", "3-way valve active", "3-Wegeventil aktiv", "3-wegklep actief", "Trevägsventil aktiv", "zawór 3-drogowy aktywny", "aktiv trevisventil", "vanne 3 voies active", "") -MAKE_TRANSLATION(wwSetPumpPower, "wwsetpumppower", "set pump power", "Soll Pumpenleistung", "Streefwaarde pompvermogen", "Vald pumpeffekt", "ustawione wysterowanie pompy", "valgt pumpeeffekt", "régler puissance pompe", "") -MAKE_TRANSLATION(wwMixerTemp, "wwmixertemp", "mixer temperature", "Mischertemperatur", "Mixertemperatuur", "Blandningsventil-tempertur", "temperatura mieszacza", "temperatur blandeventil", "température mélangeur", "") -MAKE_TRANSLATION(wwStarts, "wwstarts", "starts", "Anzahl Starts", "Aantal starts", "Antal starter", "liczba załączeń", "antall starter", "démarrages", "") -MAKE_TRANSLATION(wwStarts2, "wwstarts2", "control starts2", "Kreis 2 Anzahl Starts", "Aantal starts circuit 2", "Antal starter Krets 2", "liczba załączeń 2", "antall starter krets 2", "démarrages contrôle 2", "") -MAKE_TRANSLATION(wwWorkM, "wwworkm", "active time", "aktive Zeit", "Actieve tijd", "Aktiv Tid", "czas aktywności", "driftstid", "temps actif", "") -MAKE_TRANSLATION(wwHystOn, "wwhyston", "hysteresis on temperature", "Einschalttemperaturdifferenz", "Inschakeltemperatuurverschil", "Hysteres PÅ-temperatur", "histereza załączania", "innkoblingstemperaturforskjell", "hystérésis température allumage", "") -MAKE_TRANSLATION(wwHystOff, "wwhystoff", "hysteresis off temperature", "Ausschalttemperaturdifferenz", "Uitschakeltemperatuurverschil", "Hysteres AV-temperatur", "histereza wyłączania", "utkoblingstemperaturforskjell", "hystérésis température extinction") -MAKE_TRANSLATION(wwProgMode, "wwprogmode", "program", "Programmmodus", "Programma", "Program", "program", "program", "programme", "") -MAKE_TRANSLATION(wwCircProg, "wwcircprog", "circulation program", "Zirkulationsprogramm", "Circulatieprogramma", "Cirkulationsprogram", "program cyrkulacji c.w.u.", "sirkulationsprogram", "programme circulation", "") -MAKE_TRANSLATION(wwMaxTemp, "wwmaxtemp", "maximum temperature", "Maximale Temperatur", "Maximale temperatuur", "Maximal Temperatur", "temperatura maksymalna", "maksimal temperatur", "température max", "") // TODO translate -MAKE_TRANSLATION(wwOneTimeKey, "wwonetimekey", "one time key function", "Einmalladungstaste", "Knop voor eenmalig laden buffer", "Engångsfunktion", "przycisk jednorazowego ogrzania", "engangsknapp varme", "fonction touche unique", "") -MAKE_TRANSLATION(wwSolarTemp, "wwsolartemp", "solar boiler temperature", "Solarboiler Temperatur", "Zonneboiler temperatuur", "Solpanel Temp", "temperatura zasobnika solarnego", "solpaneltemp", "température chaudière solaire", "") // TODO translate +MAKE_TRANSLATION(wwSelTemp, "wwseltemp", "selected temperature", "gewählte Temperatur", "Geselecteerd temperatuur", "Vald Temperatur", "temperatura wyższa/komfort", "valgt temperatur", "température sélectionnée", "", "temperatura selezionata") +MAKE_TRANSLATION(wwSelTempLow, "wwseltemplow", "selected lower temperature", "untere Solltemperatur", "Onderste streeftemperatuur", "Vald lägstatemperatur", "temperatura niższa/eko", "valgt nedre temperatur", "température basse sélectionnée", "", "bassa temperatura selezionata") +MAKE_TRANSLATION(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", "", "temperatura selezionata per spegnimento") +MAKE_TRANSLATION(wwSelTempSingle, "wwseltempsingle", "single charge temperature", "Solltemperatur Einmalladung", "Streeftemperatuur enkele lading", "Temperatur Engångsladdning", "temperatura dodatkowej ciepłej wody", "temp engangsoppvarming", "température charge unique", "", "temperatura singolaa carica") +MAKE_TRANSLATION(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)", "", "temperatura centrale accumulo (TS3)") +MAKE_TRANSLATION(wwSetTemp, "wwsettemp", "set temperature", "Solltemperatur", "Streeftemperatuut", "Börtempertur", "temperatura zadana", "innstilt temperatur", "régler température", "", "imposta temperatura") +MAKE_TRANSLATION(wwType, "wwtype", "type", "Typ", "type", "Typ", "typ", "type", "type", "", "tipo") +MAKE_TRANSLATION(wwComfort, "wwcomfort", "comfort", "Komfort", "Comfort", "Komfort", "komfort", "komfort", "confort", "", "Comfort") +MAKE_TRANSLATION(wwComfort1, "wwcomfort1", "comfort mode", "Komfort-Modus", "Comfort modus", "Komfortläge", "tryb komfortu", "komfort modus", "mode confort", "", "modalità comfort") +MAKE_TRANSLATION(wwFlowTempOffset, "wwflowtempoffset", "flow temperature offset", "Vorlauftemperaturanhebung", "Aanvoertemperatuur offset", "Flödestemperatur förskjutning", "korekta temperatury wypływu", "turtemperaturforskyvning", "offset température flux", "", "aumento della temperatura di ritorno") +MAKE_TRANSLATION(wwMaxPower, "wwmaxpower", "max power", "max Leistung", "Maximaal vermogen", "Max Effekt", "moc maksymalna", "maks effekt", "puissance max", "", "potenza massima") +MAKE_TRANSLATION(wwCircPump, "wwcircpump", "circulation pump available", "Zirkulationspumpe vorhanden", "Circulatiepomp aanwezig", "Cirkulationspump tillgänglig", "pompa cyrkulacji zainstalowana", "sirkulasjonspumpe tilgjengelig", "pompe circulation disponible", "", "pompa circolazione disponibile") +MAKE_TRANSLATION(wwChargeType, "wwchargetype", "charging type", "Speicher-Ladungstyp", "Buffer laadtype", "Laddningstyp", "sposób grzania zasobnika", "varmetype", "type chargement", "", "") +MAKE_TRANSLATION(wwDisinfectionTemp, "wwdisinfectiontemp", "disinfection temperature", "Desinfektionstemperatur", "Desinfectietemperatuur", "Desinfektionstemperatur", "temperatura dezynfekcji termicznej", "desinfeksjonstemperatur", "température désinfection", "", "temperatura disinfezione") // TODO translate +MAKE_TRANSLATION(wwCircMode, "wwcircmode", "circulation pump mode", "Zirkulationspumpen-Modus", "Modus circulatiepomp", "Läge Cirkulationspump", "tryb pracy cyrkulacji", "sikulasjonspumpemodus", "mode pompe circulation", "", "modalità pompa circolazione") +MAKE_TRANSLATION(wwCirc, "wwcirc", "circulation active", "Zirkulation aktiv", "Circulatiepomp actief", "Cirkulation aktiv", "pompa cyrkulacji", "sirkulasjon aktiv", "circulation active", "", "circolazione attiva") +MAKE_TRANSLATION(wwCurTemp, "wwcurtemp", "current intern temperature", "aktuelle interne Temperatur", "Huidige interne temperatuur", "Intern Temperatur", "temperatura zasobnika", "gjeldende intern temperatur", "température interne actuelle", "", "temperatura interna attuale") +MAKE_TRANSLATION(wwCurTemp2, "wwcurtemp2", "current extern temperature", "aktuelle externe Temperatur", "Huidige externe temperatuur", "Extern Temperatur", "temperatura wypływu", "gjeldende ekstern temperaur", "température externe actuelle", "", "temperatura esterna attuale") +MAKE_TRANSLATION(wwCurFlow, "wwcurflow", "current tap water flow", "aktueller Durchfluss", "Hudige warmwater doorstroming", "Aktuellt tappvattenflöde", "aktualny przepływ", "gjeldende tappevannshastighet", "débit actuel eau robinet", "", "portata corrente dell'acqua del rubinetto") +MAKE_TRANSLATION(wwStorageTemp1, "wwstoragetemp1", "storage intern temperature", "interne Speichertemperatur", "Interne buffertemperatuur", "Beredare Intern Temperatur", "temperatura wewnątrz zasobnika", "intern temperatur bereder", "température interne stockage", "", "temperatura di conservazione interna") +MAKE_TRANSLATION(wwStorageTemp2, "wwstoragetemp2", "storage extern temperature", "externer Speichertemperatur", "Externe buffertemperatuur", "Beredare Extern Tempereatur", "temperatura na wyjściu zasobnika", "ekstern temperatur bereder", "température externe stockage", "", "temperatura di conservazione esterna") +MAKE_TRANSLATION(wwActivated, "wwactivated", "activated", "aktiviert", "geactiveerd", "Aktiverad", "system przygotowywania c.w.u.", "aktivert", "activé", "", "attivato") +MAKE_TRANSLATION(wwOneTime, "wwonetime", "one time charging", "Einmalladung", "Buffer eenmalig laden", "Engångsladdning", "jednorazowa dodatkowa ciepła woda", "engangsoppvarming", "charge unique", "", "carica singola") +MAKE_TRANSLATION(wwDisinfecting, "wwdisinfecting", "disinfecting", "Desinfizieren", "Desinfectie", "Desinficerar", "dezynfekcja termiczna", "desinfiserer", "désinfection", "", "disinfezione") +MAKE_TRANSLATION(wwCharging, "wwcharging", "charging", "Laden", "Laden", "Värmer", "grzanie", "varmer", "chargement", "", "caricamento") +MAKE_TRANSLATION(wwChargeOptimization, "wwchargeoptimization", "charge optimization", "Ladungsoptimierung", "laadoptimalisatie", "Laddningsoptimering", "optymalizacja grzania", "oppvarmingsoptimalisering", "optimisation charge", "", "ottimizzazione carica") +MAKE_TRANSLATION(wwRecharging, "wwrecharging", "recharging", "Nachladen", "herladen", "Laddar om", "ponowne grzanie", "varm på nytt", "en recharge", "", "in ricarica") +MAKE_TRANSLATION(wwTempOK, "wwtempok", "temperature ok", "Temperatur ok", "Temperatuur OK", "Temperatur OK", "temperatura OK", "temperatur ok!", "température ok", "", "Temperatura OK") +MAKE_TRANSLATION(wwActive, "wwactive", "active", "aktiv", "Actief", "Aktiv", "aktywna", "aktiv", "actif", "", "attivo") +MAKE_TRANSLATION(ww3wayValve, "ww3wayvalve", "3-way valve active", "3-Wegeventil aktiv", "3-wegklep actief", "Trevägsventil aktiv", "zawór 3-drogowy aktywny", "aktiv trevisventil", "vanne 3 voies active", "", "valvola 3-vie") +MAKE_TRANSLATION(wwSetPumpPower, "wwsetpumppower", "set pump power", "Soll Pumpenleistung", "Streefwaarde pompvermogen", "Vald pumpeffekt", "ustawione wysterowanie pompy", "valgt pumpeeffekt", "régler puissance pompe", "", "imposta potenza pompa") +MAKE_TRANSLATION(wwMixerTemp, "wwmixertemp", "mixer temperature", "Mischertemperatur", "Mixertemperatuur", "Blandningsventil-tempertur", "temperatura mieszacza", "temperatur blandeventil", "température mélangeur", "", "temperatura miscelatore") +MAKE_TRANSLATION(wwStarts, "wwstarts", "starts", "Anzahl Starts", "Aantal starts", "Antal starter", "liczba załączeń", "antall starter", "démarrages", "", "avvii") +MAKE_TRANSLATION(wwStarts2, "wwstarts2", "control starts2", "Kreis 2 Anzahl Starts", "Aantal starts circuit 2", "Antal starter Krets 2", "liczba załączeń 2", "antall starter krets 2", "démarrages contrôle 2", "", "avvii controllati 2") +MAKE_TRANSLATION(wwWorkM, "wwworkm", "active time", "aktive Zeit", "Actieve tijd", "Aktiv Tid", "czas aktywności", "driftstid", "temps actif", "", "tempo attivo") +MAKE_TRANSLATION(wwHystOn, "wwhyston", "hysteresis on temperature", "Einschalttemperaturdifferenz", "Inschakeltemperatuurverschil", "Hysteres PÅ-temperatur", "histereza załączania", "innkoblingstemperaturforskjell", "hystérésis température allumage", "", "differenza di temperatura di accensione") +MAKE_TRANSLATION(wwHystOff, "wwhystoff", "hysteresis off temperature", "Ausschalttemperaturdifferenz", "Uitschakeltemperatuurverschil", "Hysteres AV-temperatur", "histereza wyłączania", "utkoblingstemperaturforskjell", "hystérésis température extinction", "", "differenza di temperatura di spegnimento") +MAKE_TRANSLATION(wwProgMode, "wwprogmode", "program", "Programmmodus", "Programma", "Program", "program", "program", "programme", "", "Programma") +MAKE_TRANSLATION(wwCircProg, "wwcircprog", "circulation program", "Zirkulationsprogramm", "Circulatieprogramma", "Cirkulationsprogram", "program cyrkulacji c.w.u.", "sirkulationsprogram", "programme circulation", "", "programma circolazione") +MAKE_TRANSLATION(wwMaxTemp, "wwmaxtemp", "maximum temperature", "Maximale Temperatur", "Maximale temperatuur", "Maximal Temperatur", "temperatura maksymalna", "maksimal temperatur", "température max", "", "temperatura massima") +MAKE_TRANSLATION(wwOneTimeKey, "wwonetimekey", "one time key function", "Einmalladungstaste", "Knop voor eenmalig laden buffer", "Engångsfunktion", "przycisk jednorazowego ogrzania", "engangsknapp varme", "fonction touche unique", "", "pulsante funzione singola") +MAKE_TRANSLATION(wwSolarTemp, "wwsolartemp", "solar boiler temperature", "Solarboiler Temperatur", "Zonneboiler temperatuur", "Solpanel Temp", "temperatura zasobnika solarnego", "solpaneltemp", "température chaudière solaire", "", "temperatura pannello solare") // mqtt values / commands -MAKE_TRANSLATION(switchtime, "switchtime", "program switchtime", "Programm Schaltzeit", "Programma schakeltijd", "Program Bytestid", "program czasowy", "programbyttetid", "heure commutation programme", "") -MAKE_TRANSLATION(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_TRANSLATION(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", "") -MAKE_TRANSLATION(wwswitchtime, "wwswitchtime", "program switchtime", "Programm Schaltzeit", "Warm water programma schakeltijd", "Varmvattenprogram Bytestid", "program czasowy", "byttetid varmtvannsprogram", "heure commutation programme", "") -MAKE_TRANSLATION(wwcircswitchtime, "wwcircswitchtime", "circulation program switchtime", "Zirculationsprogramm Schaltzeit", "Schakeltijd circulatieprogramma", "Cirkulationsprogram Bytestid", "program cyrkulacji", "byttetid sirkulasjonsprogram", "heure commutation programme circulation", "") -MAKE_TRANSLATION(dateTime, "datetime", "date/time", "Datum/Zeit", "Datum/Tijd", "Datum/Tid", "data i godzina", "dato/tid", "date/heure", "") -MAKE_TRANSLATION(errorCode, "errorcode", "error code", "Fehlernummer", "Foutmeldingscode", "Felkod", "kod błędu", "feikode", "code erreur", "") -MAKE_TRANSLATION(ibaMainDisplay, "display", "display", "Anzeige", "Display", "Display", "wyświetlacz", "skjerm", "affichage", "") -MAKE_TRANSLATION(ibaLanguage, "language", "language", "Sprache", "Taal", "Sprak", "język", "språk", "langue", "") -MAKE_TRANSLATION(ibaClockOffset, "clockoffset", "clock offset", "Uhrkorrektur", "Klokcorrectie", "Tidskorrigering", "korekta zegara", "tidskorrigering", "offset horloge", "") -MAKE_TRANSLATION(ibaBuildingType, "building", "building type", "Gebäudetyp", "", "Byggnadstyp", "typ budynku", "bygningstype", "type bâtiment", "") // TODO translate -MAKE_TRANSLATION(heatingPID, "heatingpid", "heating PID", "Heizungs-PID", "", "Uppvärmning PID", "PID ogrzewania", "oppvarmings PID", "PID chauffage", "") // TODO translate -MAKE_TRANSLATION(ibaCalIntTemperature, "intoffset", "internal temperature offset", "Korrektur interner Temperatur", "", "Korrigering interntemperatur", "korekta temperatury w pomieszczeniu", "Korrigering interntemperatur", "offset température interne", "") // TODO translate -MAKE_TRANSLATION(ibaMinExtTemperature, "minexttemp", "minimal external temperature", "min. Aussentemperatur", "", "Min Extern Temperatur", "minimalna miejscowa temperatura zewnętrzna", "minimal eksterntemperatur", "température extérieure minimale", "") // TODO translate -MAKE_TRANSLATION(backlight, "backlight", "key backlight", "Gegenlicht", "Toetsverlichting", "Bakgrundsbelysning", "podświetlenie klawiatury", "bakgrunnsbelysning", "rétroéclairage touches", "") -MAKE_TRANSLATION(damping, "damping", "damping outdoor temperature", "Dämpfung der Außentemperatur", "Demping buitentemperatuur", "Utomhustemperatur dämpning", "tłumienie temperatury zewnętrznej", "demping av utetemperatur", "température extérieure minimale", "") -MAKE_TRANSLATION(tempsensor1, "inttemp1", "temperature sensor 1", "Temperatursensor 1", "Temperatuursensor 1", "Temperatursensor 1", "czujnik temperatury 1", "temperatursensor 1", "sonde température 1", "") -MAKE_TRANSLATION(tempsensor2, "inttemp2", "temperature sensor 2", "Temperatursensor 2", "Temperatuursensor 2", "Temperatursensor 2", "czujnik temperatury 2", "temperatursensor 2", "capteur température 2", "") -MAKE_TRANSLATION(dampedoutdoortemp, "dampedoutdoortemp", "damped outdoor temperature", "gedämpfte Außentemperatur", "Gedempte buitentemperatuur", "Utomhustemperatur dämpad", "tłumiona temperatura zewnętrzna", "dempet utetemperatur", "température extérieure amortie", "") -MAKE_TRANSLATION(floordrystatus, "floordry", "floor drying", "Estrichtrocknung", "Vloerdroogprogramma", "Golvtorkning", "suszenie jastrychu", "gulvtørkeprogram", "séchage sol", "") -MAKE_TRANSLATION(floordrytemp, "floordrytemp", "floor drying temperature", "Estrichtrocknungs Temperatur", "Temperatuur vloerdroogprogramma", "Golvtorkning Temperatur", "temperatura suszenia jastrychu", "gulvtørketemperatur", "température séchage sol", "") -MAKE_TRANSLATION(brightness, "brightness", "screen brightness", "Bildschirmhelligkeit", "Schermhelderheid", "Ljusstyrka", "jasność", "lysstyrke", "luminosité écran", "") -MAKE_TRANSLATION(autodst, "autodst", "automatic change daylight saving time", "automatische Sommerzeit Umstellung", "Automatische omschakeling zomer-wintertijd", "Automatisk växling sommar/vinter-tid", "automatycznie przełączaj na czas letni/zimowy", "automatisk skifte av sommer/vinter-tid", "changement automatique heure d'été", "") -MAKE_TRANSLATION(preheating, "preheating", "preheating in the clock program", "Vorheizen im Zeitprogramm", "Voorverwarming in het klokprogramma", "Förvärmning i tidsprogram", "podgrzewanie w programie czasowym", "forvarming i tidsprogram", "préchauffage dans programme horloge", "") -MAKE_TRANSLATION(offtemp, "offtemp", "temperature when mode is off", "Temperatur bei AUS", "Temperatuur bij UIT", "Temperatur Avslagen", "temperatura w trybie \"wył.\"", "temperatur avslått", "température lorsque mode désactivé", "") -MAKE_TRANSLATION(mixingvalves, "mixingvalves", "mixing valves", "Mischventile", "Mengkleppen", "Blandningsventiler", "zawory mieszające", "blandeventiler", "vannes mélange", "") -MAKE_TRANSLATION(pvEnableWw, "pvenableww", "enable raise dhw", "aktiviere Anhebung WW", "", "", "podwyższenie c.w.u. z PV", "aktivere hevet temperatur bereder", "", "") // TODO translate -MAKE_TRANSLATION(pvRaiseHeat, "pvraiseheat", "raise heating with PV", "Anhebung Heizen mit PV", "", "", "podwyższenie grzania z PV", "heve varmen med solpanel", "", "") // TODO translate -MAKE_TRANSLATION(pvLowerCool, "pvlowercool", "lower cooling with PV", "Kühlabsenkung mit PV", "", "", "obniżenie chłodzenia z PV", "nedre kjøling solpanel", "", "") // TODO translate - +MAKE_TRANSLATION(switchtime, "switchtime", "program switchtime", "Programm Schaltzeit", "Programma schakeltijd", "Program Bytestid", "program czasowy", "programbyttetid", "heure commutation programme", "", "ora commutazione programmata") +MAKE_TRANSLATION(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", "", "ora commutazione programma 1") +MAKE_TRANSLATION(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", "", "ora commutazione programma 2") +MAKE_TRANSLATION(wwswitchtime, "wwswitchtime", "program switchtime", "Programm Schaltzeit", "Warm water programma schakeltijd", "Varmvattenprogram Bytestid", "program czasowy", "byttetid varmtvannsprogram", "heure commutation programme", "", "Tempo di commutazione del programma") +MAKE_TRANSLATION(wwcircswitchtime, "wwcircswitchtime", "circulation program switchtime", "Zirculationsprogramm Schaltzeit", "Schakeltijd circulatieprogramma", "Cirkulationsprogram Bytestid", "program cyrkulacji", "byttetid sirkulasjonsprogram", "heure commutation programme circulation", "", "ora commutazione programma circolazione") +MAKE_TRANSLATION(dateTime, "datetime", "date/time", "Datum/Zeit", "Datum/Tijd", "Datum/Tid", "data i godzina", "dato/tid", "date/heure", "", "Data/Ora") +MAKE_TRANSLATION(errorCode, "errorcode", "error code", "Fehlernummer", "Foutmeldingscode", "Felkod", "kod błędu", "feikode", "code erreur", "", "codice errore") +MAKE_TRANSLATION(ibaMainDisplay, "display", "display", "Anzeige", "Display", "Display", "wyświetlacz", "skjerm", "affichage", "", "Display") +MAKE_TRANSLATION(ibaLanguage, "language", "language", "Sprache", "Taal", "Sprak", "język", "språk", "langue", "", "Lingua") +MAKE_TRANSLATION(ibaClockOffset, "clockoffset", "clock offset", "Uhrkorrektur", "Klokcorrectie", "Tidskorrigering", "korekta zegara", "tidskorrigering", "offset horloge", "", "correzione orario") +MAKE_TRANSLATION(ibaBuildingType, "building", "building type", "Gebäudetyp", "", "Byggnadstyp", "typ budynku", "bygningstype", "type bâtiment", "", "tipo di edificio") // TODO translate +MAKE_TRANSLATION(heatingPID, "heatingpid", "heating PID", "Heizungs-PID", "", "Uppvärmning PID", "PID ogrzewania", "oppvarmings PID", "PID chauffage", "", "PID-riscaldamento") // TODO translate +MAKE_TRANSLATION(ibaCalIntTemperature, "intoffset", "internal temperature offset", "Korrektur interner Temperatur", "", "Korrigering interntemperatur", "korekta temperatury w pomieszczeniu", "Korrigering interntemperatur", "offset température interne", "", "scostamento della temperatura interna") // TODO translate +MAKE_TRANSLATION(ibaMinExtTemperature, "minexttemp", "minimal external temperature", "min. Aussentemperatur", "", "Min Extern Temperatur", "minimalna miejscowa temperatura zewnętrzna", "minimal eksterntemperatur", "température extérieure minimale", "", "temperatura esterna minima") // TODO translate +MAKE_TRANSLATION(backlight, "backlight", "key backlight", "Gegenlicht", "Toetsverlichting", "Bakgrundsbelysning", "podświetlenie klawiatury", "bakgrunnsbelysning", "rétroéclairage touches", "", "retroilluminazione dei tasti") +MAKE_TRANSLATION(damping, "damping", "damping outdoor temperature", "Dämpfung der Außentemperatur", "Demping buitentemperatuur", "Utomhustemperatur dämpning", "tłumienie temperatury zewnętrznej", "demping av utetemperatur", "température extérieure minimale", "", "smorzamento della temperatura esterna") +MAKE_TRANSLATION(tempsensor1, "inttemp1", "temperature sensor 1", "Temperatursensor 1", "Temperatuursensor 1", "Temperatursensor 1", "czujnik temperatury 1", "temperatursensor 1", "sonde température 1", "", "sensore temperatura 1") +MAKE_TRANSLATION(tempsensor2, "inttemp2", "temperature sensor 2", "Temperatursensor 2", "Temperatuursensor 2", "Temperatursensor 2", "czujnik temperatury 2", "temperatursensor 2", "capteur température 2", "", "sensore temperatura 2") +MAKE_TRANSLATION(dampedoutdoortemp, "dampedoutdoortemp", "damped outdoor temperature", "gedämpfte Außentemperatur", "Gedempte buitentemperatuur", "Utomhustemperatur dämpad", "tłumiona temperatura zewnętrzna", "dempet utetemperatur", "température extérieure amortie", "", "temperatura esterna smorzata") +MAKE_TRANSLATION(floordrystatus, "floordry", "floor drying", "Estrichtrocknung", "Vloerdroogprogramma", "Golvtorkning", "suszenie jastrychu", "gulvtørkeprogram", "séchage sol", "", "asciugatura pavimento") +MAKE_TRANSLATION(floordrytemp, "floordrytemp", "floor drying temperature", "Estrichtrocknungs Temperatur", "Temperatuur vloerdroogprogramma", "Golvtorkning Temperatur", "temperatura suszenia jastrychu", "gulvtørketemperatur", "température séchage sol", "", "Temperatura asciugatura pavimento") +MAKE_TRANSLATION(brightness, "brightness", "screen brightness", "Bildschirmhelligkeit", "Schermhelderheid", "Ljusstyrka", "jasność", "lysstyrke", "luminosité écran", "", "luminosita display") +MAKE_TRANSLATION(autodst, "autodst", "automatic change daylight saving time", "automatische Sommerzeit Umstellung", "Automatische omschakeling zomer-wintertijd", "Automatisk växling sommar/vinter-tid", "automatycznie przełączaj na czas letni/zimowy", "automatisk skifte av sommer/vinter-tid", "changement automatique heure d'été", "", "cambio automatico dell'ora legale") +MAKE_TRANSLATION(preheating, "preheating", "preheating in the clock program", "Vorheizen im Zeitprogramm", "Voorverwarming in het klokprogramma", "Förvärmning i tidsprogram", "podgrzewanie w programie czasowym", "forvarming i tidsprogram", "préchauffage dans programme horloge", "", "preriscaldamento nel programma orologio") +MAKE_TRANSLATION(offtemp, "offtemp", "temperature when mode is off", "Temperatur bei AUS", "Temperatuur bij UIT", "Temperatur Avslagen", "temperatura w trybie \"wył.\"", "temperatur avslått", "température lorsque mode désactivé", "", "temperatura quando la modalità è disattivata") +MAKE_TRANSLATION(mixingvalves, "mixingvalves", "mixing valves", "Mischventile", "Mengkleppen", "Blandningsventiler", "zawory mieszające", "blandeventiler", "vannes mélange", "", "valvole miscela") +MAKE_TRANSLATION(pvEnableWw, "pvenableww", "enable raise dhw", "aktiviere Anhebung WW", "", "", "podwyższenie c.w.u. z PV", "aktivere hevet temperatur bereder", "", "", "abilitare aumento ACS") // TODO translate +MAKE_TRANSLATION(pvRaiseHeat, "pvraiseheat", "raise heating with PV", "Anhebung Heizen mit PV", "", "", "podwyższenie grzania z PV", "heve varmen med solpanel", "", "", "Aumentare il riscaldamento con il solare") // TODO translate +MAKE_TRANSLATION(pvLowerCool, "pvlowercool", "lower cooling with PV", "Kühlabsenkung mit PV", "", "", "obniżenie chłodzenia z PV", "nedre kjøling solpanel", "", "", "Riduzione del raffreddamento con il solare") // TODO translate // thermostat ww -MAKE_TRANSLATION(wwMode, "wwmode", "mode", "Modus", "Modus", "Läge", "tryb pracy", "modus", "mode", "") -MAKE_TRANSLATION(wwSetTempLow, "wwsettemplow", "set low temperature", "untere Solltemperatur", "Onderste streeftemperatuur", "Nedre Börvärde", "zadana temperatura obniżona", "nedre settverdi", "réglage température basse", "") -MAKE_TRANSLATION(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_TRANSLATION(wwExtra1, "wwextra1", "circuit 1 extra", "Kreis 1 Extra", "Circuit 1 extra", "Krets 1 Extra", "obieg dodatkowy 1", "ekstra krets 1", "circuit 1 extra", "") -MAKE_TRANSLATION(wwExtra2, "wwextra2", "circuit 2 extra", "Kreis 2 Extra", "Circuit 2 extra", "Kets 2 Extra", "obieg dodatkowy 2", "ekstra krets 2", "circuit 2 extra", "") -MAKE_TRANSLATION(wwCharge, "wwcharge", "charge", "Laden", "Laden", "Ladda", "grzanie", "lade", "charge", "") -MAKE_TRANSLATION(wwChargeDuration, "wwchargeduration", "charge duration", "Ladedauer", "Laadtijd", "Laddtid", "czas grzania dodatkowej ciepłej wody", "ladetid", "durée charge", "") -MAKE_TRANSLATION(wwDisinfect, "wwdisinfect", "disinfection", "Desinfektion", "Desinfectie", "Desinfektion", "dezynfekcja termiczna", "desinfeksjon", "désinfection", "") -MAKE_TRANSLATION(wwDisinfectDay, "wwdisinfectday", "disinfection day", "Desinfektionstag", "Desinfectiedag", "Desinfektionsdag", "dzień dezynfekcji termicznej", "desinfeksjonsdag", "jour désinfection", "") -MAKE_TRANSLATION(wwDisinfectHour, "wwdisinfecthour", "disinfection hour", "Desinfektionsstunde", "Desinfectieuur", "Desinfektionstimme", "godzina dezynfekcji termicznej", "desinfeksjonstime", "heure désinfection", "") -MAKE_TRANSLATION(wwDisinfectTime, "wwdisinfecttime", "disinfection time", "Desinfektionsdauer", "Desinfectietijd", "Desinfektionstid", "maksymalny czas trwania dezynfekcji termicznej", "desinfeksjonstid", "durée désinfection", "") -MAKE_TRANSLATION(wwDailyHeating, "wwdailyheating", "daily heating", "täglich Heizen", "Dagelijks opwarmen", "Daglig Uppvärmning", "codzienne nagrzewanie", "daglig oppvarming", "chauffage quotidien", "") // TODO translate -MAKE_TRANSLATION(wwDailyHeatTime, "wwdailyheattime", "daily heating time", "tägliche Heizzeit", "Tijd dagelijkse opwarming", "Daglig Uppvärmningstid", "czas trwania codziennego nagrzewania", "daglig oppvarmingstid", "heure chauffage quotidien", "") +MAKE_TRANSLATION(wwMode, "wwmode", "mode", "Modus", "Modus", "Läge", "tryb pracy", "modus", "mode", "", "Modus") +MAKE_TRANSLATION(wwSetTempLow, "wwsettemplow", "set low temperature", "untere Solltemperatur", "Onderste streeftemperatuur", "Nedre Börvärde", "zadana temperatura obniżona", "nedre settverdi", "réglage température basse", "", "imposta bassa temperatura") +MAKE_TRANSLATION(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", "", "quando termostato modalita OFF") +MAKE_TRANSLATION(wwExtra1, "wwextra1", "circuit 1 extra", "Kreis 1 Extra", "Circuit 1 extra", "Krets 1 Extra", "obieg dodatkowy 1", "ekstra krets 1", "circuit 1 extra", "", "Circuito 1 extra") +MAKE_TRANSLATION(wwExtra2, "wwextra2", "circuit 2 extra", "Kreis 2 Extra", "Circuit 2 extra", "Kets 2 Extra", "obieg dodatkowy 2", "ekstra krets 2", "circuit 2 extra", "", "Circuito 2 extra") +MAKE_TRANSLATION(wwCharge, "wwcharge", "charge", "Laden", "Laden", "Ladda", "grzanie", "lade", "charge", "", "carica") +MAKE_TRANSLATION(wwChargeDuration, "wwchargeduration", "charge duration", "Ladedauer", "Laadtijd", "Laddtid", "czas grzania dodatkowej ciepłej wody", "ladetid", "durée charge", "", "durata carica") +MAKE_TRANSLATION(wwDisinfect, "wwdisinfect", "disinfection", "Desinfektion", "Desinfectie", "Desinfektion", "dezynfekcja termiczna", "desinfeksjon", "désinfection", "", "disinfezione") +MAKE_TRANSLATION(wwDisinfectDay, "wwdisinfectday", "disinfection day", "Desinfektionstag", "Desinfectiedag", "Desinfektionsdag", "dzień dezynfekcji termicznej", "desinfeksjonsdag", "jour désinfection", "", "giorno disinfezione") +MAKE_TRANSLATION(wwDisinfectHour, "wwdisinfecthour", "disinfection hour", "Desinfektionsstunde", "Desinfectieuur", "Desinfektionstimme", "godzina dezynfekcji termicznej", "desinfeksjonstime", "heure désinfection", "", "ora disinfezione") +MAKE_TRANSLATION(wwDisinfectTime, "wwdisinfecttime", "disinfection time", "Desinfektionsdauer", "Desinfectietijd", "Desinfektionstid", "maksymalny czas trwania dezynfekcji termicznej", "desinfeksjonstid", "durée désinfection", "", "orario disinfezione") +MAKE_TRANSLATION(wwDailyHeating, "wwdailyheating", "daily heating", "täglich Heizen", "Dagelijks opwarmen", "Daglig Uppvärmning", "codzienne nagrzewanie", "daglig oppvarming", "chauffage quotidien", "", "riscaldamento giornaliero") +MAKE_TRANSLATION(wwDailyHeatTime, "wwdailyheattime", "daily heating time", "tägliche Heizzeit", "Tijd dagelijkse opwarming", "Daglig Uppvärmningstid", "czas trwania codziennego nagrzewania", "daglig oppvarmingstid", "heure chauffage quotidien", "", "orario riscaldamento giornaliero") // thermostat hc -MAKE_TRANSLATION(selRoomTemp, "seltemp", "selected room temperature", "Sollwert Raumtemperatur", "Streeftemperatuur kamer", "Vald Rumstemperatur", "zadana temperatura w pomieszczeniu", "valgt rumstemperatur", "température ambiante sélectionnée", "") -MAKE_TRANSLATION(roomTemp, "currtemp", "current room temperature", "aktuelle Raumtemperatur", "Huidige kamertemperatuur", "Aktuell Rumstemperatur", "temperatura w pomieszczeniu", "gjeldende romstemperatur", "température ambiante actuelle", "") -MAKE_TRANSLATION(mode, "mode", "mode", "Modus", "Modus", "Läge", "sposób sterowania", "modus", "mode", "") -MAKE_TRANSLATION(modetype, "modetype", "mode type", "Modus Typ", "Type modus", "Typ av läge", "aktualny tryb pracy", "modusrype", "type mode", "") -MAKE_TRANSLATION(fastheatup, "fastheatup", "fast heatup", "schnelles Aufheizen", "Snel opwarmen", "Snabb Uppvärmning", "szybkie nagrzewanie", "rask oppvarming", "chauffage rapide", "") -MAKE_TRANSLATION(daytemp, "daytemp", "day temperature", "Tagestemperatur", "temperatuur dag", "Dagstemperatur", "temperatura w dzień", "dagtemperatur", "température jour", "") -MAKE_TRANSLATION(daylowtemp, "daytemp2", "day temperature T2", "Tagestemperatur T2", "Temperatuur dag T2", "Dagstemperatur T2", "temperatura w dzień T2", "dagtemperatur T2", "température jour T2", "") -MAKE_TRANSLATION(daymidtemp, "daytemp3", "day temperature T3", "Tagestemperatur T3", "Temperatuur dag T3", "Dagstemperatur T3", "temperatura w dzień T3", "dagtemperatur T3", "température jour T3", "") -MAKE_TRANSLATION(dayhightemp, "daytemp4", "day temperature T4", "Tagestemperatur T4", "Temperatuur dag T4", "Dagstemperatur T4", "temperatura w dzień T4", "dagtemperatur T4", "température jour T4", "") -MAKE_TRANSLATION(heattemp, "heattemp", "heat temperature", "Heizen Temperatur", "Temperatuur verwarming", "Temperatur Uppvärmning", "temperatura ogrzewania", "oppvarmingstemperatur", "température chauffage", "") -MAKE_TRANSLATION(nighttemp, "nighttemp", "night temperature", "Nachttemperatur", "Nachttemperatuur", "Nattemperatur", "temperatura w nocy", "nattemperatur", "température de nuit", "") -MAKE_TRANSLATION(nighttemp2, "nighttemp", "night temperature T1", "Nachttemperatur T1", "Nachttemperatuur T1", "Nattemperatur T1", "temperatura w nocy T1", "nattemperatur T1", "température nuit T1", "") -MAKE_TRANSLATION(ecotemp, "ecotemp", "eco temperature", "eco Temperatur", "Temperatuur eco", "Eko-temperatur", "temperatura w trybie eko", "øko temperatur", "température éco", "") -MAKE_TRANSLATION(manualtemp, "manualtemp", "manual temperature", "manuelle Temperatur", "Temperatuur handmatig", "Temperatur Manuell", "temperatura ustawiona ręcznie", "manuell temperatur", "température manuelle", "") -MAKE_TRANSLATION(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_TRANSLATION(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_TRANSLATION(comforttemp, "comforttemp", "comfort temperature", "Komforttemperatur", "Comforttemperatuur", "Komforttemperatur", "temperatura w trybie komfort", "komforttemperatur", "température confort", "") -MAKE_TRANSLATION(summertemp, "summertemp", "summer temperature", "Sommertemperatur", "Zomertemperatuur", "Sommartemperatur", "temperatura przełączania lato/zima", "Sommertemperatur", "température été", "") -MAKE_TRANSLATION(designtemp, "designtemp", "design temperature", "Auslegungstemperatur", "Ontwerptemperatuur", "Design-temperatur", "temperatura projektowa", "designtemperatur", "température conception", "") -MAKE_TRANSLATION(offsettemp, "offsettemp", "offset temperature", "Temperaturanhebung", "Temperatuur offset", "Temperaturkorrigering", "korekta temperatury", "temperaturkorrigering", "température offset", "") -MAKE_TRANSLATION(minflowtemp, "minflowtemp", "min flow temperature", "min Vorlauftemperatur", "", "Min Flödestemperatur", "minimalna temperatura zasilania", "min turtemperatur", "température min flux", "") // TODO translate -MAKE_TRANSLATION(maxflowtemp, "maxflowtemp", "max flow temperature", "max Vorlauftemperatur", "", "Max Flödestemperatur", "maksymalna temperatura zasilania", "maks turtemperatur", "température max flux", "") // TODO translate -MAKE_TRANSLATION(roominfluence, "roominfluence", "room influence", "Raumeinfluss", "Ruimteinvloed", "Rumspåverkan", "wpływ pomieszczenia", "rominnflytelse", "influence pièce", "") -MAKE_TRANSLATION(roominfl_factor, "roominflfactor", "room influence factor", "Raumeinflussfaktor", "Factor ruimteinvloed", "Rumspåverkansfaktor", "współczynnik wpływu pomieszczenia", "rominnflytelsesfaktor", "facteur d'influence pièce", "") -MAKE_TRANSLATION(curroominfl, "curroominfl", "current room influence", "aktueller Raumeinfluss", "Huidige ruimteinvloed", "Aktuell Rumspåverkan", "aktualny wpływ pomieszczenia", "gjeldende rominnflytelse", "influence actuelle pièce", "") -MAKE_TRANSLATION(nofrosttemp, "nofrosttemp", "nofrost temperature", "Frostschutztemperatur", "Temperatuur vorstbeveiliging", "Temperatur Frostskydd", "temperatura ochrony przed zamarzaniem", "frostbeskyttelsestemperatur", "température protection gel", "") -MAKE_TRANSLATION(targetflowtemp, "targetflowtemp", "target flow temperature", "berechnete Vorlauftemperatur", "Berekende aanvoertemperatuur", "Målvärde Flödestemperatur", "zadana temperatura zasilania", "målverdi turtemperatur", "température cible flux", "") -MAKE_TRANSLATION(heatingtype, "heatingtype", "heating type", "Heizungstyp", "Verwarmingstype", "Värmesystem", "system grzewczy", "varmesystem", "type chauffage", "") -MAKE_TRANSLATION(summersetmode, "summersetmode", "set summer mode", "Einstellung Sommerbetrieb", "Instelling zomerbedrijf", "Aktivera Sommarläge", "tryb lato/zima", "aktiver sommermodus", "activer mode été", "") -MAKE_TRANSLATION(hpoperatingmode, "hpoperatingmode", "heatpump operating mode", "Wärmepumpe Betriebsmodus", "Bedrijfsmodus warmtepomp", "Värmepump Driftläge", "tryb pracy pompy ciepła", "driftsmodus varmepumpe", "mode fonctionnement pompe à chaleur", "") -MAKE_TRANSLATION(hpoperatingstate, "hpoperatingstate", "heatpump operating state", "WP Arbeitsweise", "Huidige modus warmtepomp", "Värmepump driftläge", "aktualny tryb pracy pompy ciepła", "driftstatus varmepumpe", "état fonctionnement pompe à chaleur", "") -MAKE_TRANSLATION(controlmode, "controlmode", "control mode", "Kontrollmodus", "Comtrolemodus", "Kontrolläge", "tryb sterowania", "kontrollmodus", "mode régulation", "") -MAKE_TRANSLATION(control, "control", "control device", "Fernsteuerung", "Afstandsbedieding", "Kontrollenhet", "sterownik", "kontrollenhet", "dispositif régulation", "") -MAKE_TRANSLATION(roomsensor, "roomsensor", "room sensor", "Raumsensor", "Ruimtesensor", "Rumssensor", "czujnik temperatury pomieszczenia", "romsensor", "capteur pièce", "") -MAKE_TRANSLATION(program, "program", "program", "Programm", "Programma", "Program", "program", "program", "programme") -MAKE_TRANSLATION(pause, "pause", "pause time", "Pausenzeit", "Pausetijd", "Paustid", "czas przerwy", "pausetid", "temps de pause") -MAKE_TRANSLATION(party, "party", "party time", "Partyzeit", "Partytijd", "Partytid", "czas przyjęcia", "partytid", "temps de fête") -MAKE_TRANSLATION(holidaytemp, "holidaytemp", "holiday temperature", "Urlaubstemperatur", "Vakantietemperatuur", "Helgtemperatur", "temperatura w trybie urlopowym", "ferietemperatur", "température vacances", "") -MAKE_TRANSLATION(summermode, "summermode", "summer mode", "Sommerbetrieb", "Zomerbedrijf", "Sommarläge", "aktualny tryb lato/zima", "sommermodus", "mode été", "") -MAKE_TRANSLATION(holidaymode, "holidaymode", "holiday mode", "Urlaubsbetrieb", "Vakantiebedrijf", "Helgläge", "tryb urlopowy", "feriemodus", "mode vacances", "") -MAKE_TRANSLATION(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_TRANSLATION(reducemode, "reducemode", "reduce mode", "Absenkmodus", "Gereduceerde modus", "Reducerat Läge", "tryb zredukowany/obniżony", "redusert modus", "mode réduction", "") // TODO translate -MAKE_TRANSLATION(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_TRANSLATION(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_TRANSLATION(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_TRANSLATION(vacreducemode, "vacreducemode", "vacations reduce mode", "Urlaub Absenkmodus", "Vakantie afschakelmodus", "Helg reduceringsläge", "redukcja w trakcie urlopu", "ferieavstengningsmodus", "mode réduction vacances", "") -MAKE_TRANSLATION(nofrostmode, "nofrostmode", "nofrost mode", "Frostschutz Modus", "Vorstbeveiligingsmodus", "Frostskyddsläge", "temperatura wiodąca dla ochrony przed zamarzaniem", "frostbeskyttelsesmodus", "mode protection gel", "") -MAKE_TRANSLATION(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_TRANSLATION(wwHolidays, "wwholidays", "holiday dates", "Feiertage", "Feestdagen", "Helgdagar", "dni świąteczne", "feriedager varmtvann", "dates vacances", "") -MAKE_TRANSLATION(wwVacations, "wwvacations", "vacation dates", "Urlaubstage", "Vakantiedagen", "Semesterdatum Varmvatten", "dni urlopowe", "ferie dato varmtvann", "dates vacances", "") -MAKE_TRANSLATION(holidays, "holidays", "holiday dates", "Feiertage", "Feestdagen", "Helgdatum", "święta", "helligdager", "dates vacances", "") -MAKE_TRANSLATION(vacations, "vacations", "vacation dates", "Urlaubstage", "Vakantiedagen", "Semesterdatum", "urlop", "feriedager", "dates vacances", "") -MAKE_TRANSLATION(wwprio, "wwprio", "dhw priority", "WW-Vorrang", "Prioriteit warm water", "Prioritera Varmvatten", "priorytet dla c.w.u.", "prioroter varmtvann", "priorité ecs", "") -MAKE_TRANSLATION(nofrostmode1, "nofrostmode1", "nofrost mode", "Frostschutz", "Vorstbeveiligingsmodus", "Frostskyddsläge", "ochrona przed zamarzaniem", "frostbeskyttelse", "mode protection gel", "") -MAKE_TRANSLATION(reducehours, "reducehours", "duration for nighttemp", "Dauer Nachttemp.", "Duur nachtverlaging", "Timmar Nattsänkning", "czas trwania trybu nocnego", "timer nattsenkning", "durée température nuit", "") -MAKE_TRANSLATION(reduceminutes, "reduceminutes", "remaining time for nightmode", "Restzeit Nachttemp.", "Resterende tijd nachtverlaging", "Återstående Tid Nattläge", "czas do końca trybu nocnego", "gjenværende tid i nattstilling", "temps restant mode nuit", "") -MAKE_TRANSLATION(switchonoptimization, "switchonoptimization", "switch-on optimization", "Einschaltoptimierung", "Inschakeloptimalisering", "Växlingsoptimering", "optymalizacja załączania", "slå på optimalisering", "optimisation mise en marche", "") +MAKE_TRANSLATION(selRoomTemp, "seltemp", "selected room temperature", "Sollwert Raumtemperatur", "Streeftemperatuur kamer", "Vald Rumstemperatur", "zadana temperatura w pomieszczeniu", "valgt rumstemperatur", "température ambiante sélectionnée", "", "temperatura ambiente selezionata") +MAKE_TRANSLATION(roomTemp, "currtemp", "current room temperature", "aktuelle Raumtemperatur", "Huidige kamertemperatuur", "Aktuell Rumstemperatur", "temperatura w pomieszczeniu", "gjeldende romstemperatur", "température ambiante actuelle", "", "temperatura ambiente attuale") +MAKE_TRANSLATION(mode, "mode", "mode", "Modus", "Modus", "Läge", "sposób sterowania", "modus", "mode", "", "Modus") +MAKE_TRANSLATION(modetype, "modetype", "mode type", "Modus Typ", "Type modus", "Typ av läge", "aktualny tryb pracy", "modusrype", "type mode", "", "tipo di modalita") +MAKE_TRANSLATION(fastheatup, "fastheatup", "fast heatup", "schnelles Aufheizen", "Snel opwarmen", "Snabb Uppvärmning", "szybkie nagrzewanie", "rask oppvarming", "chauffage rapide", "", "riscaldamento rapido") +MAKE_TRANSLATION(daytemp, "daytemp", "day temperature", "Tagestemperatur", "temperatuur dag", "Dagstemperatur", "temperatura w dzień", "dagtemperatur", "température jour", "", "temperatura giornaliera") +MAKE_TRANSLATION(daylowtemp, "daytemp2", "day temperature T2", "Tagestemperatur T2", "Temperatuur dag T2", "Dagstemperatur T2", "temperatura w dzień T2", "dagtemperatur T2", "température jour T2", "", "temperatura giornaliera T2") +MAKE_TRANSLATION(daymidtemp, "daytemp3", "day temperature T3", "Tagestemperatur T3", "Temperatuur dag T3", "Dagstemperatur T3", "temperatura w dzień T3", "dagtemperatur T3", "température jour T3", "", "temperatura giornaliera T3") +MAKE_TRANSLATION(dayhightemp, "daytemp4", "day temperature T4", "Tagestemperatur T4", "Temperatuur dag T4", "Dagstemperatur T4", "temperatura w dzień T4", "dagtemperatur T4", "température jour T4", "", "temperatura giornaliera T4") +MAKE_TRANSLATION(heattemp, "heattemp", "heat temperature", "Heizen Temperatur", "Temperatuur verwarming", "Temperatur Uppvärmning", "temperatura ogrzewania", "oppvarmingstemperatur", "température chauffage", "", "temperatura riscaldamento") +MAKE_TRANSLATION(nighttemp, "nighttemp", "night temperature", "Nachttemperatur", "Nachttemperatuur", "Nattemperatur", "temperatura w nocy", "nattemperatur", "température de nuit", "", "temperatura notturna") +MAKE_TRANSLATION(nighttemp2, "nighttemp", "night temperature T1", "Nachttemperatur T1", "Nachttemperatuur T1", "Nattemperatur T1", "temperatura w nocy T1", "nattemperatur T1", "température nuit T1", "", "temperatura notturna T1") +MAKE_TRANSLATION(ecotemp, "ecotemp", "eco temperature", "eco Temperatur", "Temperatuur eco", "Eko-temperatur", "temperatura w trybie eko", "øko temperatur", "température éco", "", "Temperatura eco") +MAKE_TRANSLATION(manualtemp, "manualtemp", "manual temperature", "manuelle Temperatur", "Temperatuur handmatig", "Temperatur Manuell", "temperatura ustawiona ręcznie", "manuell temperatur", "température manuelle", "", "temperatura manuale") +MAKE_TRANSLATION(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", "", "impostare temporaneamente temperatura automatica") +MAKE_TRANSLATION(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", "", "Temperatura temporanea da remoto") +MAKE_TRANSLATION(comforttemp, "comforttemp", "comfort temperature", "Komforttemperatur", "Comforttemperatuur", "Komforttemperatur", "temperatura w trybie komfort", "komforttemperatur", "température confort", "", "temperatura comfort") +MAKE_TRANSLATION(summertemp, "summertemp", "summer temperature", "Sommertemperatur", "Zomertemperatuur", "Sommartemperatur", "temperatura przełączania lato/zima", "Sommertemperatur", "température été", "", "temperatura estiva") +MAKE_TRANSLATION(designtemp, "designtemp", "design temperature", "Auslegungstemperatur", "Ontwerptemperatuur", "Design-temperatur", "temperatura projektowa", "designtemperatur", "température conception", "", "temperatura predefinita") +MAKE_TRANSLATION(offsettemp, "offsettemp", "offset temperature", "Temperaturanhebung", "Temperatuur offset", "Temperaturkorrigering", "korekta temperatury", "temperaturkorrigering", "température offset", "", "aumento della temperatura") +MAKE_TRANSLATION(minflowtemp, "minflowtemp", "min flow temperature", "min Vorlauftemperatur", "", "Min Flödestemperatur", "minimalna temperatura zasilania", "min turtemperatur", "température min flux", "", "temperatura minima di mandata") // TODO translate +MAKE_TRANSLATION(maxflowtemp, "maxflowtemp", "max flow temperature", "max Vorlauftemperatur", "", "Max Flödestemperatur", "maksymalna temperatura zasilania", "maks turtemperatur", "température max flux", "", "temperatura massima di mandata") // TODO translate +MAKE_TRANSLATION(roominfluence, "roominfluence", "room influence", "Raumeinfluss", "Ruimteinvloed", "Rumspåverkan", "wpływ pomieszczenia", "rominnflytelse", "influence pièce", "", "influenza della camera") +MAKE_TRANSLATION(roominfl_factor, "roominflfactor", "room influence factor", "Raumeinflussfaktor", "Factor ruimteinvloed", "Rumspåverkansfaktor", "współczynnik wpływu pomieszczenia", "rominnflytelsesfaktor", "facteur d'influence pièce", "", "fattore influenza camera") +MAKE_TRANSLATION(curroominfl, "curroominfl", "current room influence", "aktueller Raumeinfluss", "Huidige ruimteinvloed", "Aktuell Rumspåverkan", "aktualny wpływ pomieszczenia", "gjeldende rominnflytelse", "influence actuelle pièce", "", "fattore corrente influenza camera") +MAKE_TRANSLATION(nofrosttemp, "nofrosttemp", "nofrost temperature", "Frostschutztemperatur", "Temperatuur vorstbeveiliging", "Temperatur Frostskydd", "temperatura ochrony przed zamarzaniem", "frostbeskyttelsestemperatur", "température protection gel", "", "temperatura protezione antigelo") +MAKE_TRANSLATION(targetflowtemp, "targetflowtemp", "target flow temperature", "berechnete Vorlauftemperatur", "Berekende aanvoertemperatuur", "Målvärde Flödestemperatur", "zadana temperatura zasilania", "målverdi turtemperatur", "température cible flux", "", "temperatura di mandata calcolata") +MAKE_TRANSLATION(heatingtype, "heatingtype", "heating type", "Heizungstyp", "Verwarmingstype", "Värmesystem", "system grzewczy", "varmesystem", "type chauffage", "", "tipo riscaldamento") +MAKE_TRANSLATION(summersetmode, "summersetmode", "set summer mode", "Einstellung Sommerbetrieb", "Instelling zomerbedrijf", "Aktivera Sommarläge", "tryb lato/zima", "aktiver sommermodus", "activer mode été", "", "Impostazione della modalità estiva") +MAKE_TRANSLATION(hpoperatingmode, "hpoperatingmode", "heatpump operating mode", "Wärmepumpe Betriebsmodus", "Bedrijfsmodus warmtepomp", "Värmepump Driftläge", "tryb pracy pompy ciepła", "driftsmodus varmepumpe", "mode fonctionnement pompe à chaleur", "", "Modalità di funzionamento della pompa di calore") +MAKE_TRANSLATION(hpoperatingstate, "hpoperatingstate", "heatpump operating state", "WP Arbeitsweise", "Huidige modus warmtepomp", "Värmepump driftläge", "aktualny tryb pracy pompy ciepła", "driftstatus varmepumpe", "état fonctionnement pompe à chaleur", "", "stato funzionamento pompa di calore") +MAKE_TRANSLATION(controlmode, "controlmode", "control mode", "Kontrollmodus", "Comtrolemodus", "Kontrolläge", "tryb sterowania", "kontrollmodus", "mode régulation", "", "modalità di controllo") +MAKE_TRANSLATION(control, "control", "control device", "Fernsteuerung", "Afstandsbedieding", "Kontrollenhet", "sterownik", "kontrollenhet", "dispositif régulation", "", "dispositivo di comando") +MAKE_TRANSLATION(roomsensor, "roomsensor", "room sensor", "Raumsensor", "Ruimtesensor", "Rumssensor", "czujnik temperatury pomieszczenia", "romsensor", "capteur pièce", "", "sensore ambiente") +MAKE_TRANSLATION(program, "program", "program", "Programm", "Programma", "Program", "program", "program", "programme", "", "Programma") +MAKE_TRANSLATION(pause, "pause", "pause time", "Pausenzeit", "Pausetijd", "Paustid", "czas przerwy", "pausetid", "temps de pause", "", "pausa") +MAKE_TRANSLATION(party, "party", "party time", "Partyzeit", "Partytijd", "Partytid", "czas przyjęcia", "partytid", "temps de fête", "", "festivo") +MAKE_TRANSLATION(holidaytemp, "holidaytemp", "holiday temperature", "Urlaubstemperatur", "Vakantietemperatuur", "Helgtemperatur", "temperatura w trybie urlopowym", "ferietemperatur", "température vacances", "", "temperatura festiva") +MAKE_TRANSLATION(summermode, "summermode", "summer mode", "Sommerbetrieb", "Zomerbedrijf", "Sommarläge", "aktualny tryb lato/zima", "sommermodus", "mode été", "", "funzionamento estivo") +MAKE_TRANSLATION(holidaymode, "holidaymode", "holiday mode", "Urlaubsbetrieb", "Vakantiebedrijf", "Helgläge", "tryb urlopowy", "feriemodus", "mode vacances", "", "modalita vacanze") +MAKE_TRANSLATION(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", "", "aumento della temperatura di ritorno") +MAKE_TRANSLATION(reducemode, "reducemode", "reduce mode", "Absenkmodus", "Gereduceerde modus", "Reducerat Läge", "tryb zredukowany/obniżony", "redusert modus", "mode réduction", "", "modalità assente") +MAKE_TRANSLATION(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", "", "non ridurre temperatura sotto") +MAKE_TRANSLATION(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", "", "interruttore riduzione temperatura") +MAKE_TRANSLATION(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", "", "interruttore riduzione temperatura vacanze") +MAKE_TRANSLATION(vacreducemode, "vacreducemode", "vacations reduce mode", "Urlaub Absenkmodus", "Vakantie afschakelmodus", "Helg reduceringsläge", "redukcja w trakcie urlopu", "ferieavstengningsmodus", "mode réduction vacances", "", "modalita riduzione vacanze") +MAKE_TRANSLATION(nofrostmode, "nofrostmode", "nofrost mode", "Frostschutz Modus", "Vorstbeveiligingsmodus", "Frostskyddsläge", "temperatura wiodąca dla ochrony przed zamarzaniem", "frostbeskyttelsesmodus", "mode protection gel", "", "Modalità protezione antigelo") +MAKE_TRANSLATION(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", "", "temperatura ambiente da remoto") +MAKE_TRANSLATION(wwHolidays, "wwholidays", "holiday dates", "Feiertage", "Feestdagen", "Helgdagar", "dni świąteczne", "feriedager varmtvann", "dates vacances", "", "feste pubbliche") +MAKE_TRANSLATION(wwVacations, "wwvacations", "vacation dates", "Urlaubstage", "Vakantiedagen", "Semesterdatum Varmvatten", "dni urlopowe", "ferie dato varmtvann", "dates vacances", "", "date vacanze") +MAKE_TRANSLATION(holidays, "holidays", "holiday dates", "Feiertage", "Feestdagen", "Helgdatum", "święta", "helligdager", "dates vacances", "", "date feste pubbliche") +MAKE_TRANSLATION(vacations, "vacations", "vacation dates", "Urlaubstage", "Vakantiedagen", "Semesterdatum", "urlop", "feriedager", "dates vacances", "", "date vacanze") +MAKE_TRANSLATION(wwprio, "wwprio", "dhw priority", "WW-Vorrang", "Prioriteit warm water", "Prioritera Varmvatten", "priorytet dla c.w.u.", "prioroter varmtvann", "priorité ecs", "", "priorita acqua calda ") +MAKE_TRANSLATION(nofrostmode1, "nofrostmode1", "nofrost mode", "Frostschutz", "Vorstbeveiligingsmodus", "Frostskyddsläge", "ochrona przed zamarzaniem", "frostbeskyttelse", "mode protection gel", "", "modalita protezione antigelo") +MAKE_TRANSLATION(reducehours, "reducehours", "duration for nighttemp", "Dauer Nachttemp.", "Duur nachtverlaging", "Timmar Nattsänkning", "czas trwania trybu nocnego", "timer nattsenkning", "durée température nuit", "", "durata temperatura notturna") +MAKE_TRANSLATION(reduceminutes, "reduceminutes", "remaining time for nightmode", "Restzeit Nachttemp.", "Resterende tijd nachtverlaging", "Återstående Tid Nattläge", "czas do końca trybu nocnego", "gjenværende tid i nattstilling", "temps restant mode nuit", "", "temperatura notturna residua") +MAKE_TRANSLATION(switchonoptimization, "switchonoptimization", "switch-on optimization", "Einschaltoptimierung", "Inschakeloptimalisering", "Växlingsoptimering", "optymalizacja załączania", "slå på optimalisering", "optimisation mise en marche", "", "ottimizzazione all'accensione") + +MAKE_TRANSLATION(hpmode, "hpmode", "HP Mode", "WP Modus") +MAKE_TRANSLATION(dewoffset, "dewoffset", "dew point offset", "Taupunkt Differenz") +MAKE_TRANSLATION(roomtempdiff, "roomtempdiff", "room temp difference", "Raumtemperatur Differenz") +MAKE_TRANSLATION(hpminflowtemp, "hpminflowtemp", "HP min. flow temp.", "WP minimale Vorlauftemperatur") +MAKE_TRANSLATION(hpcooling, "cooling", "cooling", "Kühlen", "Koelen", "Kyler", "chłodzenie", "kjøling", "refroidissement", "soğuma", "raffreddamento") // heatpump -MAKE_TRANSLATION(airHumidity, "airhumidity", "relative air humidity", "relative Luftfeuchte", "Relatieve luchtvochtigheid", "Relativ Luftfuktighet", "wilgotność względna w pomieszczeniu", "luftfuktighet", "humidité relative air", "") -MAKE_TRANSLATION(dewTemperature, "dewtemperature", "dew point temperature", "Taupunkttemperatur", "Dauwpunttemperatuur", "Daggpunkt", "punkt rosy w pomieszczeniu", "duggtemperatur", "température point rosée", "") +MAKE_TRANSLATION(airHumidity, "airhumidity", "relative air humidity", "relative Luftfeuchte", "Relatieve luchtvochtigheid", "Relativ Luftfuktighet", "wilgotność względna w pomieszczeniu", "luftfuktighet", "humidité relative air", "", "umidità relativa aria") +MAKE_TRANSLATION(dewTemperature, "dewtemperature", "dew point temperature", "Taupunkttemperatur", "Dauwpunttemperatuur", "Daggpunkt", "punkt rosy w pomieszczeniu", "duggtemperatur", "température point rosée", "", "temperatura del punto di rugiada") // mixer -MAKE_TRANSLATION(flowSetTemp, "flowsettemp", "setpoint flow temperature", "Sollwert Vorlauftemperatur", "Streefwaarde aanvoertemperatuur", "Vald flödestemperatur", "zadana temperatura zasilania", "valgt turtemperatur", "consigne température flux", "") -MAKE_TRANSLATION(flowTempHc, "flowtemphc", "flow temperature (TC1)", "Vorlauftemperatur HK (TC1)", "Aanvoertemperatuut circuit (TC1)", "Flödestemperatur (TC1)", "temperatura zasilania (TC1)", "turtemperatur (TC1)", "température flux (TC1)", "") -MAKE_TRANSLATION(pumpStatus, "pumpstatus", "pump status (PC1)", "Pumpenstatus HK (PC1)", "pompstatus circuit (PC1)", "Pumpstatus (PC1)", "status pompy (PC1)", "pumpestatus (PC1)", "état pompe (PC1)", "") -MAKE_TRANSLATION(mixerStatus, "valvestatus", "mixing valve actuator (VC1)", "Mischerventil Position (VC1)", "positie mixerklep (VC1)", "Shuntventil Status (VC1)", "siłownik zaworu mieszającego (VC1)", "shuntventil status (VC1)", "actionnement vanne mélangeur (VC1)", "") -MAKE_TRANSLATION(flowTempVf, "flowtempvf", "flow temperature in header (T0/Vf)", "Vorlauftemperatur am Verteiler (T0/Vf)", "aanvoertemperatuur verdeler (T0/Vf)", "Flödestemperatur Fördelare (T0/Vf)", "temperatura zasilania na rozdzielaczu (T0/Vf)", "turtemperatur ved fordeleren (T0/Vf)", "température départ collecteur (T0/Vf)", "") -MAKE_TRANSLATION(mixerSetTime, "valvesettime", "time to set valve", "Zeit zum Einstellen des Ventils", "Inschakeltijd mengklep", "Inställningstid Ventil", "czas na ustawienie zaworu", "instillningstid ventil", "délai activation vanne", "") +MAKE_TRANSLATION(flowSetTemp, "flowsettemp", "setpoint flow temperature", "Sollwert Vorlauftemperatur", "Streefwaarde aanvoertemperatuur", "Vald flödestemperatur", "zadana temperatura zasilania", "valgt turtemperatur", "consigne température flux", "", "Setpoint temperatura di mandata") +MAKE_TRANSLATION(flowTempHc, "flowtemphc", "flow temperature (TC1)", "Vorlauftemperatur HK (TC1)", "Aanvoertemperatuut circuit (TC1)", "Flödestemperatur (TC1)", "temperatura zasilania (TC1)", "turtemperatur (TC1)", "température flux (TC1)", "", "temperatura di mandata (TC1)") +MAKE_TRANSLATION(pumpStatus, "pumpstatus", "pump status (PC1)", "Pumpenstatus HK (PC1)", "pompstatus circuit (PC1)", "Pumpstatus (PC1)", "status pompy (PC1)", "pumpestatus (PC1)", "état pompe (PC1)", "", "stato pompa (PC1)") +MAKE_TRANSLATION(mixerStatus, "valvestatus", "mixing valve actuator (VC1)", "Mischerventil Position (VC1)", "positie mixerklep (VC1)", "Shuntventil Status (VC1)", "siłownik zaworu mieszającego (VC1)", "shuntventil status (VC1)", "actionnement vanne mélangeur (VC1)", "", "posizione valvola miscela (VC1)") +MAKE_TRANSLATION(flowTempVf, "flowtempvf", "flow temperature in header (T0/Vf)", "Vorlauftemperatur am Verteiler (T0/Vf)", "aanvoertemperatuur verdeler (T0/Vf)", "Flödestemperatur Fördelare (T0/Vf)", "temperatura zasilania na rozdzielaczu (T0/Vf)", "turtemperatur ved fordeleren (T0/Vf)", "température départ collecteur (T0/Vf)", "", "Temperatura di mandata al distributore (T0/Vf)") +MAKE_TRANSLATION(mixerSetTime, "valvesettime", "time to set valve", "Zeit zum Einstellen des Ventils", "Inschakeltijd mengklep", "Inställningstid Ventil", "czas na ustawienie zaworu", "instillningstid ventil", "délai activation vanne", "", "ritardo attivazione valvola") // mixer prefixed with wwc -MAKE_TRANSLATION(wwPumpStatus, "pumpstatus", "pump status in assigned wwc (PC1)", "Pumpenstatus des wwk (PC1)", "Pompstatus in WW circuit (PC1)", "Pumpstatus i VV-krets (PC1)", "stan pompy w obwodzie c.w.u. (PC1)", "Pumpestatus i VV-krets (PC1)", "état pompe wwc (PC1)", "Kullanım suyu devresindeki(PC1) pompa durumu", "") -MAKE_TRANSLATION(wwTempStatus, "wwtempstatus", "temperature switch in assigned wwc (MC1)", "Temperaturschalter des wwk (MC1)", "Temperatuurschakeling in WW circuit (MC1)", "Temperaturventil i VV-krets (MC1)", "temperatura w obwodzie c.w.u. (MC1)", "temperaturventil i VV-krets (MC1)", "température bascule wwc (MC1).", "") -MAKE_TRANSLATION(wwTemp, "wwtemp", "current temperature", "aktuelle Temperatur", "huidige temperatuur", "Aktuell Temperatur", "temperatura c.w.u.", "aktuell temperatur", "température actuelle", "") +MAKE_TRANSLATION(wwPumpStatus, "pumpstatus", "pump status in assigned wwc (PC1)", "Pumpenstatus des wwk (PC1)", "Pompstatus in WW circuit (PC1)", "Pumpstatus i VV-krets (PC1)", "stan pompy w obwodzie c.w.u. (PC1)", "Pumpestatus i VV-krets (PC1)", "état pompe wwc (PC1)", "Kullanım suyu devresindeki(PC1) pompa durumu", "stato pompa assegnato nel ciruito WW (PC1)") +MAKE_TRANSLATION(wwTempStatus, "wwtempstatus", "temperature switch in assigned wwc (MC1)", "Temperaturschalter des wwk (MC1)", "Temperatuurschakeling in WW circuit (MC1)", "Temperaturventil i VV-krets (MC1)", "temperatura w obwodzie c.w.u. (MC1)", "temperaturventil i VV-krets (MC1)", "température bascule wwc (MC1).", "", "interruttore di temperatura del wwk (MC1)") +MAKE_TRANSLATION(wwTemp, "wwtemp", "current temperature", "aktuelle Temperatur", "huidige temperatuur", "Aktuell Temperatur", "temperatura c.w.u.", "aktuell temperatur", "température actuelle", "", "temperatura attuale") // mixer pool -MAKE_TRANSLATION(poolSetTemp, "poolsettemp", "pool set temperature", "Pool Solltemperatur", "Streeftemperatuur zwembad", "Pool Temperatur Börvärde", "zadana temperatura basenu", "valgt temp basseng", "température consigne piscine", "") -MAKE_TRANSLATION(poolTemp, "pooltemp", "pool temperature", "Pool Temperatur", "Zwembadtemperatuur", "Pooltemperatur", "temperatura basenu", "bassengtemperatur", "température piscine", "") -MAKE_TRANSLATION(poolShuntStatus, "poolshuntstatus", "pool shunt status opening/closing", "Pool Ventil öffnen/schließen", "Zwembadklep status openen/sluiten", "Pool Shunt-status öppnen/stängd", "status bocznika basenu", "bassengshunt-status åpen/stengt", "état shunt piscine ouvert/fermé", "") -MAKE_TRANSLATION(poolShunt, "poolshunt", "pool shunt open/close (0% = pool / 100% = heat)", "Pool Ventil Öffnung", "Mengklep zwembad stand", "Pool Shunt Öppen/Stängd", "bocznik basenu (0% = basen / 100% = grzanie)", "bassengshunt åpen/stengt (0% = basseng / 100% = varme)", "ouverture/fermeture shunt piscine (0% = piscine / 100% = chaleur).", "") -MAKE_TRANSLATION(hydrTemp, "hydrTemp", "hydraulic header temperature", "Verteilertemperatur", "Temperatuur open verdeler", "Fördelartemperatur", "temperatura kolektora hydraulicznego", "Fordelertemperatur", "température collecteur hydraulique", "") +MAKE_TRANSLATION(poolSetTemp, "poolsettemp", "pool set temperature", "Pool Solltemperatur", "Streeftemperatuur zwembad", "Pool Temperatur Börvärde", "zadana temperatura basenu", "valgt temp basseng", "température consigne piscine", "", "temperatura nominale piscina") +MAKE_TRANSLATION(poolTemp, "pooltemp", "pool temperature", "Pool Temperatur", "Zwembadtemperatuur", "Pooltemperatur", "temperatura basenu", "bassengtemperatur", "température piscine", "", "temperatura piscina") +MAKE_TRANSLATION(poolShuntStatus, "poolshuntstatus", "pool shunt status opening/closing", "Pool Ventil öffnen/schließen", "Zwembadklep status openen/sluiten", "Pool Shunt-status öppnen/stängd", "status bocznika basenu", "bassengshunt-status åpen/stengt", "état shunt piscine ouvert/fermé", "", "aprire/chiudere valvola regolazione piscina") +MAKE_TRANSLATION(poolShunt, "poolshunt", "pool shunt open/close (0% = pool / 100% = heat)", "Pool Ventil Öffnung", "Mengklep zwembad stand", "Pool Shunt Öppen/Stängd", "bocznik basenu (0% = basen / 100% = grzanie)", "bassengshunt åpen/stengt (0% = basseng / 100% = varme)", "ouverture/fermeture shunt piscine (0% = piscine / 100% = chaleur).", "", "valvola regolazione piscina (0% = piscina / 100% = caldo)") +MAKE_TRANSLATION(hydrTemp, "hydrTemp", "hydraulic header temperature", "Verteilertemperatur", "Temperatuur open verdeler", "Fördelartemperatur", "temperatura kolektora hydraulicznego", "Fordelertemperatur", "température collecteur hydraulique", "", "temperatura del collettore") // solar -MAKE_TRANSLATION(cylMiddleTemp, "cylmiddletemp", "cylinder middle temperature (TS3)", "Speichertemperatur Mitte (TS3)", "Zonneboilertemperatuur midden (TS3)", "Cylindertemperatur Mitten (TS3)", "temperatura w środku zasobnika (TS3)", "beredertemperatur i midten (TS3)", "température moyenne cylindre (TS3)", "") -MAKE_TRANSLATION(retHeatAssist, "retheatassist", "return temperature heat assistance (TS4)", "Rücklaufanhebungs-Temp. (TS4)", "Retourtemperatuur verwarmingsassistentie (TS4)", "Returtemperatur värmestöd (TS4)", "temperatura powrotu wspomagania grzania (TS4)", "returtemperatur varmestøtte (TS4)", "température retour de assistance thermique (TS4)", "") -MAKE_TRANSLATION(m1Valve, "heatassistvalve", "heat assistance valve (M1)", "Ventil Heizungsunterstützung (M1)", "Klep verwarmingsassistentie (M1)", "Uppvärmningsstöd Ventil (M1)", "zawór wspomagania grzania (M1)", "varmehjelpsventil (M1)", "vanne assistance thermique (M1)", "") -MAKE_TRANSLATION(m1Power, "heatassistpower", "heat assistance valve power (M1)", "Ventilleistung Heizungsunterstützung (M1)", "Vermogen klep verwarmingsassistentie (M1)", "Uppvärmningsstöd Ventil Effekt (M1)", "moc zaworu wspomagania grzania (M1)", "varmehjelpsventileffekt (M1)", "puissance vanne assistance thermique (M1)", "") -MAKE_TRANSLATION(pumpMinMod, "pumpminmod", "minimum pump modulation", "minimale Pumpenmodulation", "Minimale pompmodulatie", "Min Pumpmodulering", "minimalna modulacja pompy", "minimum pumpmodulering", "modulation minimale pompe", "") -MAKE_TRANSLATION(maxFlow, "maxflow", "maximum solar flow", "maximaler Durchfluss", "Maximale doorstroom solar", "Max Flöde Solpanel", "maksymalny przepływ solarów", "maks strømming solpanel ", "débit solaire maximum", "") -MAKE_TRANSLATION(solarPower, "solarpower", "actual solar power", "aktuelle Solarleistung", "Huidig solar vermogen", "Aktuellt Sol-effekt", "aktualna moc solarów", "aktuell soleffekt", "puissance solaire réelle", "") -MAKE_TRANSLATION(solarPumpTurnonDiff, "turnondiff", "pump turn on difference", "Einschalthysterese Pumpe", "Inschakelhysterese pomp", "Aktiveringshysteres Pump", "histereza załączenia pompy", "slå på hysteresepumpe", "différence activation pompe", "") -MAKE_TRANSLATION(solarPumpTurnoffDiff, "turnoffdiff", "pump turn off difference", "Ausschalthysterese Pumpe", "Uitschakelhysterese pomp", "Avslagshysteres Pump", "histereza włączenia pompy", "slå av hysteresepumpe", "différence arrêt pompe", "") -MAKE_TRANSLATION(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_TRANSLATION(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_TRANSLATION(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_TRANSLATION(collectorTemp, "collectortemp", "collector temperature (TS1)", "Kollektortemperatur (TS1)", "Collectortemperatuur (TS1)", "Kollektor Temperatur (TS1)", "temperatura kolektora (TS1)", "kollektor temperatur (TS1)", "température collecteur (TS1)", "") -MAKE_TRANSLATION(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_TRANSLATION(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)", "") -MAKE_TRANSLATION(cyl2BottomTemp, "cyl2bottomtemp", "second cylinder bottom temperature (TS5)", "2. Speicher Bodentemperatur (TS5)", "Bodemtemperatuur 2e boiler", "Sekundär Cylindertemperatur Botten (TS5)", "temperatura na spodzie drugiego zasobnika (TS5)", "skundær beredertemp i bunn (TS5)", "température fond de cylindre (TS5)", "") -MAKE_TRANSLATION(heatExchangerTemp, "heatexchangertemp", "heat exchanger temperature (TS6)", "wärmetauscher Temperatur (TS6)", "Temperatuur warmtewisselaar (TS6)", "Värmeväxlare Temperatur (TS6)", "temperatura wymiennika ciepła (TS6)", "Varmeveksler temperatur (TS6)", "température échangeur de chaleur (TS6)", "") // TODO translate -MAKE_TRANSLATION(collectorMaxTemp, "collectormaxtemp", "maximum collector temperature", "maximale Kollektortemperatur", "Maximale collectortemperatuur", "Max Kollektortemperatur", "maksymalna temperatura kolektora", "maks kollektortemperatur", "température max. collecteur", "") -MAKE_TRANSLATION(collectorMinTemp, "collectormintemp", "minimum collector temperature", "minimale Kollektortemperatur", "Minimale collectortemperatuur", "Min Kollektortemperatur", "minimalna temperatura kolektora", "min kollektortemperatur", "température min. collecteur", "") -MAKE_TRANSLATION(cylMaxTemp, "cylmaxtemp", "maximum cylinder temperature", "maximale Speichertemperatur", "maximale temperatuur zonneboiler", "Max Cylindertemperatur", "maksymalna temperatura zasobnika", "maks beredertemperatur", "température max. cylindre", "") -MAKE_TRANSLATION(solarPumpMod, "solarpumpmod", "pump modulation (PS1)", "Pumpenmodulation (PS1)", "Pompmodulatie (PS1)", "Pumpmodulering (PS1)", "modulacja pompy solarnej (PS1)", "solpumpmodulering (PS1)", "modulation pompe (PS1)", "") -MAKE_TRANSLATION(cylPumpMod, "cylpumpmod", "cylinder pump modulation (PS5)", "Speicherpumpenmodulation (PS5)", "Modulatie zonneboilerpomp (PS5)", "Cylinderpumpmodulering (PS5)", "modulacja pompy zasobnika (PS5)", "sylinderpumpemodulering (P55)", "modulation pompe cylindre (PS5)", "") // TODO translate -MAKE_TRANSLATION(solarPump, "solarpump", "pump (PS1)", "Pumpe (PS1)", "Pomp (PS1)", "Pump (PS1)", "pompa solarna (PS1)", "solpumpe (PS1)", "pompe solaire (PS1)", "") -MAKE_TRANSLATION(solarPump2, "solarpump2", "pump 2 (PS4)", "Pumpe 2 (PS4)", "Pomp 2 (PS4)", "Pump 2 (PS4)", "pompa solarna 2 (PS4)", "solpumpe 2 (PS4)", "pompe 2 (PS4)", "") -MAKE_TRANSLATION(solarPump2Mod, "solarpump2mod", "pump 2 modulation (PS4)", "Pumpe 2 Modulation (PS4)", "Modulatie pomp 2 (PS4)", "Pump 2 Modulering (PS4)", "modulacja pompy solarnej 2 (PS4)", "solpumpe2modulering (PS4)", "modulation pompe solaire 2 (PS4)", "") -MAKE_TRANSLATION(valveStatus, "valvestatus", "valve status", "Ventilstatus", "Klepstatus", "Ventilstatus", "stan zaworu", "ventilstatus", "statut valve", "") -MAKE_TRANSLATION(vs1Status, "vs1status", "valve status VS1", "Ventilstatus VS1", "Klepstatus VS1", "Ventilstatus VS1", "stan zaworu VS1", "ventilstatus VS1", "statut valve VS1", "") -MAKE_TRANSLATION(cylHeated, "cylheated", "cyl heated", "Speichertemperatur erreicht", "Boilertemperatuur behaald", "Värmepanna Uppvärmd", "zasobnik został nagrzany", "bereder oppvarmt", "cylindre chauffé", "") -MAKE_TRANSLATION(collectorShutdown, "collectorshutdown", "collector shutdown", "Kollektorabschaltung", "Collector afschakeling", "Kollektor Avstängning", "wyłączenie kolektora", "kollektor stengt", "arrêt collecteur", "") -MAKE_TRANSLATION(pumpWorkTime, "pumpworktime", "pump working time", "Pumpenlaufzeit", "Pomplooptijd", "Pump Drifttid", "czas pracy pompy", "driftstid pumpe", "durée fonctionnement pompe", "") -MAKE_TRANSLATION(pump2WorkTime, "pump2worktime", "pump 2 working time", "Pumpe 2 Laufzeit", "Looptijd pomp 2", "Pump 2 Drifttid", "czas pracy pompy 2", "driftstid pumpe2", "durée fonctionnement pompe 2", "") -MAKE_TRANSLATION(m1WorkTime, "m1worktime", "differential control working time", "Differenzregelung Arbeitszeit", "Verschilregeling arbeidstijd", "Differentialreglering Drifttid", "czas pracy regulacji różnicowej", "differentialreguleringssrifttid", "durée fonctionnement contrôle différentiel", "") -MAKE_TRANSLATION(energyLastHour, "energylasthour", "energy last hour", "Energie letzte Std", "Energie laatste uur", "Energi Senaste Timmen", "energia w ciągu ostatniej godziny", "energi siste time", "énergie dernière heure", "") -MAKE_TRANSLATION(energyTotal, "energytotal", "total energy", "Gesamtenergie", "Totale energie", "Total Energi", "energia całkowita", "total energi", "énergie totale", "") -MAKE_TRANSLATION(energyToday, "energytoday", "total energy today", "Energie heute", "Energie vandaag", "Total Energi Idag", "energia całkowita dzisiaj", "total energi i dag", "énergie totale aujourd'hui", "") +MAKE_TRANSLATION(cylMiddleTemp, "cylmiddletemp", "cylinder middle temperature (TS3)", "Speichertemperatur Mitte (TS3)", "Zonneboilertemperatuur midden (TS3)", "Cylindertemperatur Mitten (TS3)", "temperatura w środku zasobnika (TS3)", "beredertemperatur i midten (TS3)", "température moyenne cylindre (TS3)", "", "temperatura di conservazione media accumulo (TS3)") +MAKE_TRANSLATION(retHeatAssist, "retheatassist", "return temperature heat assistance (TS4)", "Rücklaufanhebungs-Temp. (TS4)", "Retourtemperatuur verwarmingsassistentie (TS4)", "Returtemperatur värmestöd (TS4)", "temperatura powrotu wspomagania grzania (TS4)", "returtemperatur varmestøtte (TS4)", "température retour de assistance thermique (TS4)", "", "temperatura ritorno scambiatore (TS4)") +MAKE_TRANSLATION(m1Valve, "heatassistvalve", "heat assistance valve (M1)", "Ventil Heizungsunterstützung (M1)", "Klep verwarmingsassistentie (M1)", "Uppvärmningsstöd Ventil (M1)", "zawór wspomagania grzania (M1)", "varmehjelpsventil (M1)", "vanne assistance thermique (M1)", "", "valvola scambiatore (M1)") +MAKE_TRANSLATION(m1Power, "heatassistpower", "heat assistance valve power (M1)", "Ventilleistung Heizungsunterstützung (M1)", "Vermogen klep verwarmingsassistentie (M1)", "Uppvärmningsstöd Ventil Effekt (M1)", "moc zaworu wspomagania grzania (M1)", "varmehjelpsventileffekt (M1)", "puissance vanne assistance thermique (M1)", "", "potenza valvola scambiatore (M1)") +MAKE_TRANSLATION(pumpMinMod, "pumpminmod", "minimum pump modulation", "minimale Pumpenmodulation", "Minimale pompmodulatie", "Min Pumpmodulering", "minimalna modulacja pompy", "minimum pumpmodulering", "modulation minimale pompe", "", "modulazione minima pompa") +MAKE_TRANSLATION(maxFlow, "maxflow", "maximum solar flow", "maximaler Durchfluss", "Maximale doorstroom solar", "Max Flöde Solpanel", "maksymalny przepływ solarów", "maks strømming solpanel ", "débit solaire maximum", "", "portata massima solare") +MAKE_TRANSLATION(solarPower, "solarpower", "actual solar power", "aktuelle Solarleistung", "Huidig solar vermogen", "Aktuellt Sol-effekt", "aktualna moc solarów", "aktuell soleffekt", "puissance solaire réelle", "", "potenza attuale solare") +MAKE_TRANSLATION(solarPumpTurnonDiff, "turnondiff", "pump turn on difference", "Einschalthysterese Pumpe", "Inschakelhysterese pomp", "Aktiveringshysteres Pump", "histereza załączenia pompy", "slå på hysteresepumpe", "différence activation pompe", "", "isteresi di accensione pompa") +MAKE_TRANSLATION(solarPumpTurnoffDiff, "turnoffdiff", "pump turn off difference", "Ausschalthysterese Pumpe", "Uitschakelhysterese pomp", "Avslagshysteres Pump", "histereza włączenia pompy", "slå av hysteresepumpe", "différence arrêt pompe", "", "isteresi di spegnimento pompa") +MAKE_TRANSLATION(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", "", "modulazione minima pompa 2") +MAKE_TRANSLATION(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", "", "isteresi di accensione pompa 2") +MAKE_TRANSLATION(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", "", "isteresi di spegnimento pompa") +MAKE_TRANSLATION(collectorTemp, "collectortemp", "collector temperature (TS1)", "Kollektortemperatur (TS1)", "Collectortemperatuur (TS1)", "Kollektor Temperatur (TS1)", "temperatura kolektora (TS1)", "kollektor temperatur (TS1)", "température collecteur (TS1)", "", "temperatura collettore (TS1)") +MAKE_TRANSLATION(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)", "", "temperatura collettore 2 (TS7)") +MAKE_TRANSLATION(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)", "", "temperatura inferiore accumulo (TS2)") +MAKE_TRANSLATION(cyl2BottomTemp, "cyl2bottomtemp", "second cylinder bottom temperature (TS5)", "2. Speicher Bodentemperatur (TS5)", "Bodemtemperatuur 2e boiler", "Sekundär Cylindertemperatur Botten (TS5)", "temperatura na spodzie drugiego zasobnika (TS5)", "skundær beredertemp i bunn (TS5)", "température fond de cylindre (TS5)", "", "temperatura inferiore 2° accumulo (TS5)") +MAKE_TRANSLATION(heatExchangerTemp, "heatexchangertemp", "heat exchanger temperature (TS6)", "wärmetauscher Temperatur (TS6)", "Temperatuur warmtewisselaar (TS6)", "Värmeväxlare Temperatur (TS6)", "temperatura wymiennika ciepła (TS6)", "Varmeveksler temperatur (TS6)", "température échangeur de chaleur (TS6)", "", "temperatura scambiatore calore (TS6)") +MAKE_TRANSLATION(collectorMaxTemp, "collectormaxtemp", "maximum collector temperature", "maximale Kollektortemperatur", "Maximale collectortemperatuur", "Max Kollektortemperatur", "maksymalna temperatura kolektora", "maks kollektortemperatur", "température max. collecteur", "", " temperatura massima scambiatore calore") +MAKE_TRANSLATION(collectorMinTemp, "collectormintemp", "minimum collector temperature", "minimale Kollektortemperatur", "Minimale collectortemperatuur", "Min Kollektortemperatur", "minimalna temperatura kolektora", "min kollektortemperatur", "température min. collecteur", "", "temperatura minima scambiatore calore") +MAKE_TRANSLATION(cylMaxTemp, "cylmaxtemp", "maximum cylinder temperature", "maximale Speichertemperatur", "maximale temperatuur zonneboiler", "Max Cylindertemperatur", "maksymalna temperatura zasobnika", "maks beredertemperatur", "température max. cylindre", "", "temperatura massima vaso accumulo") +MAKE_TRANSLATION(solarPumpMod, "solarpumpmod", "pump modulation (PS1)", "Pumpenmodulation (PS1)", "Pompmodulatie (PS1)", "Pumpmodulering (PS1)", "modulacja pompy solarnej (PS1)", "solpumpmodulering (PS1)", "modulation pompe (PS1)", "", "modulazione pompa (PS1)") +MAKE_TRANSLATION(cylPumpMod, "cylpumpmod", "cylinder pump modulation (PS5)", "Speicherpumpenmodulation (PS5)", "Modulatie zonneboilerpomp (PS5)", "Cylinderpumpmodulering (PS5)", "modulacja pompy zasobnika (PS5)", "sylinderpumpemodulering (P55)", "modulation pompe cylindre (PS5)", "", "pompa modulazione accumulo (PS5)") +MAKE_TRANSLATION(solarPump, "solarpump", "pump (PS1)", "Pumpe (PS1)", "Pomp (PS1)", "Pump (PS1)", "pompa solarna (PS1)", "solpumpe (PS1)", "pompe solaire (PS1)", "", "pompa solare (PS1)") +MAKE_TRANSLATION(solarPump2, "solarpump2", "pump 2 (PS4)", "Pumpe 2 (PS4)", "Pomp 2 (PS4)", "Pump 2 (PS4)", "pompa solarna 2 (PS4)", "solpumpe 2 (PS4)", "pompe 2 (PS4)", "", "pompa solare 2 (PS4)") +MAKE_TRANSLATION(solarPump2Mod, "solarpump2mod", "pump 2 modulation (PS4)", "Pumpe 2 Modulation (PS4)", "Modulatie pomp 2 (PS4)", "Pump 2 Modulering (PS4)", "modulacja pompy solarnej 2 (PS4)", "solpumpe2modulering (PS4)", "modulation pompe solaire 2 (PS4)", "", "pompa modulazione 2 (PS4)") +MAKE_TRANSLATION(valveStatus, "valvestatus", "valve status", "Ventilstatus", "Klepstatus", "Ventilstatus", "stan zaworu", "ventilstatus", "statut valve", "", "stato valvola") +MAKE_TRANSLATION(vs1Status, "vs1status", "valve status VS1", "Ventilstatus VS1", "Klepstatus VS1", "Ventilstatus VS1", "stan zaworu VS1", "ventilstatus VS1", "statut valve VS1", "", "stato valvola VS1") +MAKE_TRANSLATION(cylHeated, "cylheated", "cyl heated", "Speichertemperatur erreicht", "Boilertemperatuur behaald", "Värmepanna Uppvärmd", "zasobnik został nagrzany", "bereder oppvarmt", "cylindre chauffé", "", "temperatura richiesta vaso accumulo raggiunta") +MAKE_TRANSLATION(collectorShutdown, "collectorshutdown", "collector shutdown", "Kollektorabschaltung", "Collector afschakeling", "Kollektor Avstängning", "wyłączenie kolektora", "kollektor stengt", "arrêt collecteur", "", "spegnimento del collettore") +MAKE_TRANSLATION(pumpWorkTime, "pumpworktime", "pump working time", "Pumpenlaufzeit", "Pomplooptijd", "Pump Drifttid", "czas pracy pompy", "driftstid pumpe", "durée fonctionnement pompe", "", "tempo funzionamento pompa") +MAKE_TRANSLATION(pump2WorkTime, "pump2worktime", "pump 2 working time", "Pumpe 2 Laufzeit", "Looptijd pomp 2", "Pump 2 Drifttid", "czas pracy pompy 2", "driftstid pumpe2", "durée fonctionnement pompe 2", "", "tempo funzionamento pompa 2") +MAKE_TRANSLATION(m1WorkTime, "m1worktime", "differential control working time", "Differenzregelung Arbeitszeit", "Verschilregeling arbeidstijd", "Differentialreglering Drifttid", "czas pracy regulacji różnicowej", "differentialreguleringssrifttid", "durée fonctionnement contrôle différentiel", "", "controllo differenziale durata funzionamento") +MAKE_TRANSLATION(energyLastHour, "energylasthour", "energy last hour", "Energie letzte Std", "Energie laatste uur", "Energi Senaste Timmen", "energia w ciągu ostatniej godziny", "energi siste time", "énergie dernière heure", "", "Eenergia ultima ora") +MAKE_TRANSLATION(energyTotal, "energytotal", "total energy", "Gesamtenergie", "Totale energie", "Total Energi", "energia całkowita", "total energi", "énergie totale", "", "energia totale") +MAKE_TRANSLATION(energyToday, "energytoday", "total energy today", "Energie heute", "Energie vandaag", "Total Energi Idag", "energia całkowita dzisiaj", "total energi i dag", "énergie totale aujourd'hui", "", "totale energia giornaliera") // solar ww -MAKE_TRANSLATION(wwTemp1, "wwtemp1", "temperature 1", "Temperatur 1", "Temperatuur 1", "Temperatur 1", "temperatura 1", "temperatur 1", "température 1", "") -MAKE_TRANSLATION(wwTemp3, "wwtemp3", "temperature 3", "Temperatur 3", "Temperatuur 2", "Temperatur 2", "temperatura 2", "Temperatur 3", "température 3", "") -MAKE_TRANSLATION(wwTemp4, "wwtemp4", "temperature 4", "Temperatur 4", "Temperatuur 3", "Temperatur 3", "temperatura 3", "Temperatur 4", "température 4", "") -MAKE_TRANSLATION(wwTemp5, "wwtemp5", "temperature 5", "Temperatur 5", "Temperatuur 5", "Temperatur 4", "temperatura 4", "Temperatur 5", "température 5", "") -MAKE_TRANSLATION(wwTemp7, "wwtemp7", "temperature 7", "Temperatur 7", "Temperatuur 7", "Temperatur 5", "temperatura 5", "Temperatur 7", "température 7", "") -MAKE_TRANSLATION(wwPump, "wwpump", "pump", "Pumpe", "Pomp", "Pump", "pompa", "pumpe", "pompe") // TODO translate +MAKE_TRANSLATION(wwTemp1, "wwtemp1", "temperature 1", "Temperatur 1", "Temperatuur 1", "Temperatur 1", "temperatura 1", "temperatur 1", "température 1", "", "Temperatura 1") +MAKE_TRANSLATION(wwTemp3, "wwtemp3", "temperature 3", "Temperatur 3", "Temperatuur 2", "Temperatur 2", "temperatura 2", "Temperatur 3", "température 3", "", "Temperatura 3") +MAKE_TRANSLATION(wwTemp4, "wwtemp4", "temperature 4", "Temperatur 4", "Temperatuur 3", "Temperatur 3", "temperatura 3", "Temperatur 4", "température 4", "", "Temperatura 4") +MAKE_TRANSLATION(wwTemp5, "wwtemp5", "temperature 5", "Temperatur 5", "Temperatuur 5", "Temperatur 4", "temperatura 4", "Temperatur 5", "température 5", "", "Temperatura 5") +MAKE_TRANSLATION(wwTemp7, "wwtemp7", "temperature 7", "Temperatur 7", "Temperatuur 7", "Temperatur 5", "temperatura 5", "Temperatur 7", "température 7", "", "Temperatura 7") +MAKE_TRANSLATION(wwPump, "wwpump", "pump", "Pumpe", "Pomp", "Pump", "pompa", "pumpe", "pompe","", "Pompa") // solar ww and mixer wwc -MAKE_TRANSLATION(wwMinTemp, "wwmintemp", "minimum temperature", "minimale Temperatur", "Minimale temperatuur", "Min Temperatur", "temperatura minimalna", "min temperatur", "température min", "") -MAKE_TRANSLATION(wwRedTemp, "wwredtemp", "reduced temperature", "reduzierte Temperatur", "Gereduceerde temperatuur", "Reducerad Temperatur", "temperatura zredukowana", "reducert temperatur", "température réduite", "") -MAKE_TRANSLATION(wwDailyTemp, "wwdailytemp", "daily temperature", "tägl. Temperatur", "Dagelijkse temperatuur", "Daglig temperatur", "temperatura dzienna", "dagtemperatur", "température en journée", "") -MAKE_TRANSLATION(wwKeepWarm, "wwkeepwarm", "keep warm", "Warmhalten", "Warm houde", "Varmhållning", "utrzymywanie ciepła", "holde varmen", "maintenir chaleur", "") -MAKE_TRANSLATION(wwStatus2, "wwstatus2", "status 2", "Status 2", "Status 2", "Status 2", "status 2", "status 2", "statut 2", "") -MAKE_TRANSLATION(wwPumpMod, "wwpumpmod", "pump modulation", "Pumpen Modulation", "Pompmodulatie", "Pumpmodulering", "modulacja pompy", "pumpemodulering", "modulation de pompe", "") -MAKE_TRANSLATION(wwFlow, "wwflow", "flow rate", "Volumenstrom", "Doorstroomsnelheid", "Flöde", "przepływ", "strømningshastighet", "débit", "") +MAKE_TRANSLATION(wwMinTemp, "wwmintemp", "minimum temperature", "minimale Temperatur", "Minimale temperatuur", "Min Temperatur", "temperatura minimalna", "min temperatur", "température min", "", "temperatura minima") +MAKE_TRANSLATION(wwRedTemp, "wwredtemp", "reduced temperature", "reduzierte Temperatur", "Gereduceerde temperatuur", "Reducerad Temperatur", "temperatura zredukowana", "reducert temperatur", "température réduite", "", "temperatura ridotta") +MAKE_TRANSLATION(wwDailyTemp, "wwdailytemp", "daily temperature", "tägl. Temperatur", "Dagelijkse temperatuur", "Daglig temperatur", "temperatura dzienna", "dagtemperatur", "température en journée", "", "temperatura giornaliera") +MAKE_TRANSLATION(wwKeepWarm, "wwkeepwarm", "keep warm", "Warmhalten", "Warm houde", "Varmhållning", "utrzymywanie ciepła", "holde varmen", "maintenir chaleur", "", "mantenimento calore") +MAKE_TRANSLATION(wwStatus2, "wwstatus2", "status 2", "Status 2", "Status 2", "Status 2", "status 2", "status 2", "statut 2", "", "Status 2") +MAKE_TRANSLATION(wwPumpMod, "wwpumpmod", "pump modulation", "Pumpen Modulation", "Pompmodulatie", "Pumpmodulering", "modulacja pompy", "pumpemodulering", "modulation de pompe", "", "modulazione pompa") +MAKE_TRANSLATION(wwFlow, "wwflow", "flow rate", "Volumenstrom", "Doorstroomsnelheid", "Flöde", "przepływ", "strømningshastighet", "débit", "", "portata flusso") // extra mixer ww -MAKE_TRANSLATION(wwRequiredTemp, "wwrequiredtemp", "required temperature", "benötigte Temperatur", "Benodigde temperatuur", "Nödvändig Temperatur", "temperatura wymagana", "nødvendig temperatur", "température requise", "") -MAKE_TRANSLATION(wwDiffTemp, "wwdifftemp", "start differential temperature", "Start Differential Temperatur", "Start differentiele temperatuur", "Start Differentialtemperatur", "start temperatury różnicowej", "start differensialtemperatur", "température différentielle de départ", "") +MAKE_TRANSLATION(wwRequiredTemp, "wwrequiredtemp", "required temperature", "benötigte Temperatur", "Benodigde temperatuur", "Nödvändig Temperatur", "temperatura wymagana", "nødvendig temperatur", "température requise", "", "temperatura richiesta") +MAKE_TRANSLATION(wwDiffTemp, "wwdifftemp", "start differential temperature", "Start Differential Temperatur", "Start differentiele temperatuur", "Start Differentialtemperatur", "start temperatury różnicowej", "start differensialtemperatur", "température différentielle de départ", "", "avvia temperatura differenziale") // SM100 -MAKE_TRANSLATION(heatTransferSystem, "heattransfersystem", "heattransfer system", "Wärmeübertragungs-System", "Warmteoverdrachtssysteem", "Värmeöverföringssystem", "system wymiany ciepła", "varmeoverføringssystem", "système de transfert de chaleur", "") -MAKE_TRANSLATION(externalCyl, "externalcyl", "external cylinder", "Externer Speicher", "Externe boiler", "Extern Cylinder", "zbiornik zewnętrzny", "ekstern bereder", "cylindre externe", "") -MAKE_TRANSLATION(thermalDisinfect, "thermaldisinfect", "thermal disinfection", "Thermische Desinfektion", "Thermische desinfectie", "Termisk Desinfektion", "dezynfekcja termiczna", "termisk desinfeksjon", "désinfection thermique", "") -MAKE_TRANSLATION(heatMetering, "heatmetering", "heatmetering", "Wärmemessung", "warmtemeting", "Värmemätning", "pomiar ciepła", "varmemåling", "mesure de chaleur", "") -MAKE_TRANSLATION(solarIsEnabled, "solarenabled", "solarmodule enabled", "Solarmodul aktiviert", "Solarmodule geactiveerd", "Solmodul Aktiverad", "system solarny", "solmodul aktivert", "module solaire activé", "") +MAKE_TRANSLATION(heatTransferSystem, "heattransfersystem", "heattransfer system", "Wärmeübertragungs-System", "Warmteoverdrachtssysteem", "Värmeöverföringssystem", "system wymiany ciepła", "varmeoverføringssystem", "système de transfert de chaleur", "", "sistema di trasferimento del calore") +MAKE_TRANSLATION(externalCyl, "externalcyl", "external cylinder", "Externer Speicher", "Externe boiler", "Extern Cylinder", "zbiornik zewnętrzny", "ekstern bereder", "cylindre externe", "", "vaso accumulo esterno") +MAKE_TRANSLATION(thermalDisinfect, "thermaldisinfect", "thermal disinfection", "Thermische Desinfektion", "Thermische desinfectie", "Termisk Desinfektion", "dezynfekcja termiczna", "termisk desinfeksjon", "désinfection thermique", "", "disinfezione termica") +MAKE_TRANSLATION(heatMetering, "heatmetering", "heatmetering", "Wärmemessung", "warmtemeting", "Värmemätning", "pomiar ciepła", "varmemåling", "mesure de chaleur", "", "misurazione del calore") +MAKE_TRANSLATION(solarIsEnabled, "solarenabled", "solarmodule enabled", "Solarmodul aktiviert", "Solarmodule geactiveerd", "Solmodul Aktiverad", "system solarny", "solmodul aktivert", "module solaire activé", "", "modulo solare attivato") // telegram 0x035A -MAKE_TRANSLATION(solarPumpMode, "solarpumpmode", "pump mode", "Solar Pumpen Einst.", "Modus zonneboilerpomp", "Sol Pumpläge", "tryb pracy pompy", "solpumpemodus", "mode pompe solaire", "") -MAKE_TRANSLATION(solarPumpKick, "pumpkick", "pump kick", "Röhrenkollektorfunktion", "Modus buizencollector", "Sol Kollektorfunktion", "wspomaganie startu pompy", "solkllektorfunksjon", "démarrage boost pompe solaire", "") -MAKE_TRANSLATION(plainWaterMode, "plainwatermode", "plain water mode", "Südeuropafunktion", "Modus Zuid-Europa", "Sydeuropa-funktion", "tylko woda (dla Europy Południowej)", "vanlig vannmodus", "mode eau ordinaire", "") -MAKE_TRANSLATION(doubleMatchFlow, "doublematchflow", "doublematchflow", "Double Match Flow", "Double Match Flow", "Dubbelmatchning Flöde", "przepływ podwójnie dopasowany", "dobbelmatch flow", "double match flow", "") -MAKE_TRANSLATION(solarPump2Mode, "pump2mode", "pump 2 mode", "Pumpe 2 Modus", "Modus pomp 2", "Pump 2 Läge", "tryb pracy pompy 2", "pump 2 modus", "mode pompe 2", "") -MAKE_TRANSLATION(solarPump2Kick, "pump2kick", "pump kick 2", "Pumpe 2 Startboost", "Startboost pomp 2", "Pump 2 Kollektorfunktion", "wspomaganie startu pompy 2", "startboost pumpe 2", "démarrage boost pompe 2", "") +MAKE_TRANSLATION(solarPumpMode, "solarpumpmode", "pump mode", "Solar Pumpen Einst.", "Modus zonneboilerpomp", "Sol Pumpläge", "tryb pracy pompy", "solpumpemodus", "mode pompe solaire", "", "modalità pompa solare") +MAKE_TRANSLATION(solarPumpKick, "pumpkick", "pump kick", "Röhrenkollektorfunktion", "Modus buizencollector", "Sol Kollektorfunktion", "wspomaganie startu pompy", "solkllektorfunksjon", "démarrage boost pompe solaire", "", "avvio forzato pompa") +MAKE_TRANSLATION(plainWaterMode, "plainwatermode", "plain water mode", "Südeuropafunktion", "Modus Zuid-Europa", "Sydeuropa-funktion", "tylko woda (dla Europy Południowej)", "vanlig vannmodus", "mode eau ordinaire", "", "modalità acqua normale") +MAKE_TRANSLATION(doubleMatchFlow, "doublematchflow", "doublematchflow", "Double Match Flow", "Double Match Flow", "Dubbelmatchning Flöde", "przepływ podwójnie dopasowany", "dobbelmatch flow", "double match flow", "", "carico ottimizzato dell'accumulatore ad effetto termosifone ") +MAKE_TRANSLATION(solarPump2Mode, "pump2mode", "pump 2 mode", "Pumpe 2 Modus", "Modus pomp 2", "Pump 2 Läge", "tryb pracy pompy 2", "pump 2 modus", "mode pompe 2", "", "modalità pompa 2") +MAKE_TRANSLATION(solarPump2Kick, "pump2kick", "pump kick 2", "Pumpe 2 Startboost", "Startboost pomp 2", "Pump 2 Kollektorfunktion", "wspomaganie startu pompy 2", "startboost pumpe 2", "démarrage boost pompe 2", "", "avvio forzato pompa 2") // telegram 0x035F -MAKE_TRANSLATION(cylPriority, "cylpriority", "cylinder priority", "Speicher Priorität", "Prioriteit boiler", "Cylinderprioritering", "priorytet cylindra", "berederprioritering", "priorité de cylindre", "") +MAKE_TRANSLATION(cylPriority, "cylpriority", "cylinder priority", "Speicher Priorität", "Prioriteit boiler", "Cylinderprioritering", "priorytet cylindra", "berederprioritering", "priorité de cylindre", "", "") // telegram 0x380 -MAKE_TRANSLATION(climateZone, "climatezone", "climate zone", "Klimazone", "klimaatzone", "Klimatzon", "strefa klimatyczna", "klimasone", "zone de climat", "") -MAKE_TRANSLATION(collector1Area, "collector1area", "collector 1 area", "Kollektor 1 Fläche", "oppervlakte collector 1", "Kollektor 1 Area", "powierzchnia kolektora 1", "kollektor 1 område", "zone collecteur 1", "") -MAKE_TRANSLATION(collector1Type, "collector1type", "collector 1 type", "Kollektor 1 Typ", "Type collector 1", "Kollektor 1 Typ", "typ kolektora 1", "kollektor 1 type", "type collecteur 1", "") -MAKE_TRANSLATION(collector2Area, "collector2area", "collector 2 area", "Kollektor 2 Fläche", "Oppervlakte collector 2", "Kollektor 2 Area", "powierzchnia kolektora 2", "kollektor 2 område", "zone collecteur 2", "") -MAKE_TRANSLATION(collector2Type, "collector2type", "collector 2 type", "Kollektor 2 Typ", "Type collector 2", "Kollektor 2 Typ", "typ kolektora 2", "kollektor 2 type", "type collecteur 2", "") +MAKE_TRANSLATION(climateZone, "climatezone", "climate zone", "Klimazone", "klimaatzone", "Klimatzon", "strefa klimatyczna", "klimasone", "zone de climat", "", "zona clima") +MAKE_TRANSLATION(collector1Area, "collector1area", "collector 1 area", "Kollektor 1 Fläche", "oppervlakte collector 1", "Kollektor 1 Area", "powierzchnia kolektora 1", "kollektor 1 område", "zone collecteur 1", "", "area collettore 1") +MAKE_TRANSLATION(collector1Type, "collector1type", "collector 1 type", "Kollektor 1 Typ", "Type collector 1", "Kollektor 1 Typ", "typ kolektora 1", "kollektor 1 type", "type collecteur 1", "", "tipo collettore 1") +MAKE_TRANSLATION(collector2Area, "collector2area", "collector 2 area", "Kollektor 2 Fläche", "Oppervlakte collector 2", "Kollektor 2 Area", "powierzchnia kolektora 2", "kollektor 2 område", "zone collecteur 2", "", "area collettore 2") +MAKE_TRANSLATION(collector2Type, "collector2type", "collector 2 type", "Kollektor 2 Typ", "Type collector 2", "Kollektor 2 Typ", "typ kolektora 2", "kollektor 2 type", "type collecteur 2", "", "tipo collettore 2") // telegram 0x0363 heatCounter -MAKE_TRANSLATION(heatCntFlowTemp, "heatcntflowtemp", "heat counter flow temperature", "Wärmezähler Vorlauf-Temperatur", "Aanvoertemperatuur warmteenergiemeter", "Värmeräknare Flödestemperatur", "temperatura zasilania ciepłomierza", "varmeenergimåler turtemperatur", "température flux compteur chaleur", "") -MAKE_TRANSLATION(heatCntRetTemp, "heatcntrettemp", "heat counter return temperature", "Wärmezähler Rücklauf-Temperatur", "Retourtemperatuur warmteenergiemeter", "Värmeräknare Returtemperatur", "temperatura powrotu ciepłomierza", "varmeenergimåler returtemperatur", "température retour compteur chaleur", "") -MAKE_TRANSLATION(heatCnt, "heatcnt", "heat counter impulses", "Wärmezähler Impulse", "Warmteenergiemeter pulsen", "Värmeräknare Impuls", "liczba impulsów ciepłomierza", "varmemåler impuls", "impulsions compteur chaleur", "") -MAKE_TRANSLATION(swapFlowTemp, "swapflowtemp", "swap flow temperature (TS14)", "Austausch Vorlauf-Temperatur (TS14)", "Aanvoertemperatuur verwisselaar (TS14)", "Växlingstemperatur Flöde (TS14)", "temperatura zasilania wymiennika", "veksler turledningstemperatur (TS14)", "température flux échangeur (TS14)", "") -MAKE_TRANSLATION(swapRetTemp, "swaprettemp", "swap return temperature (TS15)", "Austausch Rücklauf-Temperatur (TS15)", "Retourtemperatuur verwisselaar (TS15)", "Växlingstemperatur Returflöde (TS15)", "temperatura powrotu wymiennika", "veksler returledningstemperatur (TS15)", "température retour échangeur (TS15)", "") +MAKE_TRANSLATION(heatCntFlowTemp, "heatcntflowtemp", "heat counter flow temperature", "Wärmezähler Vorlauf-Temperatur", "Aanvoertemperatuur warmteenergiemeter", "Värmeräknare Flödestemperatur", "temperatura zasilania ciepłomierza", "varmeenergimåler turtemperatur", "température flux compteur chaleur", "", "Temperatura di mandata del contatore di calore") +MAKE_TRANSLATION(heatCntRetTemp, "heatcntrettemp", "heat counter return temperature", "Wärmezähler Rücklauf-Temperatur", "Retourtemperatuur warmteenergiemeter", "Värmeräknare Returtemperatur", "temperatura powrotu ciepłomierza", "varmeenergimåler returtemperatur", "température retour compteur chaleur", "", "Temperatura di ritorno del contatore di calore") +MAKE_TRANSLATION(heatCnt, "heatcnt", "heat counter impulses", "Wärmezähler Impulse", "Warmteenergiemeter pulsen", "Värmeräknare Impuls", "liczba impulsów ciepłomierza", "varmemåler impuls", "impulsions compteur chaleur", "", "contacalore a impulsi") +MAKE_TRANSLATION(swapFlowTemp, "swapflowtemp", "swap flow temperature (TS14)", "Austausch Vorlauf-Temperatur (TS14)", "Aanvoertemperatuur verwisselaar (TS14)", "Växlingstemperatur Flöde (TS14)", "temperatura zasilania wymiennika", "veksler turledningstemperatur (TS14)", "température flux échangeur (TS14)", "", "Scambiare la temperatura di mandata (TS14)") +MAKE_TRANSLATION(swapRetTemp, "swaprettemp", "swap return temperature (TS15)", "Austausch Rücklauf-Temperatur (TS15)", "Retourtemperatuur verwisselaar (TS15)", "Växlingstemperatur Returflöde (TS15)", "temperatura powrotu wymiennika", "veksler returledningstemperatur (TS15)", "température retour échangeur (TS15)", "", "Scambiare la temperatura di ritorno (TS15)") // switch -MAKE_TRANSLATION(activated, "activated", "activated", "Aktiviert", "Geactiveerd", "Aktiverad", "aktywowany", "aktivert", "activé", "") -MAKE_TRANSLATION(status, "status", "status", "Status", "Status", "Status", "status", "status", "statut", "") +MAKE_TRANSLATION(activated, "activated", "activated", "Aktiviert", "Geactiveerd", "Aktiverad", "aktywowany", "aktivert", "activé", "", "ativato") +MAKE_TRANSLATION(status, "status", "status", "Status", "Status", "Status", "status", "status", "statut", "", "Stato") // RF sensor, id 0x40, telegram 0x435 -MAKE_TRANSLATION(RFTemp, "rftemp", "RF room temperature sensor", "RF Raumtemperatur Sensor", "RF ruimtetemperatuur sensor", "RF Rumsgivare Temp", "bezprzewodowy czujnik temperatury pomieszczenia", "RF romsgiver temp", "capteur de température de pièce RF", "") +MAKE_TRANSLATION(RFTemp, "rftemp", "RF room temperature sensor", "RF Raumtemperatur Sensor", "RF ruimtetemperatuur sensor", "RF Rumsgivare Temp", "bezprzewodowy czujnik temperatury pomieszczenia", "RF romsgiver temp", "capteur de température de pièce RF", "", "Sensore di temperatura ambiente RF") // ventilation -MAKE_TRANSLATION(outFresh, "outfresh", "outdoor fresh air", "Außenlufttemp.") -MAKE_TRANSLATION(inFresh, "infresh", "indoor fresh air", "Zulufttemp.") -MAKE_TRANSLATION(outEx, "outexhaust", "outdoor exhaust air", "Fortlufttemp.") -MAKE_TRANSLATION(inEx, "inexhaust", "indoor exhaust air", "Ablufttemp.") -MAKE_TRANSLATION(ventMode, "ventmode", "ventilation mode", "Belüftungsmodus") -MAKE_TRANSLATION(ventInSpeed, "ventinspeed", "in blower speed", "Zuluft-Drehzahl") -MAKE_TRANSLATION(ventOutSpeed, "ventoutspeed", "out blower speed", "Abluft-Drehzahl") -MAKE_TRANSLATION(airquality, "airquality", "air quality (voc)", "Luftqualität (VOC)") +MAKE_TRANSLATION(outFresh, "outfresh", "outdoor fresh air", "Außenlufttemp.", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(inFresh, "infresh", "indoor fresh air", "Zulufttemp.", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(outEx, "outexhaust", "outdoor exhaust air", "Fortlufttemp.", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(inEx, "inexhaust", "indoor exhaust air", "Ablufttemp.", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(ventMode, "ventmode", "ventilation mode", "Belüftungsmodus", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(ventInSpeed, "ventinspeed", "in blower speed", "Zuluft-Drehzahl", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(ventOutSpeed, "ventoutspeed", "out blower speed", "Abluft-Drehzahl", "", "", "", "", "", "", "") // TODO translate +MAKE_TRANSLATION(airquality, "airquality", "air quality (voc)", "Luftqualität (VOC)", "", "", "", "", "", "", "") // TODO translate /* // unknown fields to track (SM10), only for testing diff --git a/src/mqtt.cpp b/src/mqtt.cpp index 1b1cea873..d2a893364 100644 --- a/src/mqtt.cpp +++ b/src/mqtt.cpp @@ -23,7 +23,7 @@ namespace emsesp { -AsyncMqttClient * Mqtt::mqttClient_; +espMqttClient * Mqtt::mqttClient_; // static parameters we make global std::string Mqtt::mqtt_base_; @@ -47,13 +47,13 @@ bool Mqtt::send_response_; bool Mqtt::publish_single_; bool Mqtt::publish_single2cmd_; -std::deque Mqtt::mqtt_messages_; -std::vector Mqtt::mqtt_subfunctions_; +std::vector Mqtt::mqtt_subfunctions_; uint32_t Mqtt::mqtt_publish_fails_ = 0; bool Mqtt::connecting_ = false; bool Mqtt::initialized_ = false; bool Mqtt::ha_climate_reset_ = false; +uint16_t Mqtt::queuecount_ = 0; uint8_t Mqtt::connectcount_ = 0; uint32_t Mqtt::mqtt_message_id_ = 0; char will_topic_[Mqtt::MQTT_TOPIC_MAX_SIZE]; // because MQTT library keeps only char pointer @@ -95,7 +95,7 @@ void Mqtt::subscribe(const uint8_t device_type, const std::string & topic, mqtt_ // We store the original topic string without base mqtt_subfunctions_.emplace_back(device_type, std::move(topic), std::move(cb)); - if (!enabled()) { + if (!enabled() || !connected()) { return; } @@ -117,14 +117,7 @@ void Mqtt::resubscribe() { } for (const auto & mqtt_subfunction : mqtt_subfunctions_) { - bool found = false; - for (const auto & message : mqtt_messages_) { - found |= ((message.content_->operation == Operation::SUBSCRIBE) && (mqtt_subfunction.topic_ == message.content_->topic)); - } - - if (!found) { - queue_subscribe_message(mqtt_subfunction.topic_); - } + queue_subscribe_message(mqtt_subfunction.topic_); } } @@ -137,12 +130,6 @@ void Mqtt::loop() { uint32_t currentMillis = uuid::get_uptime(); - // publish MQTT queue, but timed to avoid overloading the TCP pipe - if ((uint32_t)(currentMillis - last_mqtt_poll_) > MQTT_PUBLISH_WAIT) { - last_mqtt_poll_ = currentMillis; - process_queue(); - } - // send heartbeat if ((currentMillis - last_publish_heartbeat_ > publish_time_heartbeat_)) { last_publish_heartbeat_ = currentMillis; @@ -154,7 +141,8 @@ void Mqtt::loop() { EMSESP::publish_sensor_values(false); } - if (!mqtt_messages_.empty()) { + queuecount_ = mqttClient_->getQueue(); + if (queuecount_ > 0) { return; } @@ -197,6 +185,7 @@ void Mqtt::show_mqtt(uuid::console::Shell & shell) { shell.printfln("MQTT Entity ID format is %d", entity_format_); shell.printfln("MQTT publish errors: %lu", mqtt_publish_fails_); + shell.printfln("MQTT queue: %d", queuecount_); shell.println(); // show subscriptions @@ -206,47 +195,6 @@ void Mqtt::show_mqtt(uuid::console::Shell & shell) { } shell.println(); - // show queues - if (mqtt_messages_.empty()) { - shell.printfln("MQTT queue is empty"); - shell.println(); - return; - } - - shell.printfln("MQTT queue (%d):", mqtt_messages_.size()); - - for (const auto & message : mqtt_messages_) { - auto content = message.content_; - char topic[MQTT_TOPIC_MAX_SIZE]; - - // prefix base, only if it's not a discovery topic - if (content->topic.compare(0, discovery_prefix().size(), discovery_prefix()) == 0) { - snprintf(topic, sizeof(topic), "%s/%s", mqtt_base_.c_str(), content->topic.c_str()); - } else { - snprintf(topic, sizeof(topic), "%s", content->topic.c_str()); - } - - if (content->operation == Operation::PUBLISH) { - // Publish messages - if (message.retry_count_ == 0) { - if (message.packet_id_ == 0) { - shell.printfln(" [%02d] (Pub) topic=%s payload=%s", message.id_, topic, content->payload.c_str()); - } else { - shell.printfln(" [%02d] (Pub) topic=%s payload=%s (pid %d)", message.id_, topic, content->payload.c_str(), message.packet_id_); - } - } else { - shell.printfln(" [%02d] (Pub) topic=%s payload=%s (pid %d, retry #%d)", - message.id_, - topic, - content->payload.c_str(), - message.packet_id_, - message.retry_count_); - } - } else { - // Subscribe messages - shell.printfln(" [%02d] (Sub) topic=%s", message.id_, topic); - } - } shell.println(); } @@ -265,7 +213,7 @@ void Mqtt::incoming(const char * topic, const char * payload) { void Mqtt::on_message(const char * topic, const char * payload, size_t len) const { // sometimes the payload is not terminated correctly, so make a copy // convert payload to a null-terminated char string - char message[len + 2]; + char message[len + 2] = {'\0'}; if (payload != nullptr) { strlcpy(message, payload, len + 1); } @@ -366,42 +314,12 @@ void Mqtt::show_topic_handlers(uuid::console::Shell & shell, const uint8_t devic } // called when an MQTT Publish ACK is received -// its a poor man's QOS we assume the ACK represents the last Publish sent -// check if ACK matches the last Publish we sent, if not report an error. Only if qos is 1 or 2 -// and always remove from queue void Mqtt::on_publish(uint16_t packetId) const { - // find the MQTT message in the queue and remove it - if (mqtt_messages_.empty()) { - LOG_DEBUG("No message stored for ACK pid %d", packetId); - return; - } - - auto mqtt_message = mqtt_messages_.front(); - - // if the last published failed, don't bother checking it. wait for the next retry - if (mqtt_message.packet_id_ == 0) { -#if defined(EMSESP_DEBUG) - LOG_DEBUG("ACK for failed message pid 0"); -#endif - return; - } - - if (mqtt_message.packet_id_ != packetId) { - LOG_ERROR("Mismatch, expecting PID %d, got %d", mqtt_message.packet_id_, packetId); - mqtt_publish_fails_++; // increment error count - } - - LOG_DEBUG("ACK pid %d", packetId); - - mqtt_messages_.pop_front(); // always remove from queue, regardless if there was a successful ACK + LOG_DEBUG("Packet %d sent successfull", packetId); } // called when MQTT settings have changed via the Web forms void Mqtt::reset_mqtt() { - if (!mqtt_enabled_) { - mqtt_messages_.clear(); - } - if (!mqttClient_) { return; } @@ -461,45 +379,26 @@ void Mqtt::start() { // add the 'publish' command ('call system publish' in console or via API) Command::add(EMSdevice::DeviceType::SYSTEM, F_(publish), System::command_publish, FL_(publish_cmd)); - mqttClient_->onConnect([this](bool sessionPresent) { on_connect(); }); - - mqttClient_->onDisconnect([this](AsyncMqttClientDisconnectReason reason) { - // only show the error once, not every 2 seconds - if (!connecting_ && first_connect_attempted_) { - return; - } - first_connect_attempted_ = true; - connecting_ = false; - if (reason == AsyncMqttClientDisconnectReason::TCP_DISCONNECTED) { - LOG_WARNING("MQTT disconnected: TCP"); - } else if (reason == AsyncMqttClientDisconnectReason::MQTT_IDENTIFIER_REJECTED) { - LOG_WARNING("MQTT disconnected: Identifier Rejected"); - } else if (reason == AsyncMqttClientDisconnectReason::MQTT_SERVER_UNAVAILABLE) { - LOG_WARNING("MQTT disconnected: Server unavailable"); - } else if (reason == AsyncMqttClientDisconnectReason::MQTT_MALFORMED_CREDENTIALS) { - LOG_WARNING("MQTT disconnected: Malformed credentials"); - } else if (reason == AsyncMqttClientDisconnectReason::MQTT_NOT_AUTHORIZED) { - LOG_WARNING("MQTT disconnected: Not authorized"); - } else { - LOG_WARNING("MQTT disconnected: code %d", reason); - } - }); - // create last will topic with the base prefixed. It has to be static because asyncmqttclient destroys the reference static char will_topic[MQTT_TOPIC_MAX_SIZE]; if (!mqtt_base_.empty()) { snprintf(will_topic, MQTT_TOPIC_MAX_SIZE, "%s/status", mqtt_base_.c_str()); + } else { + snprintf(will_topic, MQTT_TOPIC_MAX_SIZE, "status"); } mqttClient_->setWill(will_topic, 1, true, "offline"); // with qos 1, retain true - mqttClient_->onMessage([this](const char * topic, const char * payload, AsyncMqttClientMessageProperties properties, size_t len, size_t index, size_t total) { - on_message(topic, payload, len); // receiving mqtt - }); + mqttClient_->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, (const char *)payload, len); // receiving mqtt + }); + /* mqttClient_->onPublish([this](uint16_t packetId) { on_publish(packetId); // publish }); + */ } void Mqtt::set_publish_time_boiler(uint16_t publish_time) { @@ -555,6 +454,30 @@ bool Mqtt::get_publish_onchange(uint8_t device_type) { } return false; } +void Mqtt::on_disconnect(espMqttClientTypes::DisconnectReason reason) { + // only show the error once, not every 2 seconds + if (!connecting_) { + return; + } + connecting_ = false; + if (reason == espMqttClientTypes::DisconnectReason::TCP_DISCONNECTED) { + LOG_WARNING("MQTT disconnected: TCP"); + } else if (reason == espMqttClientTypes::DisconnectReason::MQTT_UNACCEPTABLE_PROTOCOL_VERSION) { + LOG_WARNING("MQTT disconnected: Unacceptable protocol version"); + } else if (reason == espMqttClientTypes::DisconnectReason::MQTT_IDENTIFIER_REJECTED) { + LOG_WARNING("MQTT disconnected: Identifier Rejected"); + } else if (reason == espMqttClientTypes::DisconnectReason::MQTT_SERVER_UNAVAILABLE) { + LOG_WARNING("MQTT disconnected: Server unavailable"); + } else if (reason == espMqttClientTypes::DisconnectReason::MQTT_MALFORMED_CREDENTIALS) { + LOG_WARNING("MQTT disconnected: Malformed credentials"); + } else if (reason == espMqttClientTypes::DisconnectReason::MQTT_NOT_AUTHORIZED) { + LOG_WARNING("MQTT disconnected: Not authorized"); + } else if (reason == espMqttClientTypes::DisconnectReason::TLS_BAD_FINGERPRINT) { + LOG_WARNING("MQTT disconnected: Server fingerprint invalid"); + } else { + LOG_WARNING("MQTT disconnected: code %d", reason); + } +} // MQTT onConnect - when an MQTT connect is established void Mqtt::on_connect() { @@ -566,6 +489,7 @@ void Mqtt::on_connect() { connecting_ = true; connectcount_++; // count # reconnects. not currently used. + queuecount_ = 0; load_settings(); // reload MQTT settings - in case they have changes @@ -594,15 +518,6 @@ void Mqtt::on_connect() { queue_publish_retain("status", "online", true); // with retain on mqtt_publish_fails_ = 0; // reset fail count to 0 - - /* - // for debugging only - LOG_INFO("Queue size: %d", mqtt_messages_.size()); - for (const auto & message : mqtt_messages_) { - auto content = message.content_; - LOG_INFO(" [%02d] (%d) topic=%s payload=%s", message.id_, content->operation, content->topic.c_str(), content->payload.c_str()); - } - */ } // Home Assistant Discovery - the main master Device called EMS-ESP @@ -672,45 +587,44 @@ void Mqtt::ha_status() { // add sub or pub task to the queue. // the base is not included in the topic -void Mqtt::queue_message(const uint8_t operation, const std::string & topic, const std::string & payload, bool retain) { +bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, const std::string & payload, const bool retain) { if (topic.empty()) { - return; + return false; } + uint16_t packet_id = 0; + char fulltopic[MQTT_TOPIC_MAX_SIZE]; -#ifndef EMSESP_STANDALONE - // anything below 60MB available free heap is dangerously low, so we stop adding to prevent a crash - // instead of doing a mqtt_messages_.pop_front() - if (mqtt_messages_.size() >= MAX_MQTT_MESSAGES || ESP.getFreeHeap() < (60 * 1024)) { - LOG_WARNING("Queue overflow (queue count=%d, topic=%s)", mqtt_messages_.size(), topic.c_str()); - mqtt_publish_fails_++; - return; // don't add to top of queue + if (topic.find(discovery_prefix_) == 0) { + strlcpy(fulltopic, topic.c_str(), sizeof(fulltopic)); // leave topic as it is + } else { + // it's a discovery topic, added the mqtt base to the topic path + snprintf(fulltopic, sizeof(fulltopic), "%s/%s", mqtt_base_.c_str(), topic.c_str()); // uses base } -#endif - - // take the topic and prefix the base, unless its for HA - std::shared_ptr message = std::make_shared(operation, topic, payload, retain); if (operation == Operation::PUBLISH) { - if (message->payload.empty()) { - LOG_DEBUG("Adding to queue: (remove) topic='%s'", message->topic.c_str()); - } else { - LOG_DEBUG("Adding to queue: (publish) topic='%s' payload=%s", message->topic.c_str(), message->payload.c_str()); - } - } else { - LOG_DEBUG("Adding to queue: (subscribe) topic='%s'", message->topic.c_str()); + packet_id = mqttClient_->publish(fulltopic, mqtt_qos_, retain, payload.c_str()); + mqtt_message_id_++; + LOG_DEBUG("Publishing topic '%s', pid %d", fulltopic, packet_id); + } else if (operation == Operation::SUBSCRIBE) { + packet_id = mqttClient_->subscribe(fulltopic, mqtt_qos_); + LOG_DEBUG("Subscribing to topic '%s', pid %d", fulltopic, packet_id); + } else if (operation == Operation::UNSUBSCRIBE) { + packet_id = mqttClient_->unsubscribe(fulltopic); + LOG_DEBUG("Unsubscribing to topic '%s', pid %d", fulltopic, packet_id); } - - mqtt_messages_.emplace_back(mqtt_message_id_++, std::move(message)); - - return; + if (packet_id == 0) { + LOG_WARNING("%s failed: %s", operation == Operation::PUBLISH ? "Publish" : operation == Operation::SUBSCRIBE ? "Subscribe" : "Unsubscribe", fulltopic); + mqtt_publish_fails_++; + } + return (packet_id != 0); } // add MQTT message to queue, payload is a string -void Mqtt::queue_publish_message(const std::string & topic, const std::string & payload, bool retain) { +bool Mqtt::queue_publish_message(const std::string & topic, const std::string & payload, const bool retain) { if (!enabled()) { - return; + return false; }; - queue_message(Operation::PUBLISH, topic, payload, retain); + return queue_message(Operation::PUBLISH, topic, payload, retain); } // add MQTT subscribe message to queue @@ -724,186 +638,77 @@ void Mqtt::queue_unsubscribe_message(const std::string & topic) { } // MQTT Publish, using a user's retain flag -void Mqtt::queue_publish(const std::string & topic, const std::string & payload) { - queue_publish_message(topic, payload, mqtt_retain_); +bool Mqtt::queue_publish(const std::string & topic, const std::string & payload) { + return queue_publish_message(topic, payload, mqtt_retain_); } // MQTT Publish, using a user's retain flag - except for char * strings -void Mqtt::queue_publish(const char * topic, const char * payload) { - queue_publish_message((topic), payload, mqtt_retain_); +bool Mqtt::queue_publish(const char * topic, const char * payload) { + return queue_publish_message((topic), payload, mqtt_retain_); } // MQTT Publish, using a specific retain flag, topic is a flash string -void Mqtt::queue_publish(const char * topic, const std::string & payload) { - queue_publish_message((topic), payload, mqtt_retain_); +bool Mqtt::queue_publish(const char * topic, const std::string & payload) { + return queue_publish_message((topic), payload, mqtt_retain_); } -void Mqtt::queue_publish(const char * topic, const JsonObject & payload) { - queue_publish_retain(topic, payload, mqtt_retain_); +bool Mqtt::queue_publish(const char * topic, const JsonObject & payload) { + return queue_publish_retain(topic, payload, mqtt_retain_); } // publish json doc, only if its not empty -void Mqtt::queue_publish(const std::string & topic, const JsonObject & payload) { - queue_publish_retain(topic, payload, mqtt_retain_); +bool Mqtt::queue_publish(const std::string & topic, const JsonObject & payload) { + return queue_publish_retain(topic, payload, mqtt_retain_); } // MQTT Publish, using a specific retain flag, topic is a flash string, forcing retain flag -void Mqtt::queue_publish_retain(const char * topic, const std::string & payload, bool retain) { - queue_publish_message((topic), payload, retain); +bool Mqtt::queue_publish_retain(const char * topic, const std::string & payload, const bool retain) { + return queue_publish_message((topic), payload, retain); } // publish json doc, only if its not empty, using the retain flag -void Mqtt::queue_publish_retain(const std::string & topic, const JsonObject & payload, bool retain) { - queue_publish_retain(topic.c_str(), payload, retain); +bool Mqtt::queue_publish_retain(const std::string & topic, const JsonObject & payload, const bool retain) { + return queue_publish_retain(topic.c_str(), payload, retain); } -void Mqtt::queue_publish_retain(const char * topic, const JsonObject & payload, bool retain) { +bool Mqtt::queue_publish_retain(const char * topic, const JsonObject & payload, const bool retain) { if (enabled() && payload.size()) { std::string payload_text; serializeJson(payload, payload_text); // convert json to string - queue_publish_message(topic, payload_text, retain); + return queue_publish_message(topic, payload_text, retain); } + return false; } // publish empty payload to remove the topic -void Mqtt::queue_remove_topic(const char * topic) { +bool Mqtt::queue_remove_topic(const char * topic) { if (!enabled()) { - return; + return false; } if (ha_enabled_) { - queue_publish_message(Mqtt::discovery_prefix() + topic, "", true); // publish with retain to remove from broker + return queue_publish_message(Mqtt::discovery_prefix() + topic, "", true); // publish with retain to remove from broker } else { - queue_publish_message(topic, "", true); // publish with retain to remove from broker + return queue_publish_message(topic, "", true); // publish with retain to remove from broker } } // queue a Home Assistant config topic and payload, with retain flag off. -void Mqtt::queue_ha(const char * topic, const JsonObject & payload) { +bool Mqtt::queue_ha(const char * topic, const JsonObject & payload) { if (!enabled()) { - return; + return false; } std::string payload_text; payload_text.reserve(measureJson(payload) + 1); - serializeJson(payload, payload_text); // convert json to string + serializeJson(payload, payload_text); // convert json to string - queue_publish_message(Mqtt::discovery_prefix() + topic, payload_text, true); // with retain true -} - -// take top from queue and perform the publish or subscribe action -// assumes there is an MQTT connection -void Mqtt::process_queue() { - if (mqtt_messages_.empty()) { - return; - } - - // fetch first from queue and create the full topic name - auto mqtt_message = mqtt_messages_.front(); - auto message = mqtt_message.content_; - char topic[MQTT_TOPIC_MAX_SIZE]; - - if (message->topic.find(discovery_prefix_) == 0) { - strlcpy(topic, message->topic.c_str(), sizeof(topic)); // leave topic as it is - } else { - // it's a discovery topic, added the mqtt base to the topic path - snprintf(topic, MQTT_TOPIC_MAX_SIZE, "%s/%s", mqtt_base_.c_str(), message->topic.c_str()); // uses base - } - - // if this has already been published and we're waiting for an ACK, don't publish again - // it will have a real packet ID - if (mqtt_message.packet_id_ > 0) { - LOG_DEBUG("Waiting for QOS-ACK"); - // if we don't get the ack within 10 seconds, republish with new packet_id - if (uuid::get_uptime_sec() - last_publish_queue_ < 10) { - return; - } - } - last_publish_queue_ = uuid::get_uptime_sec(); - - // if we're subscribing... - if (message->operation == Operation::SUBSCRIBE) { - LOG_DEBUG("Subscribing to topic '%s'", topic); - uint16_t packet_id = mqttClient_->subscribe(topic, mqtt_qos_); - if (!packet_id) { - if (++mqtt_messages_.front().retry_count_ < MQTT_PUBLISH_MAX_RETRY) { - return; - } - LOG_ERROR("Error subscribing to topic '%s'", topic); - mqtt_publish_fails_++; // increment failure counter - } - - mqtt_messages_.pop_front(); // remove the message from the queue - - return; - } - - // if we're unsubscribing... - if (message->operation == Operation::UNSUBSCRIBE) { - LOG_DEBUG("Subscribing to topic '%s'", topic); - uint16_t packet_id = mqttClient_->unsubscribe(topic); - if (!packet_id) { - if (++mqtt_messages_.front().retry_count_ < MQTT_PUBLISH_MAX_RETRY) { - return; - } - LOG_ERROR("Error unsubscribing to topic '%s'", topic); - mqtt_publish_fails_++; // increment failure counter - } - - mqtt_messages_.pop_front(); // remove the message from the queue - - return; - } - - // else try and publish it - // this is where the *real* publish happens - uint16_t packet_id = mqttClient_->publish(topic, mqtt_qos_, message->retain, message->payload.c_str(), message->payload.size(), false, mqtt_message.id_); - lasttopic_ = topic; - lastpayload_ = message->payload; - - LOG_DEBUG("Published topic %s (#%02d, retain=%d, retry=%d, size=%d, pid=%d)", - topic, - mqtt_message.id_, - message->retain, - mqtt_message.retry_count_ + 1, - message->payload.size(), - packet_id); - - /* - if (!message->payload.empty()) { - LOG_DEBUG("Payload: %s", message->payload.c_str()); // extra message for #784 - } - */ - - if (packet_id == 0) { - // it failed. if we retried n times, give up. remove from queue - if (mqtt_message.retry_count_ == (MQTT_PUBLISH_MAX_RETRY - 1)) { - LOG_ERROR("Failed to publish to %s after %d attempts", topic, mqtt_message.retry_count_ + 1); - mqtt_publish_fails_++; // increment failure counter - mqtt_messages_.pop_front(); // delete - return; - } else { - // update the record - mqtt_messages_.front().retry_count_++; - LOG_DEBUG("Failed to publish to %s. Trying again, #%d", topic, mqtt_message.retry_count_ + 1); - return; // leave on queue for next time so it gets republished - } - } - - // if we have ACK set with QOS 1 or 2, leave on queue and let the ACK process remove it - // but add the packet_id so we can check it later - if (mqtt_qos_ != 0) { - mqtt_messages_.front().packet_id_ = packet_id; - LOG_DEBUG("Setting packetID for ACK to %d", packet_id); - return; - } - - mqtt_messages_.pop_front(); // remove the message from the queue + return queue_publish_message(Mqtt::discovery_prefix() + topic, payload_text, true); // with retain true } // create's a ha sensor config topic from a device value object // and also takes a flag (create_device_config) used to also create the main HA device config. This is only needed for one entity -void Mqtt::publish_ha_sensor_config(DeviceValue & dv, const char * model, const char * brand, const bool remove, const bool create_device_config) { +bool Mqtt::publish_ha_sensor_config(DeviceValue & dv, const char * model, const char * brand, const bool remove, const bool create_device_config) { StaticJsonDocument dev_json; // always create the ids @@ -932,38 +737,39 @@ void Mqtt::publish_ha_sensor_config(DeviceValue & dv, const char * model, const // unless the entity has been marked as read-only and so it'll default to using the sensor/ type bool has_cmd = dv.has_cmd && !dv.has_state(DeviceValueState::DV_READONLY); - publish_ha_sensor_config(dv.type, - dv.tag, - dv.get_fullname().c_str(), - (dv.fullname ? dv.fullname[0] : nullptr), // EN name - dv.device_type, - dv.short_name, - dv.uom, - remove, - has_cmd, - dv.options, - dv.options_size, - dv_set_min, - dv_set_max, - dv.numeric_operator, - dev_json.as()); + return publish_ha_sensor_config(dv.type, + dv.tag, + dv.get_fullname().c_str(), + (dv.fullname ? dv.fullname[0] : nullptr), // EN name + dv.device_type, + dv.short_name, + dv.uom, + remove, + has_cmd, + dv.options, + dv.options_size, + dv_set_min, + dv_set_max, + dv.numeric_operator, + dev_json.as()); } // publish HA sensor for System using the heartbeat tag -void Mqtt::publish_system_ha_sensor_config(uint8_t type, const char * name, const char * entity, const uint8_t uom) { +bool Mqtt::publish_system_ha_sensor_config(uint8_t type, const char * name, const char * entity, const uint8_t uom) { StaticJsonDocument doc; JsonObject dev_json = doc.createNestedObject("dev"); JsonArray ids = dev_json.createNestedArray("ids"); ids.add(Mqtt::basename()); - publish_ha_sensor_config(type, DeviceValueTAG::TAG_HEARTBEAT, name, name, EMSdevice::DeviceType::SYSTEM, entity, uom, false, false, nullptr, 0, 0, 0, 0, dev_json); + return publish_ha_sensor_config( + type, DeviceValueTAG::TAG_HEARTBEAT, name, name, EMSdevice::DeviceType::SYSTEM, entity, uom, false, false, nullptr, 0, 0, 0, 0, dev_json); } // MQTT discovery configs // entity must match the key/value pair in the *_data topic // note: some extra string copying done here, it looks messy but does help with heap fragmentation issues -void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdevice::DeviceValueType +bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdevice::DeviceValueType uint8_t tag, // EMSdevice::DeviceValueTAG const char * const fullname, // fullname, already translated const char * const en_name, // original name in english @@ -980,7 +786,7 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev const JsonObject & dev_json) { // ignore if name (fullname) is empty if (!fullname || !en_name) { - return; + return false; } // create the device name @@ -1072,8 +878,7 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev // https://github.com/emsesp/EMS-ESP32/issues/196 if (remove) { LOG_DEBUG("Queuing removing topic %s", topic); - queue_remove_topic(topic); - return; + return queue_remove_topic(topic); } // build the payload @@ -1302,10 +1107,11 @@ void Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev // add "availability" section add_avty_to_doc(stat_t, doc.as(), val_cond); - queue_ha(topic, doc.as()); + // TODO queue it or send it directly via publish? + return queue_ha(topic, doc.as()); } -void Mqtt::publish_ha_climate_config(const uint8_t tag, const bool has_roomtemp, const bool remove, const int16_t min, const uint16_t max) { +bool Mqtt::publish_ha_climate_config(const uint8_t tag, const bool has_roomtemp, const bool remove, const int16_t min, const uint16_t max) { uint8_t hc_num = tag - DeviceValueTAG::TAG_HC1 + 1; char topic[Mqtt::MQTT_TOPIC_MAX_SIZE]; @@ -1326,8 +1132,7 @@ void Mqtt::publish_ha_climate_config(const uint8_t tag, const bool has_roomtemp, snprintf(topic, sizeof(topic), "climate/%s/thermostat_hc%d/config", mqtt_basename_.c_str(), hc_num); if (remove) { - queue_remove_topic(topic); // publish empty payload with retain flag - return; + return queue_remove_topic(topic); // publish empty payload with retain flag } if (Mqtt::is_nested()) { @@ -1415,7 +1220,7 @@ void Mqtt::publish_ha_climate_config(const uint8_t tag, const bool has_roomtemp, // add "availability" section add_avty_to_doc(topic_t, doc.as(), seltemp_cond, has_roomtemp ? currtemp_cond : nullptr, hc_mode_cond); - queue_ha(topic, doc.as()); // publish the config payload with retain flag + return queue_ha(topic, doc.as()); // publish the config payload with retain flag } // based on the device and tag, create the MQTT topic name (without the basename) diff --git a/src/mqtt.h b/src/mqtt.h index c1be14df7..a6f54ee8d 100644 --- a/src/mqtt.h +++ b/src/mqtt.h @@ -19,7 +19,7 @@ #ifndef EMSESP_MQTT_H_ #define EMSESP_MQTT_H_ -#include +#include #include "helpers.h" #include "system.h" @@ -31,26 +31,8 @@ using uuid::console::Shell; namespace emsesp { -// size of queue -static constexpr uint16_t MAX_MQTT_MESSAGES = 300; - using mqtt_sub_function_p = std::function; -struct MqttMessage { - const uint8_t operation; - const std::string topic; - const std::string payload; - const bool retain; - - MqttMessage(const uint8_t operation, const std::string & topic, const std::string & payload, bool retain) - : operation(operation) - , topic(topic) - , payload(payload) - , retain(retain) { - } - ~MqttMessage() = default; -}; - class Mqtt { public: enum discoveryType : uint8_t { HOMEASSISTANT, DOMOTICZ }; @@ -76,24 +58,24 @@ class Mqtt { static constexpr uint8_t MQTT_TOPIC_MAX_SIZE = 128; // fixed, not a user setting anymore static void on_connect(); - + static void on_disconnect(espMqttClientTypes::DisconnectReason reason); 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(); - static void queue_publish(const std::string & topic, const std::string & payload); - static void queue_publish(const char * topic, const char * payload); - static void queue_publish(const std::string & topic, const JsonObject & payload); - static void queue_publish(const char * topic, const JsonObject & payload); - static void queue_publish(const char * topic, const std::string & payload); - static void queue_publish_retain(const std::string & topic, const JsonObject & payload, bool retain); - static void queue_publish_retain(const char * topic, const std::string & payload, bool retain); - static void queue_publish_retain(const char * topic, const JsonObject & payload, bool retain); - static void queue_ha(const char * topic, const JsonObject & payload); - static void queue_remove_topic(const char * topic); + static bool queue_publish(const std::string & topic, const std::string & payload); + static bool queue_publish(const char * topic, const char * payload); + static bool queue_publish(const std::string & topic, const JsonObject & payload); + static bool queue_publish(const char * topic, const JsonObject & payload); + static bool queue_publish(const char * topic, const std::string & payload); + static bool queue_publish_retain(const std::string & topic, const JsonObject & payload, const bool retain); + static bool queue_publish_retain(const char * topic, const std::string & payload, const bool retain); + static bool queue_publish_retain(const char * topic, const JsonObject & payload, const bool retain); + static bool queue_ha(const char * topic, const JsonObject & payload); + static bool queue_remove_topic(const char * topic); - static void publish_ha_sensor_config(DeviceValue & dv, const char * model, const char * brand, const bool remove, const bool create_device_config = false); - static void publish_ha_sensor_config(uint8_t type, + static bool publish_ha_sensor_config(DeviceValue & dv, const char * model, const char * brand, const bool remove, const bool create_device_config = false); + static bool publish_ha_sensor_config(uint8_t type, uint8_t tag, const char * const fullname, const char * const en_name, @@ -109,8 +91,8 @@ class Mqtt { const int8_t num_op, const JsonObject & dev_json); - static void publish_system_ha_sensor_config(uint8_t type, const char * name, const char * entity, const uint8_t uom); - static void publish_ha_climate_config(const uint8_t tag, const bool has_roomtemp, const bool remove = false, const int16_t min = 5, const uint16_t max = 30); + static bool publish_system_ha_sensor_config(uint8_t type, const char * name, const char * entity, const uint8_t uom); + static bool publish_ha_climate_config(const uint8_t tag, const bool has_roomtemp, const bool remove = false, const int16_t min = 5, const uint16_t max = 30); static void show_topic_handlers(uuid::console::Shell & shell, const uint8_t device_type); static void show_mqtt(uuid::console::Shell & shell); @@ -129,7 +111,7 @@ class Mqtt { #endif } - static AsyncMqttClient * client() { + static espMqttClient * client() { return mqttClient_; } @@ -170,7 +152,7 @@ class Mqtt { } static uint32_t publish_queued() { - return mqtt_messages_.size(); + return queuecount_; } static uint8_t connect_count() { @@ -239,47 +221,24 @@ class Mqtt { mqtt_retain_ = mqtt_retain; } - static bool is_empty() { - return mqtt_messages_.empty(); - } - static std::string tag_to_topic(uint8_t device_type, uint8_t tag); static void add_avty_to_doc(const char * state_t, const JsonObject & doc, const char * cond1 = nullptr, const char * cond2 = nullptr, const char * negcond = nullptr); - struct QueuedMqttMessage { - const uint32_t id_; - const std::shared_ptr content_; - uint8_t retry_count_ = 0; - uint16_t packet_id_ = 0; - - ~QueuedMqttMessage() = default; - QueuedMqttMessage(uint32_t id, std::shared_ptr && content) - : id_(id) - , content_(std::move(content)) { - } - }; - static std::deque mqtt_messages_; - - private: static uuid::log::Logger logger_; - static AsyncMqttClient * mqttClient_; - static uint32_t mqtt_message_id_; + static espMqttClient * mqttClient_; + static uint32_t mqtt_message_id_; - static constexpr uint32_t MQTT_PUBLISH_WAIT = 100; // delay in ms between sending publishes, to account for large payloads - static constexpr uint8_t MQTT_PUBLISH_MAX_RETRY = 3; // max retries for giving up on publishing - - static void queue_message(const uint8_t operation, const std::string & topic, const std::string & payload, bool retain); - static void queue_publish_message(const std::string & topic, const std::string & payload, bool retain); + static bool queue_message(const uint8_t operation, const std::string & topic, const std::string & payload, const bool retain); + static bool queue_publish_message(const std::string & topic, const std::string & payload, const bool retain); static void queue_subscribe_message(const std::string & topic); static void queue_unsubscribe_message(const std::string & topic); void on_publish(uint16_t packetId) const; void on_message(const char * topic, const char * payload, size_t len) const; - void process_queue(); // function handlers for MQTT subscriptions struct MQTTSubFunction { @@ -306,11 +265,10 @@ class Mqtt { uint32_t last_publish_heartbeat_ = 0; uint32_t last_publish_queue_ = 0; - bool first_connect_attempted_ = false; - static bool connecting_; static bool initialized_; static uint32_t mqtt_publish_fails_; + static uint16_t queuecount_; static uint8_t connectcount_; static bool ha_climate_reset_; diff --git a/src/system.cpp b/src/system.cpp index 1903ec4af..95a3e3286 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -61,7 +61,7 @@ const char * const languages[] = {EMSESP_LOCALE_EN}; const char * const languages[] = {EMSESP_LOCALE_DE}; #else const char * const languages[] = - {EMSESP_LOCALE_EN, EMSESP_LOCALE_DE, EMSESP_LOCALE_NL, EMSESP_LOCALE_SV, EMSESP_LOCALE_PL, EMSESP_LOCALE_NO, EMSESP_LOCALE_FR, EMSESP_LOCALE_TR}; + {EMSESP_LOCALE_EN, EMSESP_LOCALE_DE, EMSESP_LOCALE_NL, EMSESP_LOCALE_SV, EMSESP_LOCALE_PL, EMSESP_LOCALE_NO, EMSESP_LOCALE_FR, EMSESP_LOCALE_TR, EMSESP_LOCALE_IT}; #endif static constexpr uint8_t NUM_LANGUAGES = sizeof(languages) / sizeof(const char *); diff --git a/src/web/WebDataService.cpp b/src/web/WebDataService.cpp index 77ec4566b..244218682 100644 --- a/src/web/WebDataService.cpp +++ b/src/web/WebDataService.cpp @@ -245,7 +245,7 @@ void WebDataService::write_device_value(AsyncWebServerRequest * request, JsonVar // the data could be in any format, but we need string // authenticated is always true JsonVariant data = dv["v"]; // the value in any format - uint8_t return_code = CommandRet::OK; + uint8_t return_code = CommandRet::NOT_FOUND; uint8_t device_type = emsdevice->device_type(); if (data.is()) { return_code = Command::call(device_type, cmd, data.as(), true, id, output); @@ -282,16 +282,16 @@ void WebDataService::write_device_value(AsyncWebServerRequest * request, JsonVar auto * response = new AsyncJsonResponse(false, EMSESP_JSON_SIZE_SMALL); JsonObject output = response->getRoot(); JsonVariant data = dv["v"]; // the value in any format - uint8_t return_code = CommandRet::OK; + uint8_t return_code = CommandRet::NOT_FOUND; uint8_t device_type = EMSdevice::DeviceType::CUSTOM; - if (data.is()) { + if (data.is()) { + return_code = Command::call(device_type, cmd, data.as(), true, id, output); + } else if (data.is()) { char s[10]; return_code = Command::call(device_type, cmd, Helpers::render_value(s, data.as(), 0), true, id, output); } else if (data.is()) { char s[10]; return_code = Command::call(device_type, cmd, Helpers::render_value(s, data.as(), 1), true, id, output); - } else if (data.is()) { - return_code = Command::call(device_type, cmd, data.as() ? "true" : "false", true, id, output); } if (return_code != CommandRet::OK) { EMSESP::logger().err("Write command failed %s (%s)", (const char *)output["message"], Command::return_code_string(return_code).c_str()); diff --git a/src/web/WebEntityService.cpp b/src/web/WebEntityService.cpp index 457c3e1d1..12f4e7446 100644 --- a/src/web/WebEntityService.cpp +++ b/src/web/WebEntityService.cpp @@ -83,10 +83,12 @@ StateUpdateResult WebEntity::update(JsonObject & root, WebEntity & webEntity) { entityItem.value = EMS_VALUE_DEFAULT_SHORT; } else if (entityItem.value_type == DeviceValueType::USHORT) { entityItem.value = EMS_VALUE_DEFAULT_USHORT; - } else { // if (entityItem.value_type == DeviceValueType::ULONG || entityItem.valuetype == DeviceValueType::TIME) { + } else { // if (entityItem.value_type == DeviceValueType::ULONG || entityItem.value_type == DeviceValueType::TIME) { entityItem.value = EMS_VALUE_DEFAULT_ULONG; } - + if (entityItem.factor == 0) { + entityItem.factor = 1; + } webEntity.entityItems.push_back(entityItem); // add to list if (entityItem.writeable) { @@ -108,13 +110,13 @@ StateUpdateResult WebEntity::update(JsonObject & root, WebEntity & webEntity) { bool WebEntityService::command_setvalue(const char * value, const std::string name) { EMSESP::webEntityService.read([&](WebEntity & webEntity) { entityItems = &webEntity.entityItems; }); for (EntityItem & entityItem : *entityItems) { - if (entityItem.name == name) { + if (Helpers::toLower(entityItem.name) == Helpers::toLower(name)) { if (entityItem.value_type == DeviceValueType::BOOL) { bool v; if (!Helpers::value2bool(value, v)) { return false; } - EMSESP::send_write_request(entityItem.type_id, entityItem.device_id, entityItem.offset, v ? entityItem.type_id > 0xFF ? 1 : 0xFF : 0, 0); + EMSESP::send_write_request(entityItem.type_id, entityItem.device_id, entityItem.offset, v ? 0xFF : 0, 0); } else { float f; if (!Helpers::value2float(value, f)) { @@ -226,6 +228,7 @@ bool WebEntityService::get_value_info(JsonObject & output, const char * cmd) { if (Helpers::toLower(entity.name) == Helpers::toLower(command_s)) { output["name"] = entity.name; output["uom"] = EMSdevice::uom_to_string(entity.uom); + output["type"] = entity.value_type == DeviceValueType::BOOL ? "boolean" : F_(number); output["readable"] = true; output["writeable"] = entity.writeable; output["visible"] = true; @@ -311,20 +314,47 @@ void WebEntityService::publish(const bool force) { config["name"] = entityItem.name.c_str(); char topic[Mqtt::MQTT_TOPIC_MAX_SIZE]; - snprintf(topic, sizeof(topic), "sensor/%s/custom_%s/config", Mqtt::basename().c_str(), entityItem.name.c_str()); - - // char command_topic[Mqtt::MQTT_TOPIC_MAX_SIZE]; - // snprintf(command_topic, sizeof(command_topic), "%s/custom/%s", Mqtt::basename().c_str(), entityItem.name.c_str()); - // config["cmd_t"] = command_topic; - + if (entityItem.writeable) { + if (entityItem.value_type == DeviceValueType::BOOL) { + snprintf(topic, sizeof(topic), "switch/%s/custom_%s/config", Mqtt::basename().c_str(), entityItem.name.c_str()); + } else if (Mqtt::discovery_type() == Mqtt::discoveryType::HOMEASSISTANT) { + snprintf(topic, sizeof(topic), "number/%s/custom_%s/config", Mqtt::basename().c_str(), entityItem.name.c_str()); + } else { + snprintf(topic, sizeof(topic), "sensor/%s/custom_%s/config", Mqtt::basename().c_str(), entityItem.name.c_str()); + } + char command_topic[Mqtt::MQTT_TOPIC_MAX_SIZE]; + snprintf(command_topic, sizeof(command_topic), "%s/custom/%s", Mqtt::basename().c_str(), entityItem.name.c_str()); + config["cmd_t"] = command_topic; + } else { + if (entityItem.value_type == DeviceValueType::BOOL) { + snprintf(topic, sizeof(topic), "binary_sensor/%s/custom_%s/config", Mqtt::basename().c_str(), entityItem.name.c_str()); + } else { + snprintf(topic, sizeof(topic), "sensor/%s/custom_%s/config", Mqtt::basename().c_str(), entityItem.name.c_str()); + } + } + if (entityItem.value_type == DeviceValueType::BOOL) { + // applies to both Binary Sensor (read only) and a Switch (for a command) + if (EMSESP::system_.bool_format() == BOOL_FORMAT_TRUEFALSE) { + config["pl_on"] = true; + config["pl_off"] = false; + } else if (EMSESP::system_.bool_format() == BOOL_FORMAT_10) { + config["pl_on"] = 1; + config["pl_off"] = 0; + } else { + char result[12]; + config["pl_on"] = Helpers::render_boolean(result, true); + config["pl_off"] = Helpers::render_boolean(result, false); + } + } JsonObject dev = config.createNestedObject("dev"); JsonArray ids = dev.createNestedArray("ids"); ids.add(Mqtt::basename()); // add "availability" section Mqtt::add_avty_to_doc(stat_t, config.as(), val_cond); - Mqtt::queue_ha(topic, config.as()); - ha_registered_ = true; + if (Mqtt::queue_ha(topic, config.as())) { + ha_registered_ = true; + } } } if (output.size() > 0) { @@ -350,6 +380,15 @@ uint8_t WebEntityService::count_entities() { return count; } +uint8_t WebEntityService::has_commands() { + EMSESP::webEntityService.read([&](WebEntity & webEntity) { entityItems = &webEntity.entityItems; }); + uint8_t count = 0; + for (const EntityItem & entity : *entityItems) { + count += entity.writeable ? 1 : 0; + } + return count; +} + // send to dashboard, msgpack don't like serialized, use number void WebEntityService::generate_value_web(JsonObject & output) { EMSESP::webEntityService.read([&](WebEntity & webEntity) { entityItems = &webEntity.entityItems; }); @@ -363,6 +402,10 @@ void WebEntityService::generate_value_web(JsonObject & output) { obj["u"] = entity.uom; if (entity.writeable) { obj["c"] = entity.name; + if (entity.value_type != DeviceValueType::BOOL) { + char s[10]; + obj["s"] = Helpers::render_value(s, entity.factor, 1); + } } switch (entity.value_type) { diff --git a/src/web/WebEntityService.h b/src/web/WebEntityService.h index 9010cacf1..05160ee1a 100644 --- a/src/web/WebEntityService.h +++ b/src/web/WebEntityService.h @@ -60,6 +60,7 @@ class WebEntityService : public StatefulService { void fetch(); void render_value(JsonObject & output, EntityItem entity, const bool useVal = false, const bool web = false); uint8_t count_entities(); + uint8_t has_commands(); void generate_value_web(JsonObject & output);