From b1750265aa9a4bb1365da973b447c5a6f45346d9 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Wed, 19 Jun 2024 11:46:20 +0200 Subject: [PATCH 1/6] back to arduino core 2.xx --- platformio.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio.ini b/platformio.ini index 12c81802d..b2e4be24a 100644 --- a/platformio.ini +++ b/platformio.ini @@ -38,7 +38,7 @@ unbuild_flags = ${common.core_unbuild_flags} [espressi32_base] -platform = espressif32 +platform = espressif32@6.7.0 framework = arduino board_build.filesystem = littlefs build_flags = @@ -51,9 +51,9 @@ extra_scripts = [espressi32_base_tasmota] ; use Tasmota's library which removes some unused libs (like mbedtsl, so no WiFi_secure.h) and increases available heap ; Tasmota Arduino Core 2.0.17 with IPv6 support, based on IDF 4.4.7 -; platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.05.00/platform-espressif32.zip +platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.05.00/platform-espressif32.zip ; Tasmota Arduino Core 3.0.1.240605 based on IDF v5.1.4.240602 -platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.06.10/platform-espressif32.zip +; platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.06.10/platform-espressif32.zip framework = arduino board_build.filesystem = littlefs build_flags = From fbc3807daacb1b0b1fb836d8973d619935c13bf7 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 20 Jun 2024 14:50:25 +0200 Subject: [PATCH 2/6] update packages, arduino test --- interface/package.json | 4 +- interface/yarn.lock | 126 ++++++++++++++++++++--------------------- platformio.ini | 2 +- 3 files changed, 66 insertions(+), 66 deletions(-) diff --git a/interface/package.json b/interface/package.json index be3f07805..21d2ac923 100644 --- a/interface/package.json +++ b/interface/package.json @@ -30,7 +30,7 @@ "@mui/material": "^5.15.20", "@table-library/react-table-library": "4.1.7", "@types/lodash-es": "^4.17.12", - "@types/node": "^20.14.2", + "@types/node": "^20.14.5", "@types/react": "^18.3.3", "@types/react-dom": "^18.3.0", "@types/react-router-dom": "^5.3.3", @@ -63,7 +63,7 @@ "prettier": "^3.3.2", "rollup-plugin-visualizer": "^5.12.0", "terser": "^5.31.1", - "typescript-eslint": "^7.13.0", + "typescript-eslint": "^7.13.1", "vite": "^5.3.1", "vite-plugin-imagemin": "^0.6.1", "vite-tsconfig-paths": "^4.3.2" diff --git a/interface/yarn.lock b/interface/yarn.lock index 164becec1..8b2b946ce 100644 --- a/interface/yarn.lock +++ b/interface/yarn.lock @@ -1760,12 +1760,12 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^20.14.2": - version: 20.14.2 - resolution: "@types/node@npm:20.14.2" +"@types/node@npm:^20.14.5": + version: 20.14.5 + resolution: "@types/node@npm:20.14.5" dependencies: undici-types: "npm:~5.26.4" - checksum: 10c0/2d86e5f2227aaa42212e82ea0affe72799111b888ff900916376450b02b09b963ca888b20d9c332d8d2b833ed4781987867a38eaa2e4863fa8439071468b0a6f + checksum: 10c0/06a8c304b5f7f190d4497807dc67ad09ee7b14ea2996bfdc823553c624698d8cab1ef9d16f8b764f20cb9eb11caa0e832787741e9ef70e1c89d620797ab28436 languageName: node linkType: hard @@ -1860,15 +1860,15 @@ __metadata: languageName: node linkType: hard -"@typescript-eslint/eslint-plugin@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/eslint-plugin@npm:7.13.0" +"@typescript-eslint/eslint-plugin@npm:7.13.1": + version: 7.13.1 + resolution: "@typescript-eslint/eslint-plugin@npm:7.13.1" dependencies: "@eslint-community/regexpp": "npm:^4.10.0" - "@typescript-eslint/scope-manager": "npm:7.13.0" - "@typescript-eslint/type-utils": "npm:7.13.0" - "@typescript-eslint/utils": "npm:7.13.0" - "@typescript-eslint/visitor-keys": "npm:7.13.0" + "@typescript-eslint/scope-manager": "npm:7.13.1" + "@typescript-eslint/type-utils": "npm:7.13.1" + "@typescript-eslint/utils": "npm:7.13.1" + "@typescript-eslint/visitor-keys": "npm:7.13.1" graphemer: "npm:^1.4.0" ignore: "npm:^5.3.1" natural-compare: "npm:^1.4.0" @@ -1879,44 +1879,44 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10c0/00a69d029713252c03490e0a9c49c9136d99c9c1888dd3570b1e044c9a740b59c2e488849beda654d6fc0a69e2549445c16d443bcf5832c66b7a4472b42826ae + checksum: 10c0/6677f9c090a25978e4e20c24d67365ad89ca1208ebd2bb103d3f1e15a7deea22dea538e9f61f3a3d4f03a741179acf58c02ad7d03f805aceabb78929a8dc1908 languageName: node linkType: hard -"@typescript-eslint/parser@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/parser@npm:7.13.0" +"@typescript-eslint/parser@npm:7.13.1": + version: 7.13.1 + resolution: "@typescript-eslint/parser@npm:7.13.1" dependencies: - "@typescript-eslint/scope-manager": "npm:7.13.0" - "@typescript-eslint/types": "npm:7.13.0" - "@typescript-eslint/typescript-estree": "npm:7.13.0" - "@typescript-eslint/visitor-keys": "npm:7.13.0" + "@typescript-eslint/scope-manager": "npm:7.13.1" + "@typescript-eslint/types": "npm:7.13.1" + "@typescript-eslint/typescript-estree": "npm:7.13.1" + "@typescript-eslint/visitor-keys": "npm:7.13.1" debug: "npm:^4.3.4" peerDependencies: eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/8cf58116d6577c9459db3e3047e337dc41d914bf222a33b20e149515d037e09e6171fbac5af02b66aa6fbad81dd492fa5b7bcd44aaf659d4e9b02ab23100f955 + checksum: 10c0/455d067bfb81fa3d133c75ebc4d8d7f2de5001441585f5b58dc8b0d4380d7397dc3745e11a9299d596dfa581265fdcdea6c28b2ddd2d3b542869c851ecd52fcd languageName: node linkType: hard -"@typescript-eslint/scope-manager@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/scope-manager@npm:7.13.0" +"@typescript-eslint/scope-manager@npm:7.13.1": + version: 7.13.1 + resolution: "@typescript-eslint/scope-manager@npm:7.13.1" dependencies: - "@typescript-eslint/types": "npm:7.13.0" - "@typescript-eslint/visitor-keys": "npm:7.13.0" - checksum: 10c0/0f5c75578ee8cb3c31b9c4e222f4787ea4621fde639f3ac0a467e56250f3cc48bf69304c33b2b8cc8ba5ec69f3977b6c463b8d9e791806af9a8c6a2233505432 + "@typescript-eslint/types": "npm:7.13.1" + "@typescript-eslint/visitor-keys": "npm:7.13.1" + checksum: 10c0/3d8770bf9c89e7a07e54efbc3dac6df02c0ce49d49575076111ac663566c90cbb852f06c94a311db7c0aec1fab0417f3ef6e601b3852aa30bed75c65f4f076f4 languageName: node linkType: hard -"@typescript-eslint/type-utils@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/type-utils@npm:7.13.0" +"@typescript-eslint/type-utils@npm:7.13.1": + version: 7.13.1 + resolution: "@typescript-eslint/type-utils@npm:7.13.1" dependencies: - "@typescript-eslint/typescript-estree": "npm:7.13.0" - "@typescript-eslint/utils": "npm:7.13.0" + "@typescript-eslint/typescript-estree": "npm:7.13.1" + "@typescript-eslint/utils": "npm:7.13.1" debug: "npm:^4.3.4" ts-api-utils: "npm:^1.3.0" peerDependencies: @@ -1924,23 +1924,23 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10c0/240e9b34e8602444cd234b84c9e3e52c565e3141a4942751f597c38cee48f7cb43c42a093d219ac6404dca2e74b54d2a8121fe66cbc59f404cb0ec2adecd8520 + checksum: 10c0/c02305dccb0b2c7dcc9249230078c83e851ee589f93e08eb6cdc0b4c38d78d85ef4996631ac427836ee9d0a868ac031417feb74a6e4d0600096f41ca3c0e99a0 languageName: node linkType: hard -"@typescript-eslint/types@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/types@npm:7.13.0" - checksum: 10c0/73dc59d4b0d0f0fed9f4b9b55f143185259ced5f0ca8ad9efa881eea1ff1cc9ccc1f175af2e2069f7b92a69c9f64f9be29d160c932b8f70a129af6b738b23be0 +"@typescript-eslint/types@npm:7.13.1": + version: 7.13.1 + resolution: "@typescript-eslint/types@npm:7.13.1" + checksum: 10c0/38a01004e11259e457ae2fd02300ef362a3268a8fc70addfbf1508e2edcaca72da2f0f8771e42c1cb9f191c1f754af583cdcaebd830c8e3c3f796dcf30d3c3a8 languageName: node linkType: hard -"@typescript-eslint/typescript-estree@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/typescript-estree@npm:7.13.0" +"@typescript-eslint/typescript-estree@npm:7.13.1": + version: 7.13.1 + resolution: "@typescript-eslint/typescript-estree@npm:7.13.1" dependencies: - "@typescript-eslint/types": "npm:7.13.0" - "@typescript-eslint/visitor-keys": "npm:7.13.0" + "@typescript-eslint/types": "npm:7.13.1" + "@typescript-eslint/visitor-keys": "npm:7.13.1" debug: "npm:^4.3.4" globby: "npm:^11.1.0" is-glob: "npm:^4.0.3" @@ -1950,31 +1950,31 @@ __metadata: peerDependenciesMeta: typescript: optional: true - checksum: 10c0/75b09384bc14afa3d3623507432d19d8ca91c4e936b1d2c1cfe4654a9c07179f1bc04aa99d1b541e84e40a01536862b23058f462d61b4a797c27d02f64b8aa51 + checksum: 10c0/bd5c8951ae79e8eacd05ff100def02926c633045a1a54426f98f20b4ca31c485968af3226dd7939934dfaf36a6b5fcb3386948e2a7d763ddee2db905ac187ebc languageName: node linkType: hard -"@typescript-eslint/utils@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/utils@npm:7.13.0" +"@typescript-eslint/utils@npm:7.13.1": + version: 7.13.1 + resolution: "@typescript-eslint/utils@npm:7.13.1" dependencies: "@eslint-community/eslint-utils": "npm:^4.4.0" - "@typescript-eslint/scope-manager": "npm:7.13.0" - "@typescript-eslint/types": "npm:7.13.0" - "@typescript-eslint/typescript-estree": "npm:7.13.0" + "@typescript-eslint/scope-manager": "npm:7.13.1" + "@typescript-eslint/types": "npm:7.13.1" + "@typescript-eslint/typescript-estree": "npm:7.13.1" peerDependencies: eslint: ^8.56.0 - checksum: 10c0/5391f628775dec1a7033d954a066b77eeb03ac04c0a94690e60d8ebe351b57fdbda51b90cf785c901bcdf68b88ca3bcb5533ac59276b8b626b73eb18ac3280b6 + checksum: 10c0/d2f6be42a80608ed265b34a5f6a0c97dc0b627d53b91e83d87c7d67541cb5b3c038e7320026b4ad8dfafe1ac07a0554efa8fe7673f54d74b68c253d6f9519bb6 languageName: node linkType: hard -"@typescript-eslint/visitor-keys@npm:7.13.0": - version: 7.13.0 - resolution: "@typescript-eslint/visitor-keys@npm:7.13.0" +"@typescript-eslint/visitor-keys@npm:7.13.1": + version: 7.13.1 + resolution: "@typescript-eslint/visitor-keys@npm:7.13.1" dependencies: - "@typescript-eslint/types": "npm:7.13.0" + "@typescript-eslint/types": "npm:7.13.1" eslint-visitor-keys: "npm:^3.4.3" - checksum: 10c0/5daa45c3358aeab41495c4419cc26fbbe54a42bb18c6f0f70f0ac31cb7bc5890ec6478a1a6bb00b0b8522663fe5466ee0fd2972bd4235b07140918875797f4eb + checksum: 10c0/23c1bb896173cadfb33e3801420a70aa2f0481384caa3b534b04f7920acdb9d8f7d635fcaf1f8c7fc78ebce71b8f2435391608d120091761ad2e2c00eb870832 languageName: node linkType: hard @@ -1996,7 +1996,7 @@ __metadata: "@trivago/prettier-plugin-sort-imports": "npm:^4.3.0" "@types/babel__core": "npm:^7" "@types/lodash-es": "npm:^4.17.12" - "@types/node": "npm:^20.14.2" + "@types/node": "npm:^20.14.5" "@types/react": "npm:^18.3.3" "@types/react-dom": "npm:^18.3.0" "@types/react-router-dom": "npm:^5.3.3" @@ -2021,7 +2021,7 @@ __metadata: terser: "npm:^5.31.1" typesafe-i18n: "npm:^5.26.2" typescript: "npm:^5.4.5" - typescript-eslint: "npm:^7.13.0" + typescript-eslint: "npm:^7.13.1" vite: "npm:^5.3.1" vite-plugin-imagemin: "npm:^0.6.1" vite-tsconfig-paths: "npm:^4.3.2" @@ -7139,19 +7139,19 @@ __metadata: languageName: node linkType: hard -"typescript-eslint@npm:^7.13.0": - version: 7.13.0 - resolution: "typescript-eslint@npm:7.13.0" +"typescript-eslint@npm:^7.13.1": + version: 7.13.1 + resolution: "typescript-eslint@npm:7.13.1" dependencies: - "@typescript-eslint/eslint-plugin": "npm:7.13.0" - "@typescript-eslint/parser": "npm:7.13.0" - "@typescript-eslint/utils": "npm:7.13.0" + "@typescript-eslint/eslint-plugin": "npm:7.13.1" + "@typescript-eslint/parser": "npm:7.13.1" + "@typescript-eslint/utils": "npm:7.13.1" peerDependencies: eslint: ^8.56.0 peerDependenciesMeta: typescript: optional: true - checksum: 10c0/ad067868ede764d411f4933285faca0d41c7e3ca439d7aac032ed78db7703e9842f5bbad4344004fa876a3577cda3c56b0716897f94a0d1aec00a90d6c0d3990 + checksum: 10c0/b929e865cdbf2b8b5dd417d40a6af2d76bb87a8ad3879dcde9a0f66b478906247ec3378aa7ab4c0659ddae73ba4bb15167053ff20a552e192f352797e94bee46 languageName: node linkType: hard diff --git a/platformio.ini b/platformio.ini index b2e4be24a..5018a2588 100644 --- a/platformio.ini +++ b/platformio.ini @@ -195,7 +195,7 @@ build_flags = [env:espressi32_v3] platform = espressif32 platform_packages= - platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.0-rc2 + platformio/framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.1 platformio/framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-libs.git#idf-release/v5.1 framework = arduino board = esp32dev From a861649249c6b3b25187e4b4a41eea7c375eba49 Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 20 Jun 2024 17:13:38 +0100 Subject: [PATCH 3/6] fix sonar (again!) --- .github/workflows/sonar_check.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/sonar_check.yml b/.github/workflows/sonar_check.yml index 105136618..38e306ade 100644 --- a/.github/workflows/sonar_check.yml +++ b/.github/workflows/sonar_check.yml @@ -1,30 +1,29 @@ +# see https://github.com/marketplace/actions/sonarcloud-scan-for-c-and-c#usage name: Sonar Check + on: push: branches: - dev pull_request: types: [opened, synchronize, reopened] + jobs: build: name: Build and analyze runs-on: ubuntu-latest - # if: github.repository_owner == 'emsesp' - # if: github.repository == 'emsesp/EMS-ESP32' env: BUILD_WRAPPER_OUT_DIR: bw-output steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis + fetch-depth: 0 - name: Install sonar-scanner and build-wrapper uses: SonarSource/sonarcloud-github-c-cpp@v2 - name: Run build-wrapper - run: | - build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make all + run: build-wrapper-linux-x86-64 --out-dir ${{ env.BUILD_WRAPPER_OUT_DIR }} make all - name: Run sonar-scanner env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} - run: | - sonar-scanner + run: sonar-scanner --define sonar.cfamily.compile-commands="${{ env.BUILD_WRAPPER_OUT_DIR }}/compile_commands.json" From 12701b2143542fb3c98429dfccb4593384c462be Mon Sep 17 00:00:00 2001 From: proddy Date: Thu, 20 Jun 2024 17:13:50 +0100 Subject: [PATCH 4/6] max shower min duration 6 minutes --- interface/src/project/validators.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/interface/src/project/validators.ts b/interface/src/project/validators.ts index c721dca84..c60b0a2da 100644 --- a/interface/src/project/validators.ts +++ b/interface/src/project/validators.ts @@ -238,9 +238,9 @@ export const createSettingsValidator = (settings: Settings) => shower_min_duration: [ { type: 'number', - min: 1, - max: 3000, - message: 'Time must be between 1 and 3000 seconds' + min: 10, + max: 360, + message: 'Time must be between 10 and 360 seconds' } ] }), From 1b09a301baf2b6376b584e511714305775c74110 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 20 Jun 2024 19:46:09 +0200 Subject: [PATCH 5/6] Make remotetimeout editable #1774, dev-16 --- CHANGELOG_LATEST.md | 1 + interface/src/i18n/de/index.ts | 3 ++ interface/src/i18n/en/index.ts | 3 ++ interface/src/i18n/fr/index.ts | 3 ++ interface/src/i18n/it/index.ts | 3 ++ interface/src/i18n/nl/index.ts | 3 ++ interface/src/i18n/no/index.ts | 3 ++ interface/src/i18n/pl/index.ts | 3 ++ interface/src/i18n/sk/index.ts | 3 ++ interface/src/i18n/sv/index.ts | 3 ++ interface/src/i18n/tr/index.ts | 3 ++ interface/src/project/ApplicationSettings.tsx | 42 ++++++++++++++++++- interface/src/project/types.ts | 2 + interface/src/project/validators.ts | 10 +++++ src/default_settings.h | 8 ++++ src/roomcontrol.cpp | 7 +++- src/roomcontrol.h | 2 + src/version.h | 2 +- src/web/WebSettingsService.cpp | 13 ++++-- src/web/WebSettingsService.h | 6 ++- 20 files changed, 113 insertions(+), 10 deletions(-) diff --git a/CHANGELOG_LATEST.md b/CHANGELOG_LATEST.md index 11b8cd41d..c1b48dafa 100644 --- a/CHANGELOG_LATEST.md +++ b/CHANGELOG_LATEST.md @@ -22,6 +22,7 @@ - timeout for remote thermostat emulation [#1680](https://github.com/emsesp/EMS-ESP32/discussions/1680), [#1774](https://github.com/emsesp/EMS-ESP32/issues/1774) - CR120 thermostat as own model() [#1779](https://github.com/emsesp/EMS-ESP32/discussions/1779) - Modules - external linkable module library [#1778](https://github.com/emsesp/EMS-ESP32/issues/1778) +- make remote control timeout editable [#1774](https://github.com/emsesp/EMS-ESP32/issues/1774) ## Fixed diff --git a/interface/src/i18n/de/index.ts b/interface/src/i18n/de/index.ts index 3d9400fac..d59f7e195 100644 --- a/interface/src/i18n/de/index.ts +++ b/interface/src/i18n/de/index.ts @@ -120,7 +120,10 @@ const de: Translation = { BYPASS_TOKEN: 'Zugriffstoken-Autorisierung bei API-Aufrufen umgehen', READONLY: 'Nur-Lese-Modus aktivieren (blockiert alle ausgehenden EMS Tx Write-Befehle)', UNDERCLOCK_CPU: 'CPU-Geschwindigkeit untertakten', + REMOTE_TIMEOUT: 'Timeout', + REMOTE_TIMEOUT_EN: 'Deaktitiere Remote bei fehender Temperatur', HEATINGOFF: 'Heizen ausschalten beim EMS-ESP Start', + MIN_DURATION: 'Dauer bis die Dusche erkannt wrid', ENABLE_SHOWER_TIMER: 'Duschtimer aktivieren', ENABLE_SHOWER_ALERT: 'Duschalarm aktivieren', TRIGGER_TIME: 'Auslösezeit', diff --git a/interface/src/i18n/en/index.ts b/interface/src/i18n/en/index.ts index 8d75dc146..9fdd9977b 100644 --- a/interface/src/i18n/en/index.ts +++ b/interface/src/i18n/en/index.ts @@ -120,7 +120,10 @@ const en: Translation = { BYPASS_TOKEN: 'Bypass Access Token authorization on API calls', READONLY: 'Enable read-only mode (blocks all outgoing EMS Tx Write commands)', UNDERCLOCK_CPU: 'Underclock CPU speed', + REMOTE_TIMEOUT: 'Remote timeout', + REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature', HEATINGOFF: 'Start boiler with forced heating off', + MIN_DURATION: 'Time for detection shower', ENABLE_SHOWER_TIMER: 'Enable Shower Timer', ENABLE_SHOWER_ALERT: 'Enable Shower Alert', TRIGGER_TIME: 'Trigger Time', diff --git a/interface/src/i18n/fr/index.ts b/interface/src/i18n/fr/index.ts index 0d46fcbe9..1799cdfd1 100644 --- a/interface/src/i18n/fr/index.ts +++ b/interface/src/i18n/fr/index.ts @@ -121,6 +121,9 @@ const fr: Translation = { READONLY: 'Activer le mode lecture uniquement (bloque toutes les commandes EMS sortantes en écriture Tx)', UNDERCLOCK_CPU: 'Underclock du CPU', HEATINGOFF: 'Start boiler with forced heating off', // TODO translate + REMOTE_TIMEOUT: 'Remote timeout', + REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature', + MIN_DURATION: 'Time for detection shower', ENABLE_SHOWER_TIMER: 'Activer la minuterie de la douche', ENABLE_SHOWER_ALERT: 'Activer les alertes de durée de douche', TRIGGER_TIME: 'Durée avant déclenchement', diff --git a/interface/src/i18n/it/index.ts b/interface/src/i18n/it/index.ts index 280ec5f91..15b6c3bd0 100644 --- a/interface/src/i18n/it/index.ts +++ b/interface/src/i18n/it/index.ts @@ -120,7 +120,10 @@ const it: Translation = { 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', + REMOTE_TIMEOUT: 'Remote timeout', + REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature', HEATINGOFF: 'Avviamento caldaia con riscaldamento forzato spento', + MIN_DURATION: 'Time for detection shower', ENABLE_SHOWER_TIMER: 'Abilita timer doccia', ENABLE_SHOWER_ALERT: 'Abilita avviso doccia', TRIGGER_TIME: 'Tempo di avvio', diff --git a/interface/src/i18n/nl/index.ts b/interface/src/i18n/nl/index.ts index 99d20a731..e8ece543d 100644 --- a/interface/src/i18n/nl/index.ts +++ b/interface/src/i18n/nl/index.ts @@ -120,7 +120,10 @@ const nl: Translation = { BYPASS_TOKEN: 'API Access Token authenticatie uitschakelen', READONLY: 'Activeer read-only modus (blokkeert alle outgaande EMS Tx schrijf commandos)', UNDERCLOCK_CPU: 'Underclock CPU snelheid', + REMOTE_TIMEOUT: 'Remote timeout', + REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature', HEATINGOFF: 'Start ketel met geforceerde verwarming uit', + MIN_DURATION: 'Time for detection shower', ENABLE_SHOWER_TIMER: 'Activeer Douche Timer (tijdmeting)', ENABLE_SHOWER_ALERT: 'Activeer Douchemelding', TRIGGER_TIME: 'Trigger tijd', diff --git a/interface/src/i18n/no/index.ts b/interface/src/i18n/no/index.ts index 33d548bce..025cb91a8 100644 --- a/interface/src/i18n/no/index.ts +++ b/interface/src/i18n/no/index.ts @@ -120,7 +120,10 @@ const no: Translation = { BYPASS_TOKEN: 'Utelat Aksess Token authorisering av API kall', READONLY: 'Aktiver read-only modus (blokker all EMS Tx Skriving)', UNDERCLOCK_CPU: 'Underklokking av prosessorhastighet', + REMOTE_TIMEOUT: 'Remote timeout', + REMOTE_TIMEOUT_EN: 'Disable remote control on missing roomtemperature', HEATINGOFF: 'Start boiler with forced heating off', // TODO translate + MIN_DURATION: 'Time for detection shower', ENABLE_SHOWER_TIMER: 'Aktiver Dusjtimer', ENABLE_SHOWER_ALERT: 'Aktiver Dusj-varsling', TRIGGER_TIME: 'Aktiveringstid', diff --git a/interface/src/i18n/pl/index.ts b/interface/src/i18n/pl/index.ts index e31b8ff60..b14fb564b 100644 --- a/interface/src/i18n/pl/index.ts +++ b/interface/src/i18n/pl/index.ts @@ -120,7 +120,10 @@ const pl: BaseTranslation = { BYPASS_TOKEN: 'Pomiń autoryzację tokenem w wywołaniach API', READONLY: 'Tryb pracy "tylko do odczytu" (blokuje wszystkie komendy zapisu na magistralę EMS)', UNDERCLOCK_CPU: 'Obniż taktowanie CPU', + REMOTE_TIMEOUT: 'Remote timeout', + REMOTE_TIMEOUT_EN: 'Disable remote control on missing roomtemperature', HEATINGOFF: 'Uruchom kocioł z wymuszonym wyłączonym grzaniem', + MIN_DURATION: 'Time for detection shower', ENABLE_SHOWER_TIMER: 'Aktywuj minutnik prysznica', ENABLE_SHOWER_ALERT: 'Aktywuj alarm prysznica', TRIGGER_TIME: 'Wyzwalaj po czasie', diff --git a/interface/src/i18n/sk/index.ts b/interface/src/i18n/sk/index.ts index c4c65ce65..5e3e599e9 100644 --- a/interface/src/i18n/sk/index.ts +++ b/interface/src/i18n/sk/index.ts @@ -120,7 +120,10 @@ const sk: Translation = { BYPASS_TOKEN: 'Vynechajte autorizáciu prístupového tokenu pri volaniach API', READONLY: 'Povoliť režim len na čítanie (blokuje všetky odchádzajúce príkazy EMS Tx Write)', UNDERCLOCK_CPU: 'Podtaktovanie rýchlosti procesora', + REMOTE_TIMEOUT: 'Remote timeout', + REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature', HEATINGOFF: 'Spustiť kotol s vynúteným vykurovaním', + MIN_DURATION: 'Time for detection shower', ENABLE_SHOWER_TIMER: 'Povoliť časovač sprchovania', ENABLE_SHOWER_ALERT: 'Povoliť upozornenie na sprchu', TRIGGER_TIME: 'Čas spustenia', diff --git a/interface/src/i18n/sv/index.ts b/interface/src/i18n/sv/index.ts index 5f06f30c8..523b45b35 100644 --- a/interface/src/i18n/sv/index.ts +++ b/interface/src/i18n/sv/index.ts @@ -120,7 +120,10 @@ const sv: Translation = { BYPASS_TOKEN: 'Inaktivera Token-autensiering för API-anrop', READONLY: 'Aktivera read-only (blockerar alla utgående skrivkommandon mot EMS-bussen)', UNDERCLOCK_CPU: 'Nedklocka Processorhastighet', + REMOTE_TIMEOUT: 'Remote timeout', + REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature', HEATINGOFF: 'Start boiler with forced heating off', // TODO translate + MIN_DURATION: 'Time for detection shower', ENABLE_SHOWER_TIMER: 'Aktivera Dusch-timer', ENABLE_SHOWER_ALERT: 'Aktivera Dusch-varning', TRIGGER_TIME: 'Aktiveringstid', diff --git a/interface/src/i18n/tr/index.ts b/interface/src/i18n/tr/index.ts index 15c2b1e33..f9656a1e5 100644 --- a/interface/src/i18n/tr/index.ts +++ b/interface/src/i18n/tr/index.ts @@ -120,7 +120,10 @@ const tr: Translation = { BYPASS_TOKEN: 'API bağlantılarında Erişim Jeton onaylamasını geç', READONLY: 'Salt okunur modu devreye al (bütün giden EMS Tx Yazma komutlarını engeller)', UNDERCLOCK_CPU: 'İşlemci hızını düşür', + REMOTE_TIMEOUT: 'Remote timeout', + REMOTE_TIMEOUT_EN: 'Disable remote on missing roomtemperature', HEATINGOFF: 'Start boiler with forced heating off', // TODO translate + MIN_DURATION: 'Time for detection shower', ENABLE_SHOWER_TIMER: 'Duş Sayacını Devreye Al', ENABLE_SHOWER_ALERT: 'Duş Alarmını Devreye Al', TRIGGER_TIME: 'Tetikleme Zamanı', diff --git a/interface/src/project/ApplicationSettings.tsx b/interface/src/project/ApplicationSettings.tsx index f28dfd6d9..9ed97d7f3 100644 --- a/interface/src/project/ApplicationSettings.tsx +++ b/interface/src/project/ApplicationSettings.tsx @@ -507,6 +507,45 @@ const ApplicationSettings: FC = () => { label={LL.HEATINGOFF()} disabled={saving} /> + + + + } + label={LL.REMOTE_TIMEOUT_EN()} + /> + + {data.remote_timeout_en && ( + + {LL.HOURS()} + ) + }} + fullWidth + variant="outlined" + value={numberValue(data.remote_timeout)} + type="number" + onChange={updateFormValue} + /> + + )} + { {LL.SECONDS()} diff --git a/interface/src/project/types.ts b/interface/src/project/types.ts index ed3519035..0fcf2da0f 100644 --- a/interface/src/project/types.ts +++ b/interface/src/project/types.ts @@ -8,6 +8,8 @@ export interface Settings { syslog_host: string; syslog_port: number; boiler_heatingoff: boolean; + remote_timeout_en: boolean; + remote_timeout: number; shower_timer: boolean; shower_alert: boolean; shower_alert_coldshot: number; diff --git a/interface/src/project/validators.ts b/interface/src/project/validators.ts index c721dca84..d4409d9a7 100644 --- a/interface/src/project/validators.ts +++ b/interface/src/project/validators.ts @@ -261,6 +261,16 @@ export const createSettingsValidator = (settings: Settings) => message: 'Time must be between 1 and 10 seconds' } ] + }), + ...(settings.remote_timeout_en && { + remote_timeout: [ + { + type: 'number', + min: 1, + max: 240, + message: 'Timeout must be between 1 and 240 hours' + } + ] }) }); diff --git a/src/default_settings.h b/src/default_settings.h index 490123987..cfff9bf39 100644 --- a/src/default_settings.h +++ b/src/default_settings.h @@ -65,6 +65,14 @@ #define EMSESP_DEFAULT_BOILER_HEATINGOFF false #endif +#ifndef EMSESP_DEFAULT_REMOTE_TIMEOUT +#define EMSESP_DEFAULT_REMOTE_TIMEOUT 24 +#endif + +#ifndef EMSESP_DEFAULT_REMOTE_TIMEOUT_EN +#define EMSESP_DEFAULT_REMOTE_TIMEOUT_EN false +#endif + #ifndef EMSESP_DEFAULT_SHOWER_TIMER #define EMSESP_DEFAULT_SHOWER_TIMER false #endif diff --git a/src/roomcontrol.cpp b/src/roomcontrol.cpp index ecad897e2..f789b72c0 100644 --- a/src/roomcontrol.cpp +++ b/src/roomcontrol.cpp @@ -28,10 +28,14 @@ int16_t Roomctrl::remotetemp_[HCS] = {EMS_VALUE_INT16_NOTSET, EMS_VALUE_INT16 uint8_t Roomctrl::remotehum_[HCS] = {EMS_VALUE_UINT8_NOTSET, EMS_VALUE_UINT8_NOTSET, EMS_VALUE_UINT8_NOTSET, EMS_VALUE_UINT8_NOTSET}; uint8_t Roomctrl::sendtype_[HCS] = {SendType::TEMP, SendType::TEMP, SendType::TEMP, SendType::TEMP}; uint8_t Roomctrl::type_[HCS] = {RemoteType::NONE, RemoteType::NONE, RemoteType::NONE, RemoteType::NONE}; +uint32_t Roomctrl::timeout_ = 0; /** * set the temperature, */ +void Roomctrl::set_timeout(uint8_t t) { + timeout_ = t * 3600; +} void Roomctrl::set_remotetemp(const uint8_t type, const uint8_t hc, const int16_t temp) { if (!type_[hc] && !type) { return; @@ -96,7 +100,7 @@ void Roomctrl::send(uint8_t addr) { return; } - if (!switch_off_[hc] && (uuid::get_uptime() - receive_time_[hc]) > TIMEOUT) { + if (!switch_off_[hc] && timeout_ && (uuid::get_uptime() - receive_time_[hc]) > timeout_) { remotetemp_[hc] = EMS_VALUE_INT16_NOTSET; switch_off_[hc] = true; sendtype_[hc] = SendType::TEMP; @@ -366,6 +370,7 @@ void Roomctrl::ack_write() { data[0] = TxService::TX_WRITE_SUCCESS; EMSuart::transmit(data, 1); } + void Roomctrl::replyF7(uint8_t addr, uint8_t dst, uint8_t offset, uint8_t typehh, uint8_t typeh, uint8_t typel, uint8_t hc) { uint8_t data[12]; data[0] = addr | EMSbus::ems_mask(); diff --git a/src/roomcontrol.h b/src/roomcontrol.h index d2fa4b827..5d546e9ec 100644 --- a/src/roomcontrol.h +++ b/src/roomcontrol.h @@ -34,6 +34,7 @@ class Roomctrl { static bool is_remote(const uint8_t hc) { return (hc < 4 && remotetemp_[hc] != EMS_VALUE_INT16_NOTSET); } + static void set_timeout(uint8_t t); private: static constexpr uint32_t SEND_INTERVAL = 15000; // 15 sec @@ -59,6 +60,7 @@ class Roomctrl { static uint8_t remotehum_[HCS]; static uint8_t sendtype_[HCS]; static uint8_t type_[HCS]; // type is product-id 113 for RC20 or 109 for Junkers FB10 + static uint32_t timeout_; }; } // namespace emsesp diff --git a/src/version.h b/src/version.h index 00c9d1e6c..5d68e20f5 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define EMSESP_APP_VERSION "3.7.0-dev.15" +#define EMSESP_APP_VERSION "3.7.0-dev.16" diff --git a/src/web/WebSettingsService.cpp b/src/web/WebSettingsService.cpp index ee12c5f56..e95885777 100644 --- a/src/web/WebSettingsService.cpp +++ b/src/web/WebSettingsService.cpp @@ -43,6 +43,8 @@ void WebSettings::read(WebSettings & settings, JsonObject root) { root["syslog_host"] = settings.syslog_host; root["syslog_port"] = settings.syslog_port; root["boiler_heatingoff"] = settings.boiler_heatingoff; + root["remote_timeout"] = settings.remote_timeout; + root["remote_timeout_en"] = settings.remote_timeout_enabled; root["shower_timer"] = settings.shower_timer; root["shower_alert"] = settings.shower_alert; root["shower_alert_coldshot"] = settings.shower_alert_coldshot; @@ -238,7 +240,7 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) { prev = settings.shower_alert_trigger; settings.shower_alert_trigger = root["shower_alert_trigger"] | EMSESP_DEFAULT_SHOWER_ALERT_TRIGGER; check_flag(prev, settings.shower_alert_trigger, ChangeFlags::SHOWER); - prev = settings.shower_min_duration; + prev = settings.shower_min_duration; settings.shower_min_duration = root["shower_min_duration"] | EMSESP_DEFAULT_SHOWER_MIN_DURATION; check_flag(prev, settings.shower_min_duration, ChangeFlags::SHOWER); prev = settings.shower_alert_coldshot; @@ -300,9 +302,12 @@ StateUpdateResult WebSettings::update(JsonObject root, WebSettings & settings) { settings.trace_raw = root["trace_raw"] | EMSESP_DEFAULT_TRACELOG_RAW; EMSESP::trace_raw(settings.trace_raw); - settings.notoken_api = root["notoken_api"] | EMSESP_DEFAULT_NOTOKEN_API; - settings.solar_maxflow = root["solar_maxflow"] | EMSESP_DEFAULT_SOLAR_MAXFLOW; - settings.boiler_heatingoff = root["boiler_heatingoff"] | EMSESP_DEFAULT_BOILER_HEATINGOFF; + settings.notoken_api = root["notoken_api"] | EMSESP_DEFAULT_NOTOKEN_API; + settings.solar_maxflow = root["solar_maxflow"] | EMSESP_DEFAULT_SOLAR_MAXFLOW; + settings.boiler_heatingoff = root["boiler_heatingoff"] | EMSESP_DEFAULT_BOILER_HEATINGOFF; + settings.remote_timeout = root["remote_timeout"] | EMSESP_DEFAULT_REMOTE_TIMEOUT; + settings.remote_timeout_enabled = root["remote_timeout_en"] | EMSESP_DEFAULT_REMOTE_TIMEOUT_EN; + emsesp::Roomctrl::set_timeout(settings.remote_timeout_enabled ? settings.remote_timeout : 0); settings.fahrenheit = root["fahrenheit"]; EMSESP::system_.fahrenheit(settings.fahrenheit); diff --git a/src/web/WebSettingsService.h b/src/web/WebSettingsService.h index 72e95c0ea..a8b9db4c0 100644 --- a/src/web/WebSettingsService.h +++ b/src/web/WebSettingsService.h @@ -34,11 +34,13 @@ class WebSettings { uint8_t tx_mode; uint8_t ems_bus_id; bool boiler_heatingoff; + uint8_t remote_timeout; + uint8_t remote_timeout_enabled; bool shower_timer; bool shower_alert; - uint8_t shower_alert_trigger; // minutes + uint8_t shower_alert_trigger; // minutes uint8_t shower_alert_coldshot; // seconds - uint32_t shower_min_duration; // seconds + uint32_t shower_min_duration; // seconds bool syslog_enabled; int8_t syslog_level; // uuid::log::Level uint32_t syslog_mark_interval; From 09bc8f42cc7263fe3f9ce08255113e65846d88f8 Mon Sep 17 00:00:00 2001 From: MichaelDvP Date: Thu, 20 Jun 2024 21:13:35 +0200 Subject: [PATCH 6/6] fix typo --- src/web/WebSettingsService.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/web/WebSettingsService.h b/src/web/WebSettingsService.h index a8b9db4c0..c645127ff 100644 --- a/src/web/WebSettingsService.h +++ b/src/web/WebSettingsService.h @@ -35,7 +35,7 @@ class WebSettings { uint8_t ems_bus_id; bool boiler_heatingoff; uint8_t remote_timeout; - uint8_t remote_timeout_enabled; + bool remote_timeout_enabled; bool shower_timer; bool shower_alert; uint8_t shower_alert_trigger; // minutes