remotetemp with RC200 v32.02, version as 10 byte telegram., fix #1622

This commit is contained in:
MichaelDvP
2024-02-17 18:32:29 +01:00
parent 4346de27b6
commit 38a546d6f7
5 changed files with 61 additions and 41 deletions

View File

@@ -32,7 +32,7 @@
"@types/imagemin": "^8.0.5", "@types/imagemin": "^8.0.5",
"@types/lodash-es": "^4.17.12", "@types/lodash-es": "^4.17.12",
"@types/node": "^20.11.19", "@types/node": "^20.11.19",
"@types/react": "^18.2.55", "@types/react": "^18.2.56",
"@types/react-dom": "^18.2.19", "@types/react-dom": "^18.2.19",
"@types/react-router-dom": "^5.3.3", "@types/react-router-dom": "^5.3.3",
"alova": "^2.17.0", "alova": "^2.17.0",
@@ -45,7 +45,7 @@
"react-dom": "latest", "react-dom": "latest",
"react-dropzone": "^14.2.3", "react-dropzone": "^14.2.3",
"react-icons": "^5.0.1", "react-icons": "^5.0.1",
"react-router-dom": "^6.22.0", "react-router-dom": "^6.22.1",
"react-toastify": "^10.0.4", "react-toastify": "^10.0.4",
"sockette": "^2.0.6", "sockette": "^2.0.6",
"typesafe-i18n": "^5.26.2", "typesafe-i18n": "^5.26.2",

View File

@@ -1299,10 +1299,10 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@remix-run/router@npm:1.15.0": "@remix-run/router@npm:1.15.1":
version: 1.15.0 version: 1.15.1
resolution: "@remix-run/router@npm:1.15.0" resolution: "@remix-run/router@npm:1.15.1"
checksum: 10/5cadae0c90874966ebd6b1b202284a337da32a68fc95af502859cd6158d3c254fbb4f76fa1844c837205dbc8a8120223360b9287a3d6aa0c747d02767c4c072c checksum: 10/d262285d155f80779894ee1d9ef07e35421986ba2546378dfe0e3b09397ce71becb6a4677e9efcd4155e2bd3f9f7f7ecbc110cd99bacee6dd7d3e5ce51b7caa8
languageName: node languageName: node
linkType: hard linkType: hard
@@ -1670,14 +1670,14 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"@types/react@npm:^18.2.55": "@types/react@npm:^18.2.56":
version: 18.2.55 version: 18.2.56
resolution: "@types/react@npm:18.2.55" resolution: "@types/react@npm:18.2.56"
dependencies: dependencies:
"@types/prop-types": "npm:*" "@types/prop-types": "npm:*"
"@types/scheduler": "npm:*" "@types/scheduler": "npm:*"
csstype: "npm:^3.0.2" csstype: "npm:^3.0.2"
checksum: 10/bf8fe19e73575489e63c0726355f164157cd69e75f2a862436ad2c0586e732cb953a7255a6bc73145e8f9506ee7a723f9a569ca9a39c53984e5b12b84e1c718a checksum: 10/de0df184f2b80e8724d79eead47f23e43e91a68c0712a5d989db3f1242f2c24179cf8e26520b5a141396b55f4928ce9a6c3a3a121a98eca8e82973920209f06c
languageName: node languageName: node
linkType: hard linkType: hard
@@ -1859,7 +1859,7 @@ __metadata:
"@types/imagemin": "npm:^8.0.5" "@types/imagemin": "npm:^8.0.5"
"@types/lodash-es": "npm:^4.17.12" "@types/lodash-es": "npm:^4.17.12"
"@types/node": "npm:^20.11.19" "@types/node": "npm:^20.11.19"
"@types/react": "npm:^18.2.55" "@types/react": "npm:^18.2.56"
"@types/react-dom": "npm:^18.2.19" "@types/react-dom": "npm:^18.2.19"
"@types/react-router-dom": "npm:^5.3.3" "@types/react-router-dom": "npm:^5.3.3"
"@typescript-eslint/eslint-plugin": "npm:^7.0.1" "@typescript-eslint/eslint-plugin": "npm:^7.0.1"
@@ -1886,7 +1886,7 @@ __metadata:
react-dom: "npm:latest" react-dom: "npm:latest"
react-dropzone: "npm:^14.2.3" react-dropzone: "npm:^14.2.3"
react-icons: "npm:^5.0.1" react-icons: "npm:^5.0.1"
react-router-dom: "npm:^6.22.0" react-router-dom: "npm:^6.22.1"
react-toastify: "npm:^10.0.4" react-toastify: "npm:^10.0.4"
rollup-plugin-visualizer: "npm:^5.12.0" rollup-plugin-visualizer: "npm:^5.12.0"
sockette: "npm:^2.0.6" sockette: "npm:^2.0.6"
@@ -7192,27 +7192,27 @@ __metadata:
languageName: node languageName: node
linkType: hard linkType: hard
"react-router-dom@npm:^6.22.0": "react-router-dom@npm:^6.22.1":
version: 6.22.0 version: 6.22.1
resolution: "react-router-dom@npm:6.22.0" resolution: "react-router-dom@npm:6.22.1"
dependencies: dependencies:
"@remix-run/router": "npm:1.15.0" "@remix-run/router": "npm:1.15.1"
react-router: "npm:6.22.0" react-router: "npm:6.22.1"
peerDependencies: peerDependencies:
react: ">=16.8" react: ">=16.8"
react-dom: ">=16.8" react-dom: ">=16.8"
checksum: 10/32ba0386d400354094116fa7dd98f1d23bc7cf683b0f4509694be5f730d4957fcb8cc73e35946576fc3f48b4d36743422f1b9bcdc37ad77f04bde0bde5d9102e checksum: 10/73ab964083bb407773a5c4ca61249ed6b0a1b47fa58c39afca08a361eb25b349be2bcbaf6d89e112b020f6e55e40e62689c9fe2beae524030ce5ccede3c7d9e3
languageName: node languageName: node
linkType: hard linkType: hard
"react-router@npm:6.22.0": "react-router@npm:6.22.1":
version: 6.22.0 version: 6.22.1
resolution: "react-router@npm:6.22.0" resolution: "react-router@npm:6.22.1"
dependencies: dependencies:
"@remix-run/router": "npm:1.15.0" "@remix-run/router": "npm:1.15.1"
peerDependencies: peerDependencies:
react: ">=16.8" react: ">=16.8"
checksum: 10/627c25533667da0c8008587208e0d5633409173969fd579de706cde355465f6d1245e2b1a7ca2adeb96201f2858932b59ce3402482786cd20c4bf278562976dd checksum: 10/f6e814b8e3005f16a5fb0e831f0e4352076cde65ab25448d56dba87a43fd3e102f55f9b366bdf1fbd8136fc1dc141bcec8d6b85d45f309e89180fb50f173744d
languageName: node languageName: node
linkType: hard linkType: hard

View File

@@ -607,7 +607,7 @@ bool Mqtt::queue_message(const uint8_t operation, const std::string & topic, con
} }
// check free mem // check free mem
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
if (ESP.getFreeHeap() < 60 * 1204 || ESP.getMaxAllocHeap() < 40 * 1024) { if (ESP.getFreeHeap() < 60 * 1024 || ESP.getMaxAllocHeap() < 40 * 1024) {
if (operation == Operation::PUBLISH) { if (operation == Operation::PUBLISH) {
mqtt_message_id_++; mqtt_message_id_++;
mqtt_publish_fails_++; mqtt_publish_fails_++;

View File

@@ -177,33 +177,53 @@ void Roomctrl::check(uint8_t addr, const uint8_t * data, const uint8_t length) {
* send version info RC20 (Prod. 113, Ver. 02.01) or RC20RF (Prod. 93, Ver. 02.00) * send version info RC20 (Prod. 113, Ver. 02.01) or RC20RF (Prod. 93, Ver. 02.00)
*/ */
void Roomctrl::version(uint8_t addr, uint8_t dst) { void Roomctrl::version(uint8_t addr, uint8_t dst) {
uint8_t data[15]; uint8_t data[20];
data[0] = addr | EMSbus::ems_mask(); data[0] = addr | EMSbus::ems_mask();
data[1] = dst & 0x7F; data[1] = dst & 0x7F;
data[2] = 0x02; data[2] = 0x02;
data[3] = 0; data[3] = 0;
data[4] = type_; // set RC20 id 113, Ver 02.01 or Junkers FB10 id 109, Ver 16.05, RC100H id 200 ver 40.04 data[4] = type_; // set RC20 id 113, Ver 02.01 or Junkers FB10 id 109, Ver 16.05, RC100H id 200 ver 40.04
data[5] = type_ == RC20 ? 2 : type_ == FB10 ? 16 : type_ == RC200 ? 41 : 40; if (type_ == RC20) {
data[6] = type_ == RC20 ? 1 : type_ == FB10 ? 5 : type_ == RC200 ? 8 : 4; data[5] = 2; // version 2.01
if (type_ == RC20 || type_ == FB10) { data[6] = 1;
data[7] = EMSbus::calculate_crc(data, 7); // apppend CRC data[7] = EMSbus::calculate_crc(data, 7); // apppend CRC
EMSuart::transmit(data, 8); EMSuart::transmit(data, 8);
return; return;
} } else if (type_ == FB10) {
data[5] = 16; // version 16.05
data[6] = 5;
data[7] = 0; data[7] = 0;
data[8] = 0xFF; data[8] = 0;
if (type_ == RC100H) {
data[9] = EMSbus::calculate_crc(data, 9); // apppend CRC
EMSuart::transmit(data, 10);
return;
}
// RC200 adds some extra bytes
data[9] = 0; data[9] = 0;
data[10] = 0; data[10] = 0;
data[11] = 0; data[11] = 0;
data[12] = 0; data[12] = 0;
data[13] = EMSbus::calculate_crc(data, 13); // apppend CRC data[13] = 0;
EMSuart::transmit(data, 14); data[14] = EMSbus::calculate_crc(data, 14); // apppend CRC
EMSuart::transmit(data, 15);
return;
} else if (type_ == RC200) {
data[5] = 32; // version 32.02 see #1611
data[6] = 2;
data[7] = 0;
data[8] = 0xFF;
data[9] = 0;
data[10] = 0;
data[11] = 0;
data[12] = 0;
data[13] = 0;
data[14] = EMSbus::calculate_crc(data, 14); // apppend CRC
EMSuart::transmit(data, 15);
return;
} else if (type_ == RC100H) {
data[5] = 40; // version 40.04
data[6] = 4;
data[7] = 0;
data[8] = 0xFF;
data[9] = EMSbus::calculate_crc(data, 9); // apppend CRC
EMSuart::transmit(data, 10);
return;
}
} }
/** /**
@@ -262,7 +282,7 @@ void Roomctrl::temperature(uint8_t addr, uint8_t dst, uint8_t hc) {
data[5] = 0x2B + hc; data[5] = 0x2B + hc;
data[6] = (uint8_t)(remotetemp_[hc] >> 8); data[6] = (uint8_t)(remotetemp_[hc] >> 8);
data[7] = (uint8_t)(remotetemp_[hc] & 0xFF); data[7] = (uint8_t)(remotetemp_[hc] & 0xFF);
uint16_t t1 = remotetemp_[hc] * 10 + 5; uint16_t t1 = remotetemp_[hc] * 10 + 3;
data[8] = (uint8_t)(t1 >> 8); data[8] = (uint8_t)(t1 >> 8);
data[9] = (uint8_t)(t1 & 0xFF); data[9] = (uint8_t)(t1 & 0xFF);
data[10] = 1; // not sure what this is and if we need it, maybe mode? data[10] = 1; // not sure what this is and if we need it, maybe mode?

View File

@@ -35,7 +35,7 @@ class Roomctrl {
private: private:
static constexpr uint8_t ADDR = 0x18; // address for hc1 static constexpr uint8_t ADDR = 0x18; // address for hc1
static constexpr uint32_t SEND_INTERVAL = 30000; // 1/2 minute static constexpr uint32_t SEND_INTERVAL = 55000; // ~1 minute
static constexpr uint8_t HCS = 4; // max 4 heating circuits static constexpr uint8_t HCS = 4; // max 4 heating circuits
static uint8_t get_hc(const uint8_t addr); static uint8_t get_hc(const uint8_t addr);