Merge pull request #1719 from MichaelDvP/dev

Thermostat dhw, mqtt, ..
This commit is contained in:
Proddy
2024-04-26 12:37:53 +02:00
committed by GitHub
14 changed files with 567 additions and 678 deletions

View File

@@ -15,6 +15,7 @@
- heatpump dhw stop temperatures [#1624](https://github.com/emsesp/EMS-ESP32/issues/1624)
- reset history [#1695](https://github.com/emsesp/EMS-ESP32/issues/1695)
- heatpump entities `fan` and `shutdown` [#1690](https://github.com/emsesp/EMS-ESP32/discussions/1690)
- mqtt HA-mode 3 for v3.6 compatible HA entities, set on update v3.6->v3.7
## Fixed
@@ -28,3 +29,4 @@
- store digital out states to nvs
- Refresh UI - moving settings to one location [#1665](https://github.com/emsesp/EMS-ESP32/issues/1665)
- rename DeviceValueTypes, add UINT32 for custom entities
- dynamic register dhw circuits for thermostat

View File

@@ -32,10 +32,10 @@
"@table-library/react-table-library": "4.1.7",
"@types/lodash-es": "^4.17.12",
"@types/node": "^20.12.7",
"@types/react": "^18.2.79",
"@types/react-dom": "^18.2.25",
"@types/react": "^18.3.0",
"@types/react-dom": "^18.3.0",
"@types/react-router-dom": "^5.3.3",
"alova": "2.19.2",
"alova": "^2.20.2",
"async-validator": "^4.2.5",
"history": "^5.3.0",
"jwt-decode": "^4.0.0",
@@ -45,7 +45,7 @@
"react-dom": "latest",
"react-dropzone": "^14.2.3",
"react-icons": "^5.1.0",
"react-router-dom": "^6.22.3",
"react-router-dom": "^6.23.0",
"react-toastify": "^10.0.5",
"typesafe-i18n": "^5.26.2",
"typescript": "^5.4.5"
@@ -56,13 +56,13 @@
"@preact/preset-vite": "^2.8.2",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"concurrently": "^8.2.2",
"eslint": "^9.1.0",
"eslint": "^9.1.1",
"eslint-config-prettier": "^9.1.0",
"preact": "^10.20.2",
"prettier": "^3.2.5",
"rollup-plugin-visualizer": "^5.12.0",
"terser": "^5.30.3",
"typescript-eslint": "^7.7.0",
"terser": "^5.30.4",
"typescript-eslint": "^7.7.1",
"vite": "^5.2.10",
"vite-plugin-imagemin": "^0.6.1",
"vite-tsconfig-paths": "^4.3.2"

View File

@@ -52,7 +52,6 @@ export const uploadFile = (file: File) => {
const formData = new FormData();
formData.append('file', file);
return alovaInstance.Post('/rest/uploadFile', formData, {
timeout: 60000, // override timeout for uploading firmware - 1 minute
enableUpload: true // can be removed with Alova 2.20+
timeout: 60000 // override timeout for uploading firmware - 1 minute
});
};

View File

@@ -374,6 +374,12 @@ const MqttSettings: FC = () => {
select
>
<MenuItem value={0}>{LL.MQTT_ENTITY_FORMAT_0()}</MenuItem>
<MenuItem value={3}>
{LL.MQTT_ENTITY_FORMAT_1()}&nbsp;(v3.6)
</MenuItem>
<MenuItem value={4}>
{LL.MQTT_ENTITY_FORMAT_2()}&nbsp;(v3.6)
</MenuItem>
<MenuItem value={1}>{LL.MQTT_ENTITY_FORMAT_1()}</MenuItem>
<MenuItem value={2}>{LL.MQTT_ENTITY_FORMAT_2()}</MenuItem>
</TextField>

View File

@@ -1231,10 +1231,10 @@ __metadata:
languageName: node
linkType: hard
"@remix-run/router@npm:1.15.3":
version: 1.15.3
resolution: "@remix-run/router@npm:1.15.3"
checksum: 10/43d402b4ad3dff6dee5c1bc0822aeeb4d885d11c74c45fca7f2f4d7e57853fddbbb813c372919bb3fcc63f95fbcffdd1d4ac1c406857ea07b9d09a09d0562c8e
"@remix-run/router@npm:1.16.0":
version: 1.16.0
resolution: "@remix-run/router@npm:1.16.0"
checksum: 10/51f5805ec172d8ec038f8eebb5af51cac11e8dc419116c23c3765eaf1d4381390da4ab1cd04874e9126c1ec8ec7283c97efdcaf338095130439111d5218aeed0
languageName: node
linkType: hard
@@ -1556,12 +1556,12 @@ __metadata:
languageName: node
linkType: hard
"@types/react-dom@npm:^18.2.25":
version: 18.2.25
resolution: "@types/react-dom@npm:18.2.25"
"@types/react-dom@npm:^18.3.0":
version: 18.3.0
resolution: "@types/react-dom@npm:18.3.0"
dependencies:
"@types/react": "npm:*"
checksum: 10/0e45856a2fdbf09e74632b132b3af773c6b18fc2ab0bd04595c9f2bcc0bb04d5e732ac8156d145b712dedab7484a8fe9dce5cf720a5437b5d26099c7060c7ba4
checksum: 10/6ff53f5a7b7fba952a68e114d3b542ebdc1e87a794234785ebab0bcd9bde7fb4885f21ebaf93d26dc0a1b5b93287f42cad68b78ae04dddf6b20da7aceff0beaf
languageName: node
linkType: hard
@@ -1606,13 +1606,13 @@ __metadata:
languageName: node
linkType: hard
"@types/react@npm:^18.2.79":
version: 18.2.79
resolution: "@types/react@npm:18.2.79"
"@types/react@npm:^18.3.0":
version: 18.3.0
resolution: "@types/react@npm:18.3.0"
dependencies:
"@types/prop-types": "npm:*"
csstype: "npm:^3.0.2"
checksum: 10/2ef833e7d0a5c226beddbbe090811582371f6ae5e2f092a3d9f47cc6087c8bce0b96ee33e351de6d1d470f0a0ec5892d971933f841ef31538c1821681fc6569e
checksum: 10/2444294740016d61721df9adeb8635658c660c13b0782df9f067260ac6b0a4b71e68245089814ab53264843eb75f81d90f770253b94a13955cc1ddccf3593301
languageName: node
linkType: hard
@@ -1648,15 +1648,15 @@ __metadata:
languageName: node
linkType: hard
"@typescript-eslint/eslint-plugin@npm:7.7.0":
version: 7.7.0
resolution: "@typescript-eslint/eslint-plugin@npm:7.7.0"
"@typescript-eslint/eslint-plugin@npm:7.7.1":
version: 7.7.1
resolution: "@typescript-eslint/eslint-plugin@npm:7.7.1"
dependencies:
"@eslint-community/regexpp": "npm:^4.10.0"
"@typescript-eslint/scope-manager": "npm:7.7.0"
"@typescript-eslint/type-utils": "npm:7.7.0"
"@typescript-eslint/utils": "npm:7.7.0"
"@typescript-eslint/visitor-keys": "npm:7.7.0"
"@typescript-eslint/scope-manager": "npm:7.7.1"
"@typescript-eslint/type-utils": "npm:7.7.1"
"@typescript-eslint/utils": "npm:7.7.1"
"@typescript-eslint/visitor-keys": "npm:7.7.1"
debug: "npm:^4.3.4"
graphemer: "npm:^1.4.0"
ignore: "npm:^5.3.1"
@@ -1669,44 +1669,44 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
checksum: 10/9e6b6fbb9920581813c01daaa2f89419c3476e42823755c0627f4491640cfaffaebeb0592231ed4f318eefadfcdd4560b77b2903d66ab4e0c8df746a7037a603
checksum: 10/54064fe466edcebece50cf4cfc4cb18753bcba7da0e3f0db29bf628586716b14945cadf01529ebc3d823e35bc62debf21aa636ae1f5e4fa92670dce65b3dec8c
languageName: node
linkType: hard
"@typescript-eslint/parser@npm:7.7.0":
version: 7.7.0
resolution: "@typescript-eslint/parser@npm:7.7.0"
"@typescript-eslint/parser@npm:7.7.1":
version: 7.7.1
resolution: "@typescript-eslint/parser@npm:7.7.1"
dependencies:
"@typescript-eslint/scope-manager": "npm:7.7.0"
"@typescript-eslint/types": "npm:7.7.0"
"@typescript-eslint/typescript-estree": "npm:7.7.0"
"@typescript-eslint/visitor-keys": "npm:7.7.0"
"@typescript-eslint/scope-manager": "npm:7.7.1"
"@typescript-eslint/types": "npm:7.7.1"
"@typescript-eslint/typescript-estree": "npm:7.7.1"
"@typescript-eslint/visitor-keys": "npm:7.7.1"
debug: "npm:^4.3.4"
peerDependencies:
eslint: ^8.56.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 10/9f8c53ca29af09cd366e37420410319c8f69e9f4a676513ecd91f5e6d822b9935b6a8ad7ec931d604fc4a0ecd93d51063d0c93227f78f2380196c8a7fa6970d1
checksum: 10/39cd5c686e9f7e86da669fc3622b203e1025f162d42c4f45373e827c659b8823535fe4ea62ccb5e672ef999f8491d74c8c5c4c497367c884672fc835497ea180
languageName: node
linkType: hard
"@typescript-eslint/scope-manager@npm:7.7.0":
version: 7.7.0
resolution: "@typescript-eslint/scope-manager@npm:7.7.0"
"@typescript-eslint/scope-manager@npm:7.7.1":
version: 7.7.1
resolution: "@typescript-eslint/scope-manager@npm:7.7.1"
dependencies:
"@typescript-eslint/types": "npm:7.7.0"
"@typescript-eslint/visitor-keys": "npm:7.7.0"
checksum: 10/c8890aaf99b57543774e50549c5b178c13695b21a6b30c65292268137fe5e6856cc0e050c118b47b5835dd8a48c96e042fc75891a7f6093a0b94b6b3b251afd9
"@typescript-eslint/types": "npm:7.7.1"
"@typescript-eslint/visitor-keys": "npm:7.7.1"
checksum: 10/7823cd15e7205d2c0d9e69432717c385b2ecd7559d5edba79113c2e97c6c5e8ca3dae9343a734bc740be97e096bfcb9dfb81a3da697f9fbf5600a56a42cf70e9
languageName: node
linkType: hard
"@typescript-eslint/type-utils@npm:7.7.0":
version: 7.7.0
resolution: "@typescript-eslint/type-utils@npm:7.7.0"
"@typescript-eslint/type-utils@npm:7.7.1":
version: 7.7.1
resolution: "@typescript-eslint/type-utils@npm:7.7.1"
dependencies:
"@typescript-eslint/typescript-estree": "npm:7.7.0"
"@typescript-eslint/utils": "npm:7.7.0"
"@typescript-eslint/typescript-estree": "npm:7.7.1"
"@typescript-eslint/utils": "npm:7.7.1"
debug: "npm:^4.3.4"
ts-api-utils: "npm:^1.3.0"
peerDependencies:
@@ -1714,23 +1714,23 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
checksum: 10/a3f5358b4b7046458ea573607f3d6ea7f48e16524390b24c9360bdf8b03cc89fc6eb5da31b3e541e7f1e5f6958194ecaad5b644ca9b0d90c9a7b182f345451aa
checksum: 10/c64dfd3e535741270012d289d1327e487df877adfa8a9920b1f8d6616f3b7159ef8ee1d6b62e866b6a5c64d675c5008e87f4ea20b5fc032e95f197a749d38ae6
languageName: node
linkType: hard
"@typescript-eslint/types@npm:7.7.0":
version: 7.7.0
resolution: "@typescript-eslint/types@npm:7.7.0"
checksum: 10/d54ff9eeea168188fcbf1c8efe42892d1646ead801ea0a0f1312c80cfb74ee5dd61a145bc982919fb396683fb4578f98f7ad90e5d466d7aa1ca593e4338e1a2e
"@typescript-eslint/types@npm:7.7.1":
version: 7.7.1
resolution: "@typescript-eslint/types@npm:7.7.1"
checksum: 10/a1ecbaf3b8a5243394d421644f2b3eb164feea645e36dd07f1afb5008598201f19c7988141fc162c647f380dda7cf571017c0eabbbc4c5432b0143383853e134
languageName: node
linkType: hard
"@typescript-eslint/typescript-estree@npm:7.7.0":
version: 7.7.0
resolution: "@typescript-eslint/typescript-estree@npm:7.7.0"
"@typescript-eslint/typescript-estree@npm:7.7.1":
version: 7.7.1
resolution: "@typescript-eslint/typescript-estree@npm:7.7.1"
dependencies:
"@typescript-eslint/types": "npm:7.7.0"
"@typescript-eslint/visitor-keys": "npm:7.7.0"
"@typescript-eslint/types": "npm:7.7.1"
"@typescript-eslint/visitor-keys": "npm:7.7.1"
debug: "npm:^4.3.4"
globby: "npm:^11.1.0"
is-glob: "npm:^4.0.3"
@@ -1740,34 +1740,34 @@ __metadata:
peerDependenciesMeta:
typescript:
optional: true
checksum: 10/40af26b3edb07af439f99728aa149bbc8668dae4a700a128abaf98d7f9bc0d5d31f8027aa1d13d6a55b22c20738d7cab84a3046a56417a2551de58671b39dbdf
checksum: 10/df5fe6c573b15e8058b88d1535eeca11115118adc54225f511d2762d74e2d453205ba27e63f6666cb5f3dc73d639208a183fb05db1f75063b115d52b1fae3e20
languageName: node
linkType: hard
"@typescript-eslint/utils@npm:7.7.0":
version: 7.7.0
resolution: "@typescript-eslint/utils@npm:7.7.0"
"@typescript-eslint/utils@npm:7.7.1":
version: 7.7.1
resolution: "@typescript-eslint/utils@npm:7.7.1"
dependencies:
"@eslint-community/eslint-utils": "npm:^4.4.0"
"@types/json-schema": "npm:^7.0.15"
"@types/semver": "npm:^7.5.8"
"@typescript-eslint/scope-manager": "npm:7.7.0"
"@typescript-eslint/types": "npm:7.7.0"
"@typescript-eslint/typescript-estree": "npm:7.7.0"
"@typescript-eslint/scope-manager": "npm:7.7.1"
"@typescript-eslint/types": "npm:7.7.1"
"@typescript-eslint/typescript-estree": "npm:7.7.1"
semver: "npm:^7.6.0"
peerDependencies:
eslint: ^8.56.0
checksum: 10/4223233ee022460a74f389302b50779537dfbb3bd414486dca356d2628a08d5b2c4c6002bae3bdffad92b368569024faf25faee9be739340d9459c23549a866f
checksum: 10/5a352c3a849300b5d676bf5f451418a2fb0cd3ab515f3733521ad03cf047849c52c76f6e5d2406e08f6d0dbad3a4708b490f909c91a1a9e3d73060a750b3bca2
languageName: node
linkType: hard
"@typescript-eslint/visitor-keys@npm:7.7.0":
version: 7.7.0
resolution: "@typescript-eslint/visitor-keys@npm:7.7.0"
"@typescript-eslint/visitor-keys@npm:7.7.1":
version: 7.7.1
resolution: "@typescript-eslint/visitor-keys@npm:7.7.1"
dependencies:
"@typescript-eslint/types": "npm:7.7.0"
"@typescript-eslint/types": "npm:7.7.1"
eslint-visitor-keys: "npm:^3.4.3"
checksum: 10/9f03591ab60b0b164f6bb222b5d5ae75f73fbe7f264be9318f770be9dc5dff8138d34701928940ffc18924058ae80754a738a1e623912a297d57a8a59cdfb41d
checksum: 10/dcc5748b10bb1b169516b33e87b6d86b562e25725a95e5ac515cb197589d9667aaa7cfffa93234095a73c80addb6dd88e2a9ab01d2be0c274254b5be1ca4057a
languageName: node
linkType: hard
@@ -1789,13 +1789,13 @@ __metadata:
"@trivago/prettier-plugin-sort-imports": "npm:^4.3.0"
"@types/lodash-es": "npm:^4.17.12"
"@types/node": "npm:^20.12.7"
"@types/react": "npm:^18.2.79"
"@types/react-dom": "npm:^18.2.25"
"@types/react": "npm:^18.3.0"
"@types/react-dom": "npm:^18.3.0"
"@types/react-router-dom": "npm:^5.3.3"
alova: "npm:2.19.2"
alova: "npm:^2.20.2"
async-validator: "npm:^4.2.5"
concurrently: "npm:^8.2.2"
eslint: "npm:^9.1.0"
eslint: "npm:^9.1.1"
eslint-config-prettier: "npm:^9.1.0"
history: "npm:^5.3.0"
jwt-decode: "npm:^4.0.0"
@@ -1807,13 +1807,13 @@ __metadata:
react-dom: "npm:latest"
react-dropzone: "npm:^14.2.3"
react-icons: "npm:^5.1.0"
react-router-dom: "npm:^6.22.3"
react-router-dom: "npm:^6.23.0"
react-toastify: "npm:^10.0.5"
rollup-plugin-visualizer: "npm:^5.12.0"
terser: "npm:^5.30.3"
terser: "npm:^5.30.4"
typesafe-i18n: "npm:^5.26.2"
typescript: "npm:^5.4.5"
typescript-eslint: "npm:^7.7.0"
typescript-eslint: "npm:^7.7.1"
vite: "npm:^5.2.10"
vite-plugin-imagemin: "npm:^0.6.1"
vite-tsconfig-paths: "npm:^4.3.2"
@@ -1876,10 +1876,10 @@ __metadata:
languageName: node
linkType: hard
"alova@npm:2.19.2":
version: 2.19.2
resolution: "alova@npm:2.19.2"
checksum: 10/8790c82dd5c1345397d4074c9730eb2ccf3363cffa64009943531fc36091170287de7271531262d5d096c88bcaebe0ebdc7efca5f52cc60aa438abc0818d6cee
"alova@npm:^2.20.2":
version: 2.20.2
resolution: "alova@npm:2.20.2"
checksum: 10/355350451828e9ce473ba1eafeb7a93dc3177cb768cb7734ecb7f42aeda1440ba19aecb22b6d896f4f314235e1c18c55267251fbb9f2c47f79ace5f11d947644
languageName: node
linkType: hard
@@ -3282,9 +3282,9 @@ __metadata:
languageName: node
linkType: hard
"eslint@npm:^9.1.0":
version: 9.1.0
resolution: "eslint@npm:9.1.0"
"eslint@npm:^9.1.1":
version: 9.1.1
resolution: "eslint@npm:9.1.1"
dependencies:
"@eslint-community/eslint-utils": "npm:^4.2.0"
"@eslint-community/regexpp": "npm:^4.6.1"
@@ -3322,7 +3322,7 @@ __metadata:
text-table: "npm:^0.2.0"
bin:
eslint: bin/eslint.js
checksum: 10/8a8902a9aed9113f13638b78794cbe2a711b44300cc0ec05b00e017d52d94b209cf1af81caaaad8cfb4087870f850d7da8e3a892d186c657fb5a21cb1b802379
checksum: 10/d0bf8c6335b26a489935df10b74505c0b43ba16a333d938c820ffd097faec05cc0aa27006f5e4091d2c3d10367da3aab01a37bace59d61932976bd7af6dcb99c
languageName: node
linkType: hard
@@ -5904,27 +5904,27 @@ __metadata:
languageName: node
linkType: hard
"react-router-dom@npm:^6.22.3":
version: 6.22.3
resolution: "react-router-dom@npm:6.22.3"
"react-router-dom@npm:^6.23.0":
version: 6.23.0
resolution: "react-router-dom@npm:6.23.0"
dependencies:
"@remix-run/router": "npm:1.15.3"
react-router: "npm:6.22.3"
"@remix-run/router": "npm:1.16.0"
react-router: "npm:6.23.0"
peerDependencies:
react: ">=16.8"
react-dom: ">=16.8"
checksum: 10/868a530c3167e1903f170818c0162760b8fbe9b10a7a7a79e5998990df341cd7127ba7819af4a9105af72c13453c7c4d76b2b07a70b56fff012fa0508b51940e
checksum: 10/8825c9b5d5731cb8ecf39e927949cb24474d0f3aff4ffc75b2c236c5678c4970eada98160c6fef3a99c0bdb59ce25d8951da9fdc4ac103135e450f200426c778
languageName: node
linkType: hard
"react-router@npm:6.22.3":
version: 6.22.3
resolution: "react-router@npm:6.22.3"
"react-router@npm:6.23.0":
version: 6.23.0
resolution: "react-router@npm:6.23.0"
dependencies:
"@remix-run/router": "npm:1.15.3"
"@remix-run/router": "npm:1.16.0"
peerDependencies:
react: ">=16.8"
checksum: 10/df3948afd6500faf4b82a72375b9177536d878d54cad18e20a175efcbfdd0d94852aac59660d786946636ed325284d94a8f46652d898df304d6a29c9a3932afd
checksum: 10/1b5228bec63147b3cf5c645ed7eac5eeca5561c70f348b61ed3af9acf86b1a181ec4af28320419eadad626c6e725defd7eb8d7418cc6080384fc7956e0325947
languageName: node
linkType: hard
@@ -6785,9 +6785,9 @@ __metadata:
languageName: node
linkType: hard
"terser@npm:^5.30.3":
version: 5.30.3
resolution: "terser@npm:5.30.3"
"terser@npm:^5.30.4":
version: 5.30.4
resolution: "terser@npm:5.30.4"
dependencies:
"@jridgewell/source-map": "npm:^0.3.3"
acorn: "npm:^8.8.2"
@@ -6795,7 +6795,7 @@ __metadata:
source-map-support: "npm:~0.5.20"
bin:
terser: bin/terser
checksum: 10/f4ee378065a327c85472f351ac232fa47ec84d4f15df7ec58c044b41e3c063cf11aaedd90dcfe9c7f2a6ef01d4aab23deb61622301170dc77d0a8b6a6a83cf5e
checksum: 10/79459106281fccb2ff4243ba1553e4aa67a71b336bb8c091b131bb26347fcf03791c6abf6870bd17fe4a210256e08910207cf5733c0d6ba840289e67d5aa84d3
languageName: node
linkType: hard
@@ -6934,19 +6934,19 @@ __metadata:
languageName: node
linkType: hard
"typescript-eslint@npm:^7.7.0":
version: 7.7.0
resolution: "typescript-eslint@npm:7.7.0"
"typescript-eslint@npm:^7.7.1":
version: 7.7.1
resolution: "typescript-eslint@npm:7.7.1"
dependencies:
"@typescript-eslint/eslint-plugin": "npm:7.7.0"
"@typescript-eslint/parser": "npm:7.7.0"
"@typescript-eslint/utils": "npm:7.7.0"
"@typescript-eslint/eslint-plugin": "npm:7.7.1"
"@typescript-eslint/parser": "npm:7.7.1"
"@typescript-eslint/utils": "npm:7.7.1"
peerDependencies:
eslint: ^8.56.0
peerDependenciesMeta:
typescript:
optional: true
checksum: 10/1ffb650b25f52bb5b541a0669d0cd569175ae5c02aec39687b8401c373ab5fbf4bce2d1b110c665e3b19d1afc4857f58db52e161aa0208468b5da5339283d89d
checksum: 10/fd77c7b31b66438164edc2ad3eb79a14f8621162994af04e7e9a8b93a863bfcb25476bb339b8891044b56f7c42355b74ecc4b47e3fb4a848821d14ee38c4af26
languageName: node
linkType: hard

View File

@@ -1755,19 +1755,15 @@ void Boiler::process_UBAErrorMessage(std::shared_ptr<const Telegram> telegram) {
}
// data: displaycode(2), errornumber(2), year, month, hour, day, minute, duration(2), src-addr
static uint32_t lastCodeDate_ = 0; // last code date
char code[3] = {0};
uint16_t codeNo = EMS_VALUE_INT16_NOTSET;
code[0] = telegram->message_data[0];
code[1] = telegram->message_data[1];
code[2] = 0;
telegram->read_value(codeNo, 2);
uint16_t year = (telegram->message_data[4] & 0x7F) + 2000;
uint8_t month = telegram->message_data[5];
uint8_t day = telegram->message_data[7];
uint8_t hour = telegram->message_data[6];
uint8_t min = telegram->message_data[8];
uint16_t duration = telegram->message_data[9];
uint32_t date = (year - 2000) * 535680UL + month * 44640UL + day * 1440UL + hour * 60 + min + duration;
char code[3] = {telegram->message_data[0], telegram->message_data[1], 0};
uint16_t codeNo = telegram->message_data[2] * 256 + telegram->message_data[3];
uint16_t year = (telegram->message_data[4] & 0x7F) + 2000;
uint8_t month = telegram->message_data[5];
uint8_t day = telegram->message_data[7];
uint8_t hour = telegram->message_data[6];
uint8_t min = telegram->message_data[8];
uint16_t duration = telegram->message_data[9] * 256 + telegram->message_data[10];
uint32_t date = (year - 2000) * 535680UL + month * 44640UL + day * 1440UL + hour * 60 + min + duration;
// store only the newest code from telegrams 10 and 11
if (date > lastCodeDate_ && lastCodeDate_) {
lastCodeDate_ = date;

File diff suppressed because it is too large Load Diff

View File

@@ -165,6 +165,48 @@ class Thermostat : public EMSdevice {
uint8_t model_; // the model type
};
class DhwCircuit {
public:
DhwCircuit(const uint8_t offset, const uint8_t dhw_num)
: offset_(offset)
, dhw_num_(dhw_num) {
}
~DhwCircuit() = default;
uint8_t wwExtra_;
uint8_t wwMode_;
uint8_t wwCircPump_;
uint8_t wwCircMode_;
uint8_t wwSetTemp_;
uint8_t wwSetTempLow_;
uint8_t wwCharge_;
uint8_t wwChargeDuration_;
uint8_t wwDisinfecting_;
uint8_t wwDisinfectDay_;
uint8_t wwDisinfectHour_;
uint8_t wwMaxTemp_;
uint8_t wwOneTimeKey_;
uint8_t wwProgMode_;
uint8_t wwCircProg_;
char wwSwitchTime_[20];
char wwCircSwitchTime_[20];
uint8_t wwDailyHeating_;
uint8_t wwDailyHeatTime_;
uint8_t wwWhenModeOff_;
char wwHoliday_[26];
char wwVacation_[26];
uint8_t dhw() const {
return dhw_num_ - 1;
}
uint8_t offset() const {
return offset_;
}
private:
uint8_t offset_; // telegram offset to base telegram
uint8_t dhw_num_; // dhw circuit number 1..10
};
private:
static uuid::log::Logger logger_;
@@ -190,7 +232,7 @@ class Thermostat : public EMSdevice {
// standard for all thermostats
char status_[20]; // online or offline
char dateTime_[25]; // date and time stamp
char dateTime_[30]; // date and time stamp
char errorCode_[15]; // code from 0xA2 as string i.e. "A22(816)"
uint16_t errorNumber_; // used internally to build error code
char lastCode_[50]; // error log
@@ -220,41 +262,6 @@ class Thermostat : public EMSdevice {
uint8_t humidity_;
uint8_t battery_;
uint8_t wwCircuit2_ = EMS_VALUE_UINT8_NOTSET; // not published, initialize here
uint8_t wwExtra1_; // wwExtra active for wwSystem 1
uint8_t wwExtra2_;
uint8_t wwMode_;
uint8_t wwMode2_;
uint8_t wwCircPump_;
uint8_t wwCircPump2_;
uint8_t wwCircMode_;
uint8_t wwCircMode2_;
uint8_t wwSetTemp_;
uint8_t wwSetTempLow_;
uint8_t wwCharge_;
uint8_t wwCharge2_;
uint8_t wwChargeDuration_;
uint8_t wwChargeDuration2_;
uint8_t wwDisinfecting_;
uint8_t wwDisinfecting2_;
uint8_t wwDisinfectDay_;
uint8_t wwDisinfectHour_;
uint8_t wwDisinfectDay2_;
uint8_t wwDisinfectHour2_;
uint8_t wwMaxTemp_;
uint8_t wwOneTimeKey_;
uint8_t wwProgMode_;
uint8_t wwCircProg_;
char wwSwitchTime_[16];
char wwCircSwitchTime_[16];
uint8_t wwDailyHeating_;
uint8_t wwDailyHeatTime_;
uint8_t wwDailyHeating2_;
uint8_t wwDailyHeatTime2_;
uint8_t wwWhenModeOff_;
char wwHoliday_[26];
char wwVacation_[26];
// HybridHP
uint8_t hybridStrategy_; // co2 = 1, cost = 2, temperature = 3, mix = 4
int8_t switchOverTemp_; // degrees
@@ -270,6 +277,7 @@ class Thermostat : public EMSdevice {
uint8_t pvLowerCool_;
std::vector<std::shared_ptr<HeatingCircuit>> heating_circuits_; // each thermostat can have multiple heating circuits
std::vector<std::shared_ptr<DhwCircuit>> dhw_circuits_; // each thermostat can have multiple dhw circuits
// Generic Types
static constexpr uint16_t EMS_TYPE_RCTime = 0x06; // time
@@ -285,7 +293,7 @@ class Thermostat : public EMSdevice {
static constexpr uint8_t EMS_OFFSET_RC20Set_mode = 23; // position of thermostat mode
static constexpr uint8_t EMS_OFFSET_RC20Set_temp_off = 24; // position of thermostat setpoint mode:off
static constexpr uint8_t EMS_OFFSET_RC20Set_temp_auto = 28; // position of thermostat setpoint temperature
static constexpr uint8_t EMS_OFFSET_RC20Set_temp_manual = 29; // position of thermostat setpoint temperature
static constexpr uint8_t EMS_OFFSET_RC20Set_temp_manual = 29; // position of thermostat setpoint manual
static constexpr uint8_t EMS_OFFSET_RC20_2_Set_mode = 3; // ES72 - see https://github.com/emsesp/EMS-ESP/issues/334
static constexpr uint8_t EMS_OFFSET_RC20_2_Set_temp_night = 1; // ES72
@@ -357,7 +365,7 @@ class Thermostat : public EMSdevice {
static constexpr uint8_t EMS_OFFSET_JunkersSetMessage2_eco_temp = 6;
static constexpr uint8_t EMS_OFFSET_JunkersSetMessage2_heat_temp = 7;
static constexpr uint8_t AUTO_HEATING_CIRCUIT = 0;
static constexpr int8_t AUTO_HEATING_CIRCUIT = -1; // id
// Installation settings
static constexpr uint8_t EMS_TYPE_IBASettings = 0xA5; // installation settings
@@ -367,9 +375,11 @@ class Thermostat : public EMSdevice {
static constexpr uint8_t EMS_TYPE_time = 0x06; // time
std::shared_ptr<Thermostat::HeatingCircuit> heating_circuit(std::shared_ptr<const Telegram> telegram);
std::shared_ptr<Thermostat::HeatingCircuit> heating_circuit(const uint8_t hc_num);
std::shared_ptr<Thermostat::HeatingCircuit> heating_circuit(const int8_t id);
std::shared_ptr<Thermostat::DhwCircuit> dhw_circuit(const uint8_t offset = 0, const uint8_t dhw_num = 255, const bool create = false);
void register_device_values_hc(std::shared_ptr<Thermostat::HeatingCircuit> hc);
void register_device_values_dhw(std::shared_ptr<Thermostat::DhwCircuit> dhw);
void add_ha_climate(std::shared_ptr<HeatingCircuit> hc) const;
@@ -404,7 +414,6 @@ class Thermostat : public EMSdevice {
void process_RC300Summer(std::shared_ptr<const Telegram> telegram);
void process_RC300Summer2(std::shared_ptr<const Telegram> telegram);
void process_RC300WWmode(std::shared_ptr<const Telegram> telegram);
void process_RC300WW2mode(std::shared_ptr<const Telegram> telegram);
void process_RC300WWmode2(std::shared_ptr<const Telegram> telegram);
void process_RC300WWtemp(std::shared_ptr<const Telegram> telegram);
void process_RC300OutdoorTemp(std::shared_ptr<const Telegram> telegram);
@@ -428,10 +437,10 @@ class Thermostat : public EMSdevice {
void process_HPMode(std::shared_ptr<const Telegram> telegram);
// internal helper functions
bool set_mode_n(const uint8_t mode, const uint8_t hc_num);
bool set_mode_n(const uint8_t mode, const int8_t id);
bool set_temperature_value(const char * value, const int8_t id, const uint8_t mode, bool relative = false);
bool set_temperature(const float temperature, const uint8_t mode, const uint8_t hc_num);
bool set_temperature(const float temperature, const uint8_t mode, const int8_t id);
bool set_switchtime(const char * value, const uint16_t type_id, char * out, size_t len);
// set functions - these use the id/hc

View File

@@ -847,6 +847,43 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
} else if (Mqtt::entity_format() == entityFormat::SINGLE_SHORT) {
// shortname, no mqtt base. This is the default version.
snprintf(uniq_id, sizeof(uniq_id), "%s_%s", device_name, entity_with_tag);
} else if (Mqtt::entity_format() == entityFormat::SINGLE_OLD) {
// shortname, remap to 3.6.
if (has_tag && (device_type == EMSdevice::DeviceType::BOILER || device_type == EMSdevice::DeviceType::THERMOSTAT)
&& tag == DeviceValue::DeviceValueTAG::TAG_DHW1) {
snprintf(entity_with_tag, sizeof(entity_with_tag), "ww%s", entity);
snprintf(uniq_id, sizeof(uniq_id), "%s_%s", device_name, entity_with_tag);
if (strcmp(entity, "nrgdhw") == 0) { // special case for tp1de #1714
strcpy(uniq_id, "boiler_nrgww");
strcpy(entity_with_tag, "nrgww");
}
} else if (has_tag && device_type == EMSdevice::DeviceType::WATER && tag >= DeviceValue::DeviceValueTAG::TAG_DHW3) {
snprintf(entity_with_tag, sizeof(entity_with_tag), "wwc%d_%s", tag - DeviceValue::DeviceValueTAG::TAG_DHW1 + 1, entity);
snprintf(uniq_id, sizeof(uniq_id), "solar_%s", entity_with_tag);
} else if (has_tag && device_type == EMSdevice::DeviceType::WATER && tag >= DeviceValue::DeviceValueTAG::TAG_DHW1) {
snprintf(entity_with_tag, sizeof(entity_with_tag), "wwc%d_%s", tag - DeviceValue::DeviceValueTAG::TAG_DHW1 + 1, entity);
snprintf(uniq_id, sizeof(uniq_id), "mixer_%s", entity_with_tag);
} else {
snprintf(uniq_id, sizeof(uniq_id), "%s_%s", device_name, entity_with_tag);
}
} else if (Mqtt::entity_format() == entityFormat::MULTI_OLD) {
// shortname, remap to 3.6.
if (has_tag && (device_type == EMSdevice::DeviceType::BOILER || device_type == EMSdevice::DeviceType::THERMOSTAT)
&& tag == DeviceValue::DeviceValueTAG::TAG_DHW1) {
snprintf(entity_with_tag, sizeof(entity_with_tag), "ww%s", entity);
snprintf(uniq_id, sizeof(uniq_id), "%s_%s_%s", mqtt_basename_.c_str(), device_name, entity_with_tag);
if (strcmp(entity, "nrgdhw") == 0) { // special case for tp1de #1714
snprintf(uniq_id, sizeof(uniq_id), "%s_boiler_nrgww", mqtt_basename_.c_str());
}
} else if (has_tag && device_type == EMSdevice::DeviceType::WATER && tag >= DeviceValue::DeviceValueTAG::TAG_DHW3) {
snprintf(entity_with_tag, sizeof(entity_with_tag), "wwc%d_%s", tag - DeviceValue::DeviceValueTAG::TAG_DHW1 + 1, entity);
snprintf(uniq_id, sizeof(uniq_id), "%s_solar_%s", mqtt_basename_.c_str(), entity_with_tag);
} else if (has_tag && device_type == EMSdevice::DeviceType::WATER && tag >= DeviceValue::DeviceValueTAG::TAG_DHW1) {
snprintf(entity_with_tag, sizeof(entity_with_tag), "wwc%d_%s", tag - DeviceValue::DeviceValueTAG::TAG_DHW1 + 1, entity);
snprintf(uniq_id, sizeof(uniq_id), "%s_mixer_%s", mqtt_basename_.c_str(), entity_with_tag);
} else {
snprintf(uniq_id, sizeof(uniq_id), "%s_%s_%s", mqtt_basename_.c_str(), device_name, entity_with_tag);
}
} else {
// entity_format is 0, the old v3.4 style
// take en_name and replace all spaces
@@ -854,7 +891,17 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
strlcpy(uniq_s, en_name, sizeof(uniq_s));
Helpers::replace_char(uniq_s, ' ', '_');
Helpers::replace_char(uniq_s, '+', '2'); //changes 'eco+_switch_off' to 'eco2_switch_off' (HA ignores '+')
if (has_tag) {
if (has_tag && (device_type == EMSdevice::DeviceType::BOILER || device_type == EMSdevice::DeviceType::THERMOSTAT)
&& tag == DeviceValue::DeviceValueTAG::TAG_DHW1) {
snprintf(entity_with_tag, sizeof(entity_with_tag), "ww%s", entity);
snprintf(uniq_id, sizeof(uniq_id), "%s_%s", device_name, Helpers::toLower(uniq_s).c_str());
} else if (has_tag && device_type == EMSdevice::DeviceType::WATER && tag >= DeviceValue::DeviceValueTAG::TAG_DHW3) {
snprintf(entity_with_tag, sizeof(entity_with_tag), "wwc%d_%s", tag - DeviceValue::DeviceValueTAG::TAG_DHW1 + 1, entity);
snprintf(uniq_id, sizeof(uniq_id), "solar_wwc%d_%s", tag - DeviceValue::DeviceValueTAG::TAG_DHW1 + 1, Helpers::toLower(uniq_s).c_str());
} else if (has_tag && device_type == EMSdevice::DeviceType::WATER && tag >= DeviceValue::DeviceValueTAG::TAG_DHW1) {
snprintf(entity_with_tag, sizeof(entity_with_tag), "wwc%d_%s", tag - DeviceValue::DeviceValueTAG::TAG_DHW1 + 1, entity);
snprintf(uniq_id, sizeof(uniq_id), "mixer_wwc%d_%s", tag - DeviceValue::DeviceValueTAG::TAG_DHW1 + 1, Helpers::toLower(uniq_s).c_str());
} else if (has_tag) {
snprintf(uniq_id, sizeof(uniq_id), "%s_%s_%s", device_name, DeviceValue::DeviceValueTAG_s[tag][0], Helpers::toLower(uniq_s).c_str());
} else {
snprintf(uniq_id, sizeof(uniq_id), "%s_%s", device_name, Helpers::toLower(uniq_s).c_str());
@@ -1022,10 +1069,10 @@ bool Mqtt::publish_ha_sensor_config(uint8_t type, // EMSdev
char val_obj[100];
char val_cond[200];
if (is_nested() && tag >= DeviceValueTAG::TAG_HC1) {
snprintf(val_obj, sizeof(val_obj), "value_json.%s.%s", EMSdevice::tag_to_mqtt(tag), entity);
snprintf(val_obj, sizeof(val_obj), "value_json.%s['%s']", EMSdevice::tag_to_mqtt(tag), entity);
snprintf(val_cond, sizeof(val_cond), "value_json.%s is defined and %s is defined", EMSdevice::tag_to_mqtt(tag), val_obj);
} else {
snprintf(val_obj, sizeof(val_obj), "value_json.%s", entity);
snprintf(val_obj, sizeof(val_obj), "value_json['%s']", entity);
snprintf(val_cond, sizeof(val_cond), "%s is defined", val_obj);
}

View File

@@ -36,7 +36,7 @@ using mqtt_sub_function_p = std::function<bool(const char * message)>;
class Mqtt {
public:
enum discoveryType : uint8_t { HOMEASSISTANT, DOMOTICZ, DOMOTICZ_LATEST };
enum entityFormat : uint8_t { SINGLE_LONG, SINGLE_SHORT, MULTI_SHORT };
enum entityFormat : uint8_t { SINGLE_LONG, SINGLE_SHORT, MULTI_SHORT, SINGLE_OLD, MULTI_OLD };
void loop();
void start();

View File

@@ -1120,7 +1120,7 @@ bool System::check_upgrade(bool factory_settings) {
missing_version = (settingsVersion.empty() || (settingsVersion.length() < 5));
if (missing_version) {
LOG_WARNING("No version information found (%s)", settingsVersion.c_str());
settingsVersion = "3.6.4"; // this was the last stable version
settingsVersion = "3.5.0"; // this was the last stable version without version info
}
}
@@ -1154,6 +1154,18 @@ bool System::check_upgrade(bool factory_settings) {
mqttSettings.entity_format = 0; // use old Entity ID format from v3.4
return StateUpdateResult::CHANGED;
});
} else if (settings_version.major() == 3 && settings_version.minor() <= 6) {
LOG_INFO("Setting MQTT Entity ID format to v3.6 format");
EMSESP::esp8266React.getMqttSettingsService()->update([&](MqttSettings & mqttSettings) {
if (mqttSettings.entity_format == 1) {
mqttSettings.entity_format = 3; // use old Entity ID format from v3.6
return StateUpdateResult::CHANGED;
} else if (mqttSettings.entity_format == 2) {
mqttSettings.entity_format = 4; // use old Entity ID format from v3.6
return StateUpdateResult::CHANGED;
}
return StateUpdateResult::UNCHANGED;
});
}
// Network Settings Wifi tx_power is now using the value * 4.

View File

@@ -499,8 +499,9 @@ void TemperatureSensor::publish_values(const bool force) {
} else if (!sensor.ha_registered || force) {
LOG_DEBUG("Recreating HA config for sensor ID %s", sensor.id().c_str());
JsonDocument config; // this needs to be large because of all the copying in add_ha_sections_to_doc()
config["dev_cla"] = "temperature";
JsonDocument config;
config["dev_cla"] = "temperature";
config["stat_cla"] = "measurement";
char stat_t[50];
snprintf(stat_t, sizeof(stat_t), "%s/%s_data", Mqtt::base().c_str(), F_(temperaturesensor)); // use base path

View File

@@ -1 +1 @@
#define EMSESP_APP_VERSION "3.7.0-dev.4"
#define EMSESP_APP_VERSION "3.7.0-dev.5"

View File

@@ -366,7 +366,7 @@ bool WebSchedulerService::command(const char * cmd, const char * data) {
snprintf(error, sizeof(error), "Scheduled command %s failed with error code (%s)", cmd, Command::return_code_string(return_code).c_str());
}
emsesp::EMSESP::logger().err(error);
emsesp::EMSESP::logger().warning(error);
return false;
}